DROP_USER_MAPPING(7pg14)
π NAME π
DROP_USER_MAPPING β remove a user mapping for a foreign server. Yup bestie, you're on the DROP USER MAPPING(7pg14) page, and we're about to delete a mapping with main-character confidence β¨.
β¨ SYNOPSIS β¨
DROP USER MAPPING [ IF EXISTS ] FOR { user_name | USER | CURRENT_ROLE | CURRENT_USER | PUBLIC } SERVER server_name
π¦ DESCRIPTION π¦
Okay so DROP USER MAPPING removes an existing user mapping from a foreign server. That's the whole vibe: mapping gone, 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. Permission check: iconic, but real π«Ά.
π PARAMETERS π
IF EXISTSβ do not throw an error if the user mapping does not exist. A notice is issued in this case. So it's lowkey the βno dramaβ flag π.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. Present and future, bestie β that's a big mood π.server_nameβ server name of the user mapping. Gotta name the server, obviously π«Ά.
πΈ EXAMPLES πΈ
Drop a user mapping bob, server foo if it exists:
DROP USER MAPPING IF EXISTS FOR bob SERVER foo;
That's literally the example. Slay β¨.
π COMPATIBILITY π
DROP USER MAPPING conforms to ISO/IEC 9075-9 (SQL/MED). The IF EXISTS clause is a PostgreSQL extension. So yes, standards girlie with a lil PostgreSQL extra π.
π SEE ALSO π
CREATE USER MAPPING (CREATE_USER_MAPPING(7))ALTER USER MAPPING (ALTER_USER_MAPPING(7))
mwah π signing off from the PostgreSQL 14.24 Documentation, dated 2026 β DROP USER MAPPING(7) out! πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-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