Defines a new mapping of a user to a foreign server.
CREATE USER MAPPING FOR { <username> | USER | CURRENT_USER | PUBLIC }
SERVER <servername>
[ OPTIONS ( <option> '<value>' [, ... ] ) ]
CREATE USER MAPPING
defines a mapping of a user to a foreign server. You must be the owner of the server to define user mappings for it.
CURRENT_USER
and
USER
match the name of the current user.
PUBLIC
is used to match all present and future user names in the system.
Create a user mapping for user bob
, server foo
:
CREATE USER MAPPING FOR bob SERVER foo OPTIONS (user 'bob', password 'secret');
CREATE USER MAPPING
conforms to ISO/IEC 9075-9 (SQL/MED).
ALTER USER MAPPING, DROP USER MAPPING, DROP USER MAPPING, CREATE FOREIGN DATA WRAPPER, CREATE SERVER
Parent topic: SQL Commands