CREATE_USER(7pg13)

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

πŸ’– 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