ALTER_USER(7pg16)

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

πŸ’– NAME πŸ’–

Okay bestie, welcome to ALTER USER(7pg16) from the PostgreSQL 16.15 documentation. This page is about one iconic job: change a database role. The manpage file name is ALTER_USER, and the whole vibe is β€œwe’re changing a role, and we’re doing it with confidence.” πŸ’…

✨ SYNOPSIS ✨

Here’s the whole spellbook, exactly as written, no cap:

ALTER USER role_specification [ 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'

ALTER USER name RENAME TO new_name

ALTER USER { role_specification | ALL } [ IN DATABASE database_name ] SET configuration_parameter { TO | = } { value | DEFAULT }
ALTER USER { role_specification | ALL } [ IN DATABASE database_name ] SET configuration_parameter FROM CURRENT
ALTER USER { role_specification | ALL } [ IN DATABASE database_name ] RESET configuration_parameter
ALTER USER { role_specification | ALL } [ IN DATABASE database_name ] RESET ALL

where role_specification can be:

    role_name
  | CURRENT_ROLE
  | CURRENT_USER
  | SESSION_USER

Lowkey iconic. Every one of those options is listed above β€” nothing dropped, nothing merged, nothing β€œfixed.” 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

So here’s the tea, bestie: ALTER USER is now an alias for ALTER ROLE. That’s it. That’s the whole description. It’s giving β€œsame main character, different name tag.” ✨

🌈 COMPATIBILITY 🌈

The ALTER USER statement is a PostgreSQL extension. The SQL standard leaves the definition of users to the implementation. So yeah β€” standard said β€œyou handle it,” and PostgreSQL handled it. Periodt. πŸ’€

πŸŽ€ SEE ALSO πŸŽ€

Go check out:

That’s the reference, exactly as given. Iykyk. πŸ¦‹


πŸ’– This page came from PostgreSQL 16.15, dated 2026. That’s the source/version and date sign-off, bestie β€” now go forth and alter those users like the icon you are. πŸ‘‘πŸŒΈ

πŸ“¦ where this page comes from