CREATE USER (original) (raw)
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for thecurrent version, or one of the other supported versions listed above instead.
CREATE USER — define a new database role
Synopsis
CREATE USER name
[ [ WITH ] option
[ ... ] ]
where option
can be:
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATEROLE | NOCREATEROLE
| INHERIT | NOINHERIT
| LOGIN | NOLOGIN
| REPLICATION | NOREPLICATION
| BYPASSRLS | NOBYPASSRLS
| CONNECTION LIMIT _`connlimit`_
| [ ENCRYPTED ] PASSWORD '_`password`_'
| VALID UNTIL '_`timestamp`_'
| IN ROLE _`rolename`_ [, ...]
| IN GROUP _`rolename`_ [, ...]
| ROLE _`rolename`_ [, ...]
| ADMIN _`rolename`_ [, ...]
| USER _`rolename`_ [, ...]
| SYSID _`uid`_
Description
CREATE USER
is now an alias for CREATE ROLE. The only difference is that when the command is spelled CREATE USER
, LOGIN
is assumed by default, whereas NOLOGIN
is assumed when the command is spelled CREATE ROLE
.
Compatibility
The CREATE USER
statement is a PostgreSQL extension. The SQL standard leaves the definition of users to the implementation.