]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/create_group.sgml
More minor updates and copy-editing.
[postgresql] / doc / src / sgml / ref / create_group.sgml
1 <!--
2 $PostgreSQL: pgsql/doc/src/sgml/ref/create_group.sgml,v 1.15 2005/01/04 00:39:53 tgl Exp $
3 PostgreSQL documentation
4 -->
5
6 <refentry id="SQL-CREATEGROUP">
7  <refmeta>
8   <refentrytitle id="sql-creategroup-title">CREATE GROUP</refentrytitle>
9   <refmiscinfo>SQL - Language Statements</refmiscinfo>
10  </refmeta>
11
12  <refnamediv>
13   <refname>CREATE GROUP</refname>
14   <refpurpose>define a new user group</refpurpose>
15  </refnamediv>
16
17  <indexterm zone="sql-creategroup">
18   <primary>CREATE GROUP</primary>
19  </indexterm>
20
21  <refsynopsisdiv>
22 <synopsis>
23 CREATE GROUP <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replaceable class="PARAMETER">option</replaceable> [ ... ] ]
24
25 where <replaceable class="PARAMETER">option</replaceable> can be:
26
27      SYSID <replaceable class="PARAMETER">gid</replaceable>
28    | USER  <replaceable class="PARAMETER">username</replaceable> [, ...]
29 </synopsis>
30  </refsynopsisdiv>
31
32  <refsect1>
33   <title>Description</title>
34
35   <para>
36    <command>CREATE GROUP</command> will create a new group of users.
37    You must be a database superuser to use this command.
38   </para>
39
40   <para>
41    Note that both users and groups are defined at the database cluster
42    level, and so are valid in all databases in the cluster.
43   </para>
44
45   <para>
46    Use <xref linkend="SQL-ALTERGROUP" endterm="SQL-ALTERGROUP-title">
47    to change a group's membership, and <xref linkend="SQL-DROPGROUP"
48    endterm="SQL-DROPGROUP-title"> to remove a group.
49   </para>  
50  </refsect1> 
51   
52  <refsect1>
53   <title>Parameters</title>
54
55     <variablelist>
56      <varlistentry>
57       <term><replaceable class="parameter">name</replaceable></term>
58       <listitem>
59        <para>
60         The name of the group.
61        </para>
62       </listitem>
63      </varlistentry>
64
65      <varlistentry>
66       <term><replaceable class="parameter">gid</replaceable></term>
67       <listitem>
68        <para>
69         The <literal>SYSID</literal> clause can be used to choose
70         the <productname>PostgreSQL</productname> group ID of the new
71         group.
72         This is normally not necessary, but may
73         be useful if you need to recreate a group referenced in the
74         permissions of some object.
75        </para>
76        <para>
77         If this is not specified, the highest assigned group ID plus one
78         (with a minimum of 100) will be used as default.
79        </para>
80       </listitem>
81      </varlistentry>
82
83      <varlistentry>
84       <term><replaceable class="parameter">username</replaceable></term>
85       <listitem>
86        <para>
87         A list of users to include in the group. The users must already exist.
88        </para>
89       </listitem>
90      </varlistentry>
91
92     </variablelist>
93  </refsect1>
94
95  <refsect1>
96   <title>Examples</title>
97
98   <para>
99    Create an empty group:
100 <programlisting>
101 CREATE GROUP staff;
102 </programlisting>
103   </para>
104
105   <para>
106    Create a group with members:
107 <programlisting>
108 CREATE GROUP marketing WITH USER jonathan, david;
109 </programlisting>
110   </para>
111  </refsect1>
112  
113  <refsect1>
114   <title>Compatibility</title>
115   
116   <para>
117    There is no <command>CREATE GROUP</command> statement in the SQL
118    standard.  Roles are similar in concept to groups.
119   </para>
120  </refsect1>
121
122  <refsect1>
123   <title>See Also</title>
124
125   <simplelist type="inline">
126    <member><xref linkend="sql-altergroup" endterm="sql-altergroup-title"></member>
127    <member><xref linkend="sql-dropgroup" endterm="sql-dropgroup-title"></member>
128   </simplelist>
129  </refsect1>
130 </refentry>
131
132 <!-- Keep this comment at the end of the file
133 Local variables:
134 mode: sgml
135 sgml-omittag:nil
136 sgml-shorttag:t
137 sgml-minimize-attributes:nil
138 sgml-always-quote-attributes:t
139 sgml-indent-step:1
140 sgml-indent-data:t
141 sgml-parent-document:nil
142 sgml-default-dtd-file:"../reference.ced"
143 sgml-exposed-tags:nil
144 sgml-local-catalogs:"/usr/lib/sgml/catalog"
145 sgml-local-ecat-files:nil
146 End:
147 -->