DROP USER MAPPING 是一个 DDL 命令,用于删除 PostgreSQL 数据库用户到远程服务器的映射。
DROP USER MAPPING 命令添加于 PostgreSQL 8.4。
更改历史
- PostgreSQL 15
- 添加了
DROP USER MAPPING FOR CURRENT_ROLE语法(提交 45b98057)
- 添加了
- PostgreSQL 8.4
- 添加 (提交 cae565e5)
示例
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
尝试删除不存在的用户映射
postgres=# DROP USER MAPPING FOR postgres SERVER pg_fdw; ERROR: user mapping for "postgres" does not exist for server "pg_fdw"
参考资料
- PostgreSQL 文档: DROP USER MAPPING
