Difference between revisions of "PostgreSQL: CREATE ROLE"

From wikieduonline
Jump to navigation Jump to search
 
Line 1: Line 1:
 
<code>[[CREATE]] ROLE</code> adds a new [[role]] to a [[PostgreSQL]] database [[cluster]]. A role can be considered a [[user]], or [[group]].
 
<code>[[CREATE]] ROLE</code> adds a new [[role]] to a [[PostgreSQL]] database [[cluster]]. A role can be considered a [[user]], or [[group]].
 
 
 
==Overview==
 
==Overview==
 
* https://www.postgresql.org/docs/14/sql-createrole.html
 
* https://www.postgresql.org/docs/14/sql-createrole.html

Latest revision as of 16:27, 20 September 2024

CREATE ROLE adds a new role to a PostgreSQL database cluster. A role can be considered a user, or group.

Overview[edit]

CREATE ROLE name [ [ WITH ] option [ ... ] ]

where option can be: 

      SUPERUSER | NOSUPERUSER
    | CREATEDB | NOCREATEDB
    | CREATEROLE | NOCREATEROLE
    | CREATEUSER | NOCREATEUSER
    | INHERIT | NOINHERIT
    | LOGIN | NOLOGIN
    | REPLICATION | NOREPLICATION
    | CONNECTION LIMIT connlimit
    | [ ENCRYPTED | UNENCRYPTED ] PASSWORD 'password'
    | VALID UNTIL 'timestamp'
    | IN ROLE role_name [, ...]
    | IN GROUP role_name [, ...]
    | ROLE role_name [, ...]
    | ADMIN role_name [, ...]
    | USER role_name [, ...]
    | SYSID uid

Examples[edit]

Related[edit]

See also[edit]

Advertising: