DROP_USER_MAPPING(7pg13)
π DROP USER MAPPING π
okay bestie, so this one is a PostgreSQL 13.23 page β yeah, the docs manual, we're fancy β and it's all about yeeting a user mapping off a foreign server. let's get into it π«Ά
πΈ NAME πΈ
DROP_USER_MAPPING β removes a user mapping for a foreign server. that's it, that's the whole vibe. goodbye mapping, don't let the door hit you π
β¨ SYNOPSIS β¨
DROP USER MAPPING [ IF EXISTS ] FOR { user_name | USER | CURRENT_USER | PUBLIC } SERVER server_name
look at all those options, she's got range π₯
π¦ DESCRIPTION π¦
so like β DROP USER MAPPING removes an existing user mapping from a foreign server. iconic behavior, honestly.
now here's the permission tea β 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 that user. basically: you can clean up your own mess, or the server owner can clean up everybody's π
π PARAMETERS π
IF EXISTSβ do not throw an error if the user mapping doesn't exist. instead a notice gets issued. no dramatics, no explosion, just a lil heads up πuser_nameβ the user name of the mapping.CURRENT_USERandUSERmatch the name of the current user.PUBLICis used to match all present and future user names in the system. she's giving main character energy, matching everyone πserver_nameβ the server name of the user mapping. yep. that's the one π¦
π EXAMPLES π
drop a user mapping bob, server foo, if it exists:
DROP USER MAPPING IF EXISTS FOR bob SERVER foo;
see how chill that was? no error, no stress, just IF EXISTS doing her thing β¨
π COMPATIBILITY π
DROP USER MAPPING conforms to ISO/IEC 9075-9 (SQL/MED) β standards girlie behavior, we love to see it. but the IF EXISTS clause? that's a PostgreSQL extension. homegrown. artisanal. locally sourced π
β SEE ALSO β
CREATE USER MAPPING(CREATE_USER_MAPPING(7)) β for when you wanna make oneALTER USER MAPPING(ALTER_USER_MAPPING(7)) β for when you wanna change one
iykyk, it's the full mapping lifecycle π«
ok that's the whole page bestie, no cap, nothing skipped. every flag, every privilege, every standard reference β all present and accounted for π
PostgreSQL 13.23, dated 2025 β mwah, signed off, slay πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-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