CREATE_USER(7pg18)

πŸ“¦ version 18.6, in opensuse-leap 16.0

πŸ’– 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 β€” LOGIN is assumed by default 🌈
  • when you spell it CREATE ROLE β€” NOLOGIN is 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