Defines a new database role with the LOGIN privilege by default.

Synopsis

  1. CREATE USER <name> [[WITH] <option> [ ... ]]

where option can be:

  1. SUPERUSER | NOSUPERUSER
  2. | CREATEDB | NOCREATEDB
  3. | CREATEROLE | NOCREATEROLE
  4. | CREATEUSER | NOCREATEUSER
  5. | CREATEEXTTABLE | NOCREATEEXTTABLE
  6. [ ( <attribute>='<value>'[, ...] ) ]
  7. where <attributes> and <value> are:
  8. type='readable'|'writable'
  9. protocol='gpfdist'|'http'
  10. | INHERIT | NOINHERIT
  11. | LOGIN | NOLOGIN
  12. | REPLICATION | NOREPLICATION
  13. | CONNECTION LIMIT <connlimit>
  14. | [ ENCRYPTED | UNENCRYPTED ] PASSWORD '<password>'
  15. | VALID UNTIL '<timestamp>'
  16. | IN ROLE <role_name> [, ...]
  17. | IN GROUP <role_name>
  18. | ROLE <role_name> [, ...]
  19. | ADMIN <role_name> [, ...]
  20. | USER <role_name> [, ...]
  21. | SYSID <uid>
  22. | RESOURCE QUEUE <queue_name>
  23. | RESOURCE GROUP <group_name>
  24. | [ DENY <deny_point> ]
  25. | [ DENY BETWEEN <deny_point> AND <deny_point>]

Description

CREATE USER is an alias for CREATE ROLE.

The only difference between CREATE ROLE and CREATE USER is that LOGIN is assumed by default with CREATE USER, whereas NOLOGIN is assumed by default with CREATE ROLE.

Compatibility

There is no CREATE USER statement in the SQL standard.

See Also

CREATE ROLE

Parent topic: SQL Commands