↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

SQL Commands / Roles & Privileges

CREATE GROUP

Read the PG 18 manual

define a new database role

Reading PG 18current·documented in 28 of 30 versions, 7.0 to 20

Syntax

CREATE GROUP 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' | PASSWORD NULL
| VALID UNTIL 'timestamp'
| IN ROLE role_name [, ...]
| IN GROUP role_name [, ...]
| ROLE role_name [, ...]
| ADMIN role_name [, ...]
| USER role_name [, ...]
| SYSID uid
Syntax diagrams

Read left to right. Branches are choices, bypasses are optional, loops repeat. Select an underlined parameter to open its rule.

CREATE GROUP name WITH option
option
SUPERUSER NOSUPERUSER CREATEDB NOCREATEDB CREATEROLE NOCREATEROLE INHERIT NOINHERIT LOGIN NOLOGIN REPLICATION NOREPLICATION BYPASSRLS NOBYPASSRLS CONNECTION LIMIT connlimit ENCRYPTED PASSWORD ' password ' PASSWORD NULL VALID UNTIL ' timestamp ' IN ROLE role_name , IN GROUP role_name , ROLE role_name , ADMIN role_name , USER role_name , SYSID uid

Description

CREATE GROUP is now an alias for CREATE ROLE.

Compatibility

There is no CREATE GROUP statement in the SQL standard.

See Also

CREATE ROLE
Version history 13
  1. 18 → 19 changed
  2. 10 → 11 changed
  3. 9.6 → 10 changed
  4. 9.5 → 9.6 changed
  5. 9.4 → 9.5 changed
  6. 8.4 → 9.0 changed
  7. 8.1 → 8.2 changed
  8. 8.0 → 8.1 changed
  9. 7.4 → 8.0 changed
  10. 7.3 → 7.4 changed
  11. 7.1 → 7.2 changed
  12. 7.0 → 7.1 changed
  13. 6.5 → 7.0 added

Related entries

Definition snapshot: b7bd9cda · English manual source