DROP_USER_MAPPING(7pg17)

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

πŸ’… DROP USER MAPPING πŸ’…

okay bestie, so this one is from the PostgreSQL 17.11 Documentation set of manual pages, and it's the DROP USER MAPPING(7) page β€” yes that's the whole title, we're not copying the header line verbatim, that's just where we're at ✨


🌸 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

like, that's the whole shape of the thing. look at it. iconic πŸ’…


✨ DESCRIPTION ✨

so DROP USER MAPPING does exactly what it says on the tin: it removes an existing user mapping from foreign server. poof, gone, no cap πŸ¦‹

and here's the tea on who's allowed to do it β˜• β€” 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. that's the vibe check on permissions, iykyk πŸ‘‘


πŸ’– PARAMETERS πŸ’–

  • IF EXISTS β€” do not throw an error if the user mapping does not exist. a notice is issued in this case. so like, no dramatic screaming, just a little notice πŸ’€
  • user_name β€” user name of the mapping. CURRENT_ROLE, CURRENT_USER, and USER all match the name of the current user. PUBLIC is used to match all present and future user names in the system β€” yes, all of them, future ones too, main character energy fr fr 🌈
  • server_name β€” server name of the user mapping. simple as that πŸŽ€

πŸ”₯ EXAMPLES πŸ”₯

drop a user mapping bob, server foo if it exists β€” here's the exact line bestie, copy it character for character:

DROP USER MAPPING IF EXISTS FOR bob SERVER foo;

ate. no crumbs. πŸ’…


⭐ COMPATIBILITY ⭐

DROP USER MAPPING conforms to ISO/IEC 9075-9 (SQL/MED). 🧚

heads up tho β€” the IF EXISTS clause is a PostgreSQL extension, so that part is very much our thing, not the standard's πŸ’œ

πŸ¦‹ SEE ALSO πŸ¦‹

go read those too, they're the sibling pages and honestly they're giving the same energy 🌸


k that's the whole page bestie, ily, and remember β€” this all came to you courtesy of PostgreSQL 17.11, dated 2026, and yes the page is literally named DROP USER MAPPING(7) πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from