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 the OPTIONS clause

Change history

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)

Categories

DDL, Foreign Data Wrapper (FDW), User management

See also

ALTER USER MAPPING, DROP USER MAPPING, pg_user_mapping, pg_user_mappings