]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/create_group.sgml
7252ae66854b2b082e536561e674ea68f57fe99c
[postgresql] / doc / src / sgml / ref / create_group.sgml
1 <!--
2 $PostgreSQL: pgsql/doc/src/sgml/ref/create_group.sgml,v 1.14 2003/11/29 19:51:38 pgsql 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 in the
37    database cluster.  You must be a database
38    superuser to use this command.
39   </para>
40
41   <para>
42    Use <xref linkend="SQL-ALTERGROUP" endterm="SQL-ALTERGROUP-title">
43    to change a group's membership, and <xref linkend="SQL-DROPGROUP"
44    endterm="SQL-DROPGROUP-title"> to remove a group.
45   </para>  
46  </refsect1> 
47   
48  <refsect1>
49   <title>Parameters</title>
50
51     <variablelist>
52      <varlistentry>
53       <term><replaceable class="parameter">name</replaceable></term>
54       <listitem>
55        <para>
56         The name of the group.
57        </para>
58       </listitem>
59      </varlistentry>
60
61      <varlistentry>
62       <term><replaceable class="parameter">gid</replaceable></term>
63       <listitem>
64        <para>
65         The <literal>SYSID</literal> clause can be used to choose
66         the <productname>PostgreSQL</productname> group ID of the new
67         group. It is not necessary to do so, however.
68        </para>
69        <para>
70         If this is not specified, the highest assigned group ID plus one,
71         starting at 1, will be used as default.
72        </para>
73       </listitem>
74      </varlistentry>
75
76      <varlistentry>
77       <term><replaceable class="parameter">username</replaceable></term>
78       <listitem>
79        <para>
80         A list of users to include in the group. The users must already exist.
81        </para>
82       </listitem>
83      </varlistentry>
84
85     </variablelist>
86  </refsect1>
87
88  <refsect1>
89   <title>Examples</title>
90
91   <para>
92    Create an empty group:
93 <programlisting>
94 CREATE GROUP staff;
95 </programlisting>
96   </para>
97
98   <para>
99    Create a group with members:
100 <programlisting>
101 CREATE GROUP marketing WITH USER jonathan, david;
102 </programlisting>
103   </para>
104  </refsect1>
105  
106  <refsect1>
107   <title>Compatibility</title>
108   
109   <para>
110    There is no <command>CREATE GROUP</command> statement in the SQL
111    standard.  Roles are similar in concept to groups.
112   </para>
113  </refsect1>
114 </refentry>
115
116 <!-- Keep this comment at the end of the file
117 Local variables:
118 mode: sgml
119 sgml-omittag:nil
120 sgml-shorttag:t
121 sgml-minimize-attributes:nil
122 sgml-always-quote-attributes:t
123 sgml-indent-step:1
124 sgml-indent-data:t
125 sgml-parent-document:nil
126 sgml-default-dtd-file:"../reference.ced"
127 sgml-exposed-tags:nil
128 sgml-local-catalogs:"/usr/lib/sgml/catalog"
129 sgml-local-ecat-files:nil
130 End:
131 -->