Updated on 2025-07-22 GMT+08:00

ALTER GROUP

Function

This syntax modifies the attributes of a user group.

Precautions

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

Syntax

  • Add users to a group.
    1
    2
    ALTER GROUP group_name 
        ADD USER user_name [, ... ];
    
  • Remove users from a group.
    1
    2
    ALTER GROUP group_name 
        DROP USER user_name [, ... ];
    
  • Change the name of the group.
    1
    2
    ALTER GROUP group_name 
        RENAME TO new_name;
    

Parameter Description

For details about more parameters, see Parameter Description in ALTER ROLE.

Table 1 ALTER GROUP parameters

Parameter

Description

Value Range

group_name

Specifies the name of the user group to be modified.

A string that indicates the name of an existing group.

user_name

Specifies the user to be added to or removed from the group.

Name of an existing user.

new_name

Specifies the new name of a group.

A string compliant with the identifier naming rules.

Helpful Links

CREATE GROUP, DROP GROUP, and ALTER ROLE