DROP_USER_MAPPING(7pg17)
π 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, andUSERall match the name of the current user.PUBLICis 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 π¦
CREATE USER MAPPING(CREATE_USER_MAPPING(7))ALTER USER MAPPING(ALTER_USER_MAPPING(7))
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
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms