DROP_USER_MAPPING(7pg15)
β¨ DROP_USER_MAPPING β¨
okay so bestie, welcome to the DROP_USER_MAPPING page from the PostgreSQL 15.19 Documentation β thatβs the manual name right there, and we are officially here to remove a user mapping for a foreign server. itβs giving βclean up the foreign-server linkageβ energy, 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 foreign server.
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. so the permission vibe check is: server owner can do it for anybody on that server; a regular user can do it for their own user name, but only when USAGE is granted π«Ά.
β¨ 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 crash if itβs already gone, just a lil notice π.user_nameβ user name of the mapping.CURRENT_ROLE,CURRENT_USER, andUSERmatch the name of the current user.PUBLICis used to match all present and future user names in the system. slay for future-proofing π.server_nameβ server name of the user mapping. this is the server youβre pointing at, bestie.
π 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. love that for us: standards-compliant with a lil PostgreSQL bonus β¨.
π SEE ALSO π
CREATE USER MAPPING(CREATE_USER_MAPPING(7))ALTER USER MAPPING(ALTER_USER_MAPPING(7))
big kiss and a sparkle send-off: this was PostgreSQL 15.19, dated 2026, and the page is DROP USER MAPPING(7). periodt π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-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