DROP_USER_MAPPING(7pg14)

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

πŸ’– NAME πŸ’–

DROP_USER_MAPPING β€” remove a user mapping for a foreign server. Yup bestie, you're on the DROP USER MAPPING(7pg14) page, and we're about to delete a mapping with main-character confidence ✨.

✨ SYNOPSIS ✨

DROP USER MAPPING [ IF EXISTS ] FOR { user_name | USER | CURRENT_ROLE | CURRENT_USER | PUBLIC } SERVER server_name

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so DROP USER MAPPING removes an existing user mapping from a foreign server. That's the whole vibe: mapping gone, periodt πŸ’….

The owner of a foreign server can drop user mappings for that server for any user. Also, a user can drop a user mapping for their own user name if USAGE privilege on the server has been granted to the user. Permission check: iconic, but real 🫢.

πŸŽ€ PARAMETERS πŸŽ€

  • IF EXISTS β€” do not throw an error if the user mapping does not exist. A notice is issued in this case. So it's lowkey the β€œno drama” flag πŸ’–.
  • 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. Present and future, bestie β€” that's a big mood 🌈.
  • server_name β€” server name of the user mapping. Gotta name the server, obviously 🫢.

🌸 EXAMPLES 🌸

Drop a user mapping bob, server foo if it exists:

DROP USER MAPPING IF EXISTS FOR bob SERVER foo;

That's literally the example. Slay ✨.

🌈 COMPATIBILITY 🌈

DROP USER MAPPING conforms to ISO/IEC 9075-9 (SQL/MED). The IF EXISTS clause is a PostgreSQL extension. So yes, standards girlie with a lil PostgreSQL extra πŸ’–.

πŸ’œ SEE ALSO πŸ’œ


mwah πŸ’– signing off from the PostgreSQL 14.24 Documentation, dated 2026 β€” DROP USER MAPPING(7) out! πŸŽ€βœ¨

πŸ“¦ where this page comes from