3 PostgreSQL documentation
6 <refentry id=
"SQL-ALTERGROUP">
8 <refentrytitle id=
"SQL-ALTERGROUP-title">ALTER GROUP
</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
14 <refname>ALTER GROUP
</refname>
15 <refpurpose>change role name or membership
</refpurpose>
18 <indexterm zone=
"sql-altergroup">
19 <primary>ALTER GROUP
</primary>
24 ALTER GROUP
<replaceable class=
"PARAMETER">groupname
</replaceable> ADD USER
<replaceable class=
"PARAMETER">username
</replaceable> [, ... ]
25 ALTER GROUP
<replaceable class=
"PARAMETER">groupname
</replaceable> DROP USER
<replaceable class=
"PARAMETER">username
</replaceable> [, ... ]
27 ALTER GROUP
<replaceable class=
"PARAMETER">groupname
</replaceable> RENAME TO
<replaceable>newname
</replaceable>
32 <title>Description
</title>
35 <command>ALTER GROUP
</command> changes the attributes of a user group.
36 This is an obsolete command, though still accepted for backwards
37 compatibility, because groups (and users too) have been superseded by the
38 more general concept of roles.
42 The first two variants add users to a group or remove them from a group.
43 (Any role can play the part of either a
<quote>user<
/> or a
44 <quote>group<
/> for this purpose.) These variants are effectively
45 equivalent to granting or revoking membership in the role named as the
46 <quote>group<
/>; so the preferred way to do this is to use
47 <xref linkend=
"SQL-GRANT" endterm=
"SQL-GRANT-title"> or
48 <xref linkend=
"SQL-REVOKE" endterm=
"SQL-REVOKE-title">.
52 The third variant changes the name of the group. This is exactly
53 equivalent to renaming the role with
54 <xref linkend=
"sql-alterrole" endterm=
"sql-alterrole-title">.
59 <title>Parameters
</title>
63 <term><replaceable class=
"PARAMETER">groupname
</replaceable></term>
66 The name of the group (role) to modify.
72 <term><replaceable class=
"PARAMETER">username
</replaceable></term>
75 Users (roles) that are to be added to or removed from the group.
76 The users must already exist;
<command>ALTER GROUP<
/> does not
83 <term><replaceable>newname
</replaceable></term>
86 The new name of the group.
94 <title>Examples
</title>
99 ALTER GROUP staff ADD USER karl, john;
102 Remove a user from a group:
105 ALTER GROUP workers DROP USER beth;
112 <title>Compatibility
</title>
115 There is no
<command>ALTER GROUP
</command> statement in the SQL
121 <title>See Also
</title>
123 <simplelist type=
"inline">
124 <member><xref linkend=
"sql-grant" endterm=
"sql-grant-title"></member>
125 <member><xref linkend=
"sql-revoke" endterm=
"sql-revoke-title"></member>
126 <member><xref linkend=
"sql-alterrole" endterm=
"sql-alterrole-title"></member>