ALTER_USER(7pg15)

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

✨ ALTER USER ✨ (that's the ALTER_USER page from the PostgreSQL 15.19 docs, bestie πŸ’…)

okay so real talk β€” this one's short and sweet, and the tea is that ALTER USER is literally just ALTER ROLE wearing a different outfit. no cap. but let's get into it anyway 🫢


πŸŽ€ NAME πŸŽ€

ALTER_USER β€” change a database role

like, it changes a role. that's the whole vibe. 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

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

look at all those options, it's giving menu at a really good restaurant 😭 every single one is there, don't worry, i would never gatekeep πŸ’–


πŸ”₯ DESCRIPTION πŸ”₯

okay so the whole entire point: ALTER USER is now an alias for ALTER ROLE. that's it. that's the sentence. slay, iconic, minimal, periodt πŸ‘‘

(if you actually wanna know what all those options do, the ALTER ROLE page is your bestie β€” see SEE ALSO below, i gotchu 🫢)


🌈 COMPATIBILITY 🌈

so this is the part where we find out it's ✨special✨:

  • the ALTER USER statement is a PostgreSQL extension β€” it's not a standard thing, it's our thing πŸ’…
  • the SQL standard leaves the definition of users to the implementation, which is honestly such a "figure it out yourself" move of them πŸ™ˆ

so yeah, don't expect other databases to know what you're talking about. main character PostgreSQL energy only. πŸ¦‹


🌟 SEE ALSO 🌟

  • ALTER ROLE (ALTER_ROLE(7)) β€” the actual one, the blueprint, the original πŸ‘‘

ok bestie here's your gentle reminder: this page is genuinely just a redirect in disguise. if you were hoping for a deep lore drop, the ALTER_ROLE(7) page is where the real content lives. no crumbs here, only vibes πŸ’€

and that's the whole page!! πŸ’–βœ¨πŸŽ€ this lil beauty came straight out of the PostgreSQL 15.19 documentation, dated 2026, and it's filed under ALTER USER(7) β€” mwah, go forth and alter some users, you got this πŸ§šβ€β™€οΈπŸ“

πŸ“¦ where this page comes from