CREATE_USER(7pg16)

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

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