4 CREATE USER MAPPING — define a new mapping of a user to a foreign
9 CREATE USER MAPPING [ IF NOT EXISTS ] FOR { user_name | USER | CURRENT_ROLE | CU
12 [ OPTIONS ( option 'value' [ , ... ] ) ]
16 CREATE USER MAPPING defines a mapping of a user to a foreign server. A
17 user mapping typically encapsulates connection information that a
18 foreign-data wrapper uses together with the information encapsulated by
19 a foreign server to access an external data resource.
21 The owner of a foreign server can create user mappings for that server
22 for any user. Also, a user can create a user mapping for their own user
23 name if USAGE privilege on the server has been granted to the user.
28 Do not throw an error if a mapping of the given user to the
29 given foreign server already exists. A notice is issued in this
30 case. Note that there is no guarantee that the existing user
31 mapping is anything like the one that would have been created.
34 The name of an existing user that is mapped to foreign server.
35 CURRENT_ROLE, CURRENT_USER, and USER match the name of the
36 current user. When PUBLIC is specified, a so-called public
37 mapping is created that is used when no user-specific mapping is
41 The name of an existing server for which the user mapping is to
44 OPTIONS ( option 'value' [, ... ] )
45 This clause specifies the options of the user mapping. The
46 options typically define the actual user name and password of
47 the mapping. Option names must be unique. The allowed option
48 names and values are specific to the server's foreign-data
53 Create a user mapping for user bob, server foo:
54 CREATE USER MAPPING FOR bob SERVER foo OPTIONS (user 'bob', password 'secret');
58 CREATE USER MAPPING conforms to ISO/IEC 9075-9 (SQL/MED).
62 ALTER USER MAPPING, DROP USER MAPPING, CREATE FOREIGN DATA WRAPPER,