ALTER_USER_MAPPING(7pg17)

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

okay bestie, welcome to the ALTER_USER_MAPPING(7pg17) page β€” that's ALTER USER MAPPING(7) from the PostgreSQL 17.11 Documentation πŸ’…βœ¨ this is where you change a user mapping's definition and give it a little main-character refresh. no cap.

🌸 NAME 🌸

ALTER_USER_MAPPING β€” change the definition of a user mapping. that's the whole assignment, and she ate. πŸ’–

πŸŽ€ SYNOPSIS πŸŽ€

here's the exact syntax, bestie β€” code stays code, always:

ALTER USER MAPPING FOR { user_name | USER | CURRENT_ROLE | CURRENT_USER | SESSION_USER | PUBLIC }
    SERVER server_name
    OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] )

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so ALTER USER MAPPING changes the definition of a user mapping. like a glow-up, but for mappings. πŸ”₯

The owner of a foreign server can alter user mappings for that server for any user. Also, a user can alter a user mapping for their own user name if USAGE privilege on the server has been granted to the user. permission check, slay. πŸ‘‘

✨ PARAMETERS ✨

  • user_name β€” user name of the mapping. CURRENT_ROLE, CURRENT_USER, and USER match the name of the current user. PUBLIC is used to match all present and future user names in the system. πŸ‘‘
  • server_name β€” server name of the user mapping. simple as that, bestie.
  • OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] ) β€” change options for the user mapping. The new options override any previously specified options. ADD, SET, and DROP specify the action to be performed. ADD is assumed if no operation is explicitly specified. Option names must be unique; options are also validated by the server's foreign-data wrapper. 🫢

πŸ’– EXAMPLES πŸ’–

change the password for user mapping bob, server foo:

ALTER USER MAPPING FOR bob SERVER foo OPTIONS (SET password 'public');

🌈 COMPATIBILITY 🌈

ALTER USER MAPPING conforms to ISO/IEC 9075-9 (SQL/MED). there is a subtle syntax issue: the standard omits the FOR key word. since both CREATE USER MAPPING and DROP USER MAPPING use FOR in analogous positions, and IBM DB2 (being the other major SQL/MED implementation) also requires it for ALTER USER MAPPING, PostgreSQL diverges from the standard here in the interest of consistency and interoperability. plot twist, but make it standards-adjacent. periodt. πŸ’€

🫢 SEE ALSO 🫢


that's the page, bestie 🫢 this is ALTER USER MAPPING(7) from PostgreSQL 17.11, dated 2026 β€” go forth and alter those mappings responsibly πŸ’œβœ¨

πŸ“¦ where this page comes from