ALTER_USER(7pg16)
π 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:
ALTER ROLE (ALTER_ROLE(7))
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
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms