DROP_USER_MAPPING(7pg16)

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

DROP USER MAPPING πŸ’…βœ¨

okay so bestie, this is DROP USER MAPPING β€” from the PostgreSQL 16.15 documentation, section 7 β€” and it’s literally the page about removing a user mapping for a foreign server. 🫢 No cap.

✨ NAME ✨

DROP_USER_MAPPING β€” remove a user mapping for a foreign server πŸ’–

🌸 SYNOPSIS 🌸

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

πŸ¦‹ DESCRIPTION πŸ¦‹

DROP USER MAPPING removes an existing user mapping from a foreign server. 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. slay. ✨

πŸŽ€ PARAMETERS πŸŽ€

  • IF EXISTS β€” don’t throw an error if the user mapping doesn’t exist. In this case a notice is issued. πŸ’–
  • user_name β€” the 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 β€” the server name of the user mapping. πŸ¦‹

⭐ EXAMPLES ⭐

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

DROP USER MAPPING IF EXISTS FOR bob SERVER foo;

🌈 COMPATIBILITY 🌈

DROP USER MAPPING conforms to ISO/IEC 9075-9 (SQL/MED). The IF EXISTS clause is a PostgreSQL extension. iykyk ✨

πŸ’œ SEE ALSO πŸ’œ


xoxo bestie, this was PostgreSQL 16.15, dated 2026 β€” mwah πŸ’…πŸŽ€

πŸ“¦ where this page comes from