Difference between revisions of "PostgreSQL: CREATE ROLE"

From wikieduonline
Jump to navigation Jump to search
m (Welcome moved page CREATE ROLE to Create role)
Line 36: Line 36:
  
 
==See also==
 
==See also==
{{PostgreSQL}}
+
* {{PostgreSQL}}
  
 
[[Category:PosgreSQL]]
 
[[Category:PosgreSQL]]

Revision as of 14:07, 9 August 2021


Overview

[1]

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

  • CREATE ROLE myname WITH LOGIN PASSWORD 'jw8s130F4' VALID UNTIL '2022-01-01';
  • CREATE ROLE admin WITH CREATEDB CREATEROLE;


Related commands

See also

  • https://www.postgresql.org/docs/9.2/sql-createrole.html
  • Advertising: