1ALTER GROUP(7)           PostgreSQL 15.4 Documentation          ALTER GROUP(7)
2
3
4

NAME

6       ALTER_GROUP - change role name or membership
7

SYNOPSIS

9       ALTER GROUP role_specification ADD USER user_name [, ... ]
10       ALTER GROUP role_specification DROP USER user_name [, ... ]
11
12       where role_specification can be:
13
14           role_name
15         | CURRENT_ROLE
16         | CURRENT_USER
17         | SESSION_USER
18
19       ALTER GROUP group_name RENAME TO new_name
20

DESCRIPTION

22       ALTER GROUP changes the attributes of a user group. This is an obsolete
23       command, though still accepted for backwards compatibility, because
24       groups (and users too) have been superseded by the more general concept
25       of roles.
26
27       The first two variants add users to a group or remove them from a
28       group. (Any role can play the part of either a “user” or a “group” for
29       this purpose.) These variants are effectively equivalent to granting or
30       revoking membership in the role named as the “group”; so the preferred
31       way to do this is to use GRANT or REVOKE.
32
33       The third variant changes the name of the group. This is exactly
34       equivalent to renaming the role with ALTER ROLE.
35

PARAMETERS

37       group_name
38           The name of the group (role) to modify.
39
40       user_name
41           Users (roles) that are to be added to or removed from the group.
42           The users must already exist; ALTER GROUP does not create or drop
43           users.
44
45       new_name
46           The new name of the group.
47

EXAMPLES

49       Add users to a group:
50
51           ALTER GROUP staff ADD USER karl, john;
52
53       Remove a user from a group:
54
55           ALTER GROUP workers DROP USER beth;
56

COMPATIBILITY

58       There is no ALTER GROUP statement in the SQL standard.
59

SEE ALSO

61       GRANT(7), REVOKE(7), ALTER ROLE (ALTER_ROLE(7))
62
63
64
65PostgreSQL 15.4                      2023                       ALTER GROUP(7)
Impressum