| 1 |
<!-- |
| 2 |
doc/src/sgml/ref/create_user.sgml |
| 3 |
PostgreSQL documentation |
| 4 |
--> |
| 5 |
|
| 6 |
<refentry id="sql-createuser"> |
| 7 |
<indexterm zone="sql-createuser"> |
| 8 |
<primary>CREATE USER</primary> |
| 9 |
</indexterm> |
| 10 |
|
| 11 |
<refmeta> |
| 12 |
<refentrytitle>CREATE USER</refentrytitle> |
| 13 |
<manvolnum>7</manvolnum> |
| 14 |
<refmiscinfo>SQL - Language Statements</refmiscinfo> |
| 15 |
</refmeta> |
| 16 |
|
| 17 |
<refnamediv> |
| 18 |
<refname>CREATE USER</refname> |
| 19 |
<refpurpose>define a new database role</refpurpose> |
| 20 |
</refnamediv> |
| 21 |
|
| 22 |
<refsynopsisdiv> |
| 23 |
<synopsis> |
| 24 |
CREATE USER <replaceable class="parameter">name</replaceable> [ [ WITH ] <replaceable class="parameter">option</replaceable> [ ... ] ] |
| 25 |
|
| 26 |
<phrase>where <replaceable class="parameter">option</replaceable> can be:</phrase> |
| 27 |
|
| 28 |
SUPERUSER | NOSUPERUSER |
| 29 |
| CREATEDB | NOCREATEDB |
| 30 |
| CREATEROLE | NOCREATEROLE |
| 31 |
| INHERIT | NOINHERIT |
| 32 |
| LOGIN | NOLOGIN |
| 33 |
| REPLICATION | NOREPLICATION |
| 34 |
| BYPASSRLS | NOBYPASSRLS |
| 35 |
| CONNECTION LIMIT <replaceable class="parameter">connlimit</replaceable> |
| 36 |
| [ ENCRYPTED ] PASSWORD '<replaceable class="parameter">password</replaceable>' | PASSWORD NULL |
| 37 |
| VALID UNTIL '<replaceable class="parameter">timestamp</replaceable>' |
| 38 |
| IN ROLE <replaceable class="parameter">role_name</replaceable> [, ...] |
| 39 |
| IN GROUP <replaceable class="parameter">role_name</replaceable> [, ...] |
| 40 |
| ROLE <replaceable class="parameter">role_name</replaceable> [, ...] |
| 41 |
| ADMIN <replaceable class="parameter">role_name</replaceable> [, ...] |
| 42 |
| USER <replaceable class="parameter">role_name</replaceable> [, ...] |
| 43 |
| SYSID <replaceable class="parameter">uid</replaceable> |
| 44 |
</synopsis> |
| 45 |
</refsynopsisdiv> |
| 46 |
|
| 47 |
<refsect1> |
| 48 |
<title>Description</title> |
| 49 |
|
| 50 |
<para> |
| 51 |
<command>CREATE USER</command> is now an alias for |
| 52 |
<link linkend="sql-createrole"><command>CREATE ROLE</command></link>. |
| 53 |
The only difference is that when the command is spelled |
| 54 |
<command>CREATE USER</command>, <literal>LOGIN</literal> is assumed |
| 55 |
by default, whereas <literal>NOLOGIN</literal> is assumed when |
| 56 |
the command is spelled |
| 57 |
<command>CREATE ROLE</command>. |
| 58 |
</para> |
| 59 |
</refsect1> |
| 60 |
|
| 61 |
<refsect1> |
| 62 |
<title>Compatibility</title> |
| 63 |
|
| 64 |
<para> |
| 65 |
The <command>CREATE USER</command> statement is a |
| 66 |
<productname>PostgreSQL</productname> extension. The SQL standard |
| 67 |
leaves the definition of users to the implementation. |
| 68 |
</para> |
| 69 |
</refsect1> |
| 70 |
|
| 71 |
<refsect1> |
| 72 |
<title>See Also</title> |
| 73 |
|
| 74 |
<simplelist type="inline"> |
| 75 |
<member><xref linkend="sql-createrole"/></member> |
| 76 |
</simplelist> |
| 77 |
</refsect1> |
| 78 |
</refentry> |