Contents
DROP USER MAPPING
An SQL command for removing the mapping of a user to a foreign server
DROP USER MAPPING
is a DDL command for removing the mapping of a PostgreSQL database user to a foreign server.
DROP USER MAPPING
was added in PostgreSQL 8.4.
Change history
- PostgreSQL 15
DROP USER MAPPING FOR CURRENT_ROLE
syntax added (commit 45b98057)
- PostgreSQL 8.4
- added (commit cae565e5)
Examples
Basic usage example for DROP USER MAPPING
:
postgres=# CREATE USER MAPPING FOR CURRENT_USER SERVER fdw_test OPTIONS (user 'foo', password 'bar'); CREATE USER MAPPING postgres=# DROP USER MAPPING FOR postgres SERVER fdw_test; DROP USER MAPPING
Attempting to drop a mapping for a non-existent user mapping:
postgres=# DROP USER MAPPING FOR postgres SERVER pg_fdw; ERROR: user mapping for "postgres" does not exist for server "pg_fdw"
References
- PostgreSQL documentation: DROP USER MAPPING