HomeMogDBMogDB StackUqbar
v5.0

Documentation:v5.0

Supported Versions:

ALTER GROUP

Function

ALTER GROUP modifies the attributes of a user group.

Precautions

ALTER GROUP is an alias for ALTER ROLE, and it is not a standard SQL syntax and not recommended. Users can use ALTER ROLE directly.

Syntax

  • Add users to a group.

    AlterGroup ::= ALTER GROUP group_name
        ADD USER user_name [, ... ];
  • Remove users from a group.

    AlterGroup ::= ALTER GROUP group_name
        DROP USER user_name [, ... ];
  • Change the name of the group.

    AlterGroup ::= ALTER GROUP group_name
        RENAME TO new_name;

Parameter Description

See Parameter Description in ALTER ROLE.

Example

-- Add users to a group.
MogDB=# ALTER GROUP super_users ADD USER lche, jim;

-- Remove users from a group.
MogDB=# ALTER GROUP super_users DROP USER jim;

-- Change the name of the group.
MogDB=# ALTER GROUP super_users RENAME TO normal_users;

ALTER GROUPDROP GROUPALTER ROLE

Copyright © 2011-2024 www.enmotech.com All rights reserved.