CREATE USER MAPPING

用于定义用户与外部服务器之间新映射的 SQL 命令

CREATE USER MAPPING 是一个 DDL 命令,用于定义 PostgreSQL 数据库用户与外部服务器之间的新映射。

CREATE USER MAPPINGPostgreSQL 8.4 中添加。

psql 命令

  • \deu 列出可用的用户映射
  • \deu+ 列出可用的用户映射以及在 OPTIONS 子句中提供的参数

变更历史

示例

CREATE USER MAPPING 的用法示例

postgres=# CREATE USER MAPPING
                FOR CURRENT_USER
             SERVER fdw_test
            OPTIONS (user 'foo', password 'bar');
CREATE USER MAPPING

postgres=# \deu
List of user mappings
  Server  | User name 
----------+-----------
 fdw_test | postgres
(1 row)

postgres=# \deu+
                 List of user mappings
  Server  | User name |          FDW options           
----------+-----------+--------------------------------
 fdw_test | postgres  | ("user" 'foo', password 'bar')
(1 row)

分类

DDL, 外部数据包装器 (FDW), SQL 命令, 用户和角色

另请参阅

ALTER USER MAPPING, DROP USER MAPPING, pg_user_mapping, pg_user_mappings

反馈

提交关于“CREATE USER MAPPING”的任何评论、建议或更正 在此处