CREATE_USER(7pg16)
okay bestie, welcome to the CREATE USER(7) page from the PostgreSQL 16.15 Documentation. This one is short and iconic: itβs all about creating a database role, and yes, the command is literally spelled CREATE USER. π«Ά
πΈ NAME πΈ
CREATE_USERβ define a new database role π periodt.
β¨ SYNOPSIS β¨
Hereβs the exact spell, no cap β copy it character for character:
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' | 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 π¦
So hereβs the tea, bestie: CREATE USER is now an alias for CREATE ROLE. Thatβs the whole plot twist. β¨
The only difference is this: when the command is spelled CREATE USER, LOGIN is assumed by default, whereas NOLOGIN is assumed when the command is spelled CREATE ROLE. Thatβs it β main character energy, tiny difference. π
π COMPATIBILITY π
The CREATE USER statement is a PostgreSQL extension. The SQL standard leaves the definition of users to the implementation. So yeah, this is a PostgreSQL thing, not a βstandard SQL did it firstβ situation. π
π SEE ALSO π
CREATE ROLE (CREATE_ROLE(7))β go read that one too, bestie, itβs literally the sibling page π
mwah π β source/version: PostgreSQL 16.15; date: 2026; manual page: CREATE USER(7).
π¦ where this page comes from
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms