CREATE_USER(7pg13)
π NAME π
CREATE_USER β define a new database role. That's it, that's the whole mood. π«Ά This page is CREATE USER(7), from the PostgreSQL 13.23 Documentation, and it's about to be your new fave.
β¨ SYNOPSIS β¨
okay bestie, the grammar is literally this, no edits:
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
Every option from SUPERUSER | NOSUPERUSER down to SYSID uid is in that list β the whole runway, the full menu, all of it. π
πΈ DESCRIPTION πΈ
So CREATE USER is now an alias for CREATE ROLE (CREATE_ROLE(7)). Genuinely, that's the tea. β
The only difference is this cute little default flip: 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 the whole plot twist. β¨
π COMPATIBILITY π
The CREATE USER statement is a PostgreSQL extension. The SQL standard leaves the definition of users to the implementation. So yeah β this one is a PostgreSQL thing, not a SQL-standard thing. No cap. π«Ά
π¦ SEE ALSO π¦
CREATE ROLE (CREATE_ROLE(7))β go read that one too, bestie, it's the sibling page and it's iconic.
That's the entire manual page, mwah! π Signed with sparkle by the PostgreSQL 13.23 docs, 2025. π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-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