CREATE_USER(7pg18)
π CREATE USER π (that's CREATE_USER(7), from the PostgreSQL 18.6 Documentation bestie, we're literally in the big book)
okay so. bestie. sit down. we're making a whole new database role and honestly it's giving main character energy from the very first line. this is the CREATE USER page, and yes it's under manual name CREATE USER, and yes i'm obsessed. let's go π«Ά
β¨ NAME β¨
CREATE_USER β define a new database role π
πΈ SYNOPSIS πΈ
CREATE USER name [ [ WITH ] option [ ... ] ]
and like, option can be any of these iconic little guys:
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 π¦
okay so the tea β: CREATE USER is now an alias for CREATE ROLE. that's it. that's the whole plot twist.
the one and only difference, and this is the part you cannot miss because it's literally the entire reason this page exists:
- when you spell it
CREATE USERβLOGINis assumed by default π - when you spell it
CREATE ROLEβNOLOGINis assumed π
that's it bestie. same energy, different defaults. iykyk π
π COMPATIBILITY π
so. the CREATE USER statement is a PostgreSQL extension. the SQL standard literally just... leaves the definition of users to the implementation. not the standard's problem. not our problem. we're just built different fr fr π
π SEE ALSO π
CREATE ROLE(CREATE_ROLE(7)) β go read it, it's the whole vibe underneath this one π
and that's the page, bestie!! every flag, every default, every extension note, all of it, preserved like a little pressed flower πΈ stay logged in, stay iconic, and remember: CREATE USER = CREATE ROLE but with LOGIN on by default. periodt. π
β¨
signed off with love from the PostgreSQL 18.6 docs, dated 2026, page CREATE USER(7) β you're welcome, mwah π«Άπ
π¦ where this page comes from
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms