]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/alter_group.sgml
0b9af5f74e04990006fd4128d0c93df37b10a5aa
[postgresql] / doc / src / sgml / ref / alter_group.sgml
1 <!--
2 $PostgreSQL: pgsql/doc/src/sgml/ref/alter_group.sgml,v 1.14 2003/11/29 19:51:38 pgsql Exp $
3 PostgreSQL documentation
4 -->
5
6 <refentry id="SQL-ALTERGROUP">
7  <refmeta>
8   <refentrytitle id="SQL-ALTERGROUP-title">ALTER GROUP</refentrytitle>
9   <refmiscinfo>SQL - Language Statements</refmiscinfo>
10  </refmeta>
11
12  <refnamediv>
13   <refname>ALTER GROUP</refname>
14   <refpurpose>change a user group</refpurpose>
15  </refnamediv>
16
17  <indexterm zone="sql-altergroup">
18   <primary>ALTER GROUP</primary>
19  </indexterm>
20
21  <refsynopsisdiv>
22 <synopsis>
23 ALTER GROUP <replaceable class="PARAMETER">groupname</replaceable> ADD USER <replaceable class="PARAMETER">username</replaceable> [, ... ]
24 ALTER GROUP <replaceable class="PARAMETER">groupname</replaceable> DROP USER <replaceable class="PARAMETER">username</replaceable> [, ... ]
25
26 ALTER GROUP <replaceable class="PARAMETER">groupname</replaceable> RENAME TO <replaceable>newname</replaceable>
27 </synopsis>
28  </refsynopsisdiv>
29
30  <refsect1>
31   <title>Description</title>
32
33   <para>
34    <command>ALTER GROUP</command> is used to change a user group.  The
35    first two variants add or remove users from a group. Only database
36    superusers can use this command.  Adding a user to a group does not
37    create the user. Similarly, removing a user from a group does not
38    drop the user itself.
39   </para>
40
41   <para>
42    The third variant changes the name of the group.  Only a database
43    superuser can rename groups.
44   </para>
45  </refsect1>
46
47  <refsect1>
48   <title>Parameters</title>
49
50   <variablelist>
51    <varlistentry>
52     <term><replaceable class="PARAMETER">groupname</replaceable></term>
53     <listitem>
54      <para>
55       The name of the group to modify.
56      </para>
57     </listitem>
58    </varlistentry>
59
60    <varlistentry>
61     <term><replaceable class="PARAMETER">username</replaceable></term>
62     <listitem>
63      <para>
64       Users which are to be added or removed from the group. The users
65       must exist.
66      </para>
67     </listitem>
68    </varlistentry>
69
70    <varlistentry>
71     <term><replaceable>newname</replaceable></term>
72     <listitem>
73      <para>
74       The new name of the group.
75      </para>
76     </listitem>
77    </varlistentry>
78   </variablelist>
79  </refsect1>
80
81  <refsect1>
82   <title>Examples</title>
83   <para>
84    Add users to a group:
85
86 <programlisting>
87 ALTER GROUP staff ADD USER karl, john;
88 </programlisting>
89
90    Remove a user from a group:
91
92 <programlisting>
93 ALTER GROUP workers DROP USER beth;
94 </programlisting>
95
96   </para>
97  </refsect1>
98
99  <refsect1>
100   <title>Compatibility</title>
101     
102   <para>
103    There is no <command>ALTER GROUP</command> statement in the SQL
104    standard. The concept of roles is similar.
105   </para>
106  </refsect1>
107
108  <refsect1>
109   <title>See Also</title>
110
111   <simplelist type="inline">
112    <member><xref linkend="sql-creategroup" endterm="sql-creategroup-title"></member>
113    <member><xref linkend="sql-dropgroup" endterm="sql-dropgroup-title"></member>
114   </simplelist>
115  </refsect1>
116
117 </refentry>
118
119 <!-- Keep this comment at the end of the file
120 Local variables:
121 mode: sgml
122 sgml-omittag:nil
123 sgml-shorttag:t
124 sgml-minimize-attributes:nil
125 sgml-always-quote-attributes:t
126 sgml-indent-step:1
127 sgml-indent-data:t
128 sgml-parent-document:nil
129 sgml-default-dtd-file:"../reference.ced"
130 sgml-exposed-tags:nil
131 sgml-local-catalogs:"/usr/lib/sgml/catalog"
132 sgml-local-ecat-files:nil
133 End:
134 -->