1ALTER GROUP(7)           PostgreSQL 12.6 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_USER
16         | SESSION_USER
17
18       ALTER GROUP group_name RENAME TO new_name
19

DESCRIPTION

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

PARAMETERS

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

EXAMPLES

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

COMPATIBILITY

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

SEE ALSO

60       GRANT(7), REVOKE(7), ALTER ROLE (ALTER_ROLE(7))
61
62
63
64PostgreSQL 12.6                      2021                       ALTER GROUP(7)
Impressum