ALTER_GROUP(7pg14)
π ALTER GROUP π
okay so real talk β this is the ALTER GROUP page from the PostgreSQL 14.24 Documentation, manual ALTER GROUP(7). she's a legacy queen but she still shows up to the party π
β¨ NAME β¨
ALTER_GROUP β change role name or membership
β¨ SYNOPSIS β¨
ALTER GROUP role_specification ADD USER user_name [, ... ]
ALTER GROUP role_specification DROP USER user_name [, ... ]
where role_specification can be:
role_name
| CURRENT_ROLE
| CURRENT_USER
| SESSION_USER
ALTER GROUP group_name RENAME TO new_name
β¨ DESCRIPTION β¨
So ALTER GROUP changes the attributes of a user group. But bestie, we need to talk: this command is obsolete π it's still accepted for backwards compatibility, but only because groups (and users too, honestly) got superseded by the way more general concept of roles. it's giving "still on the group chat but never replies".
The first two variants add users to a group or remove them from a group. (and like β any role can play the part of either a "user" or a "group" for this purpose, the labels are basically vibes π¦) These variants are effectively equivalent to granting or revoking membership in the role named as the "group"; so the preferred way to do this is to use GRANT or REVOKE. periodt.
The third variant changes the name of the group. This is exactly equivalent to renaming the role with ALTER ROLE. no cap, same thing.
β¨ PARAMETERS β¨
group_nameβ the name of the group (role) to modify. that's the one getting the glow-up πuser_nameβ users (roles) that are to be added to or removed from the group. heads up: the users must already exist βALTER GROUPdoes not create or drop users, it's not a fairy godmother π§new_nameβ the new name of the group. the rebrand β¨
β¨ EXAMPLES β¨
Add users to a group:
ALTER GROUP staff ADD USER karl, john;
Remove a user from a group:
ALTER GROUP workers DROP USER beth;
β¨ COMPATIBILITY β¨
There is no ALTER GROUP statement in the SQL standard. π she's off-script, she's original, she's doing her own thing.
β¨ SEE ALSO β¨
GRANT(7), REVOKE(7), ALTER ROLE (ALTER_ROLE(7))
okay that's the whole page, you ate that π«Ά go forth and use GRANT/REVOKE like the main character you are π
PostgreSQL 14.24 Β· 2026 Β· ALTER GROUP(7) β mwah, that's the sign-off, ily, see u in the next manpage ππΈ
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms