2
$PostgreSQL: pgsql/doc/src/sgml/ref/create_group.sgml,v 1.15 2005-01-04 00:39:53 tgl Exp $
3
PostgreSQL documentation
6
<refentry id="SQL-CREATEGROUP">
8
<refentrytitle id="sql-creategroup-title">CREATE GROUP</refentrytitle>
9
<refmiscinfo>SQL - Language Statements</refmiscinfo>
13
<refname>CREATE GROUP</refname>
14
<refpurpose>define a new user group</refpurpose>
17
<indexterm zone="sql-creategroup">
18
<primary>CREATE GROUP</primary>
23
CREATE GROUP <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replaceable class="PARAMETER">option</replaceable> [ ... ] ]
25
where <replaceable class="PARAMETER">option</replaceable> can be:
27
SYSID <replaceable class="PARAMETER">gid</replaceable>
28
| USER <replaceable class="PARAMETER">username</replaceable> [, ...]
33
<title>Description</title>
36
<command>CREATE GROUP</command> will create a new group of users.
37
You must be a database superuser to use this command.
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.
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.
53
<title>Parameters</title>
57
<term><replaceable class="parameter">name</replaceable></term>
60
The name of the group.
66
<term><replaceable class="parameter">gid</replaceable></term>
69
The <literal>SYSID</literal> clause can be used to choose
70
the <productname>PostgreSQL</productname> group ID of the new
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.
77
If this is not specified, the highest assigned group ID plus one
78
(with a minimum of 100) will be used as default.
84
<term><replaceable class="parameter">username</replaceable></term>
87
A list of users to include in the group. The users must already exist.
96
<title>Examples</title>
99
Create an empty group:
106
Create a group with members:
108
CREATE GROUP marketing WITH USER jonathan, david;
114
<title>Compatibility</title>
117
There is no <command>CREATE GROUP</command> statement in the SQL
118
standard. Roles are similar in concept to groups.
123
<title>See Also</title>
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>
132
<!-- Keep this comment at the end of the file
137
sgml-minimize-attributes:nil
138
sgml-always-quote-attributes: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