CREATE USER MAPPING
A DDL command for defining a new mapping of a user to a foreign server
CREATE USER MAPPING
is a DDL command for defining a new mapping of a PostgreSQL database user to a foreign server.
CREATE USER MAPPING
was added in PostgreSQL 8.4.
psql commands
\deu
lists available user mappings\deu+
lists available user mappings together with the parameters provided with theOPTIONS
clause
Change history
- PostgreSQL 10
IF NOT EXISTS
clause added (commit b6fb534f)
- PostgreSQL 8.4
- added (commit cae565e5)
Examples
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)
References
- PostgreSQL documentation: CREATE USER MAPPING