1CREATE USER MAPPING(7) SQL Commands CREATE USER MAPPING(7)
2
3
4
6 CREATE USER MAPPING - define a new mapping of a user to a foreign
7 server
8
9
11 CREATE USER MAPPING FOR { username | USER | CURRENT_USER | PUBLIC }
12 SERVER servername
13 [ OPTIONS ( option 'value' [ , ... ] ) ]
14
15
17 CREATE USER MAPPING defines a mapping of a user to a foreign server. A
18 user mapping typically encapsulates connection information that a for‐
19 eign-data wrapper uses together with the information encapsulated by a
20 foreign server to access an external data resource.
21
22 The owner of a foreign server can create user mappings for that server
23 for any user. Also, a user can create a user mapping for his own user
24 name if USAGE privilege on the server has been granted to the user.
25
27 username
28 The name of an existing user that is mapped to foreign server.
29 CURRENT_USER and USER match the name of the current user. When
30 PUBLIC is specified, a so-called public mapping is created that
31 is used when no user-specific mapping is applicable.
32
33 servername
34 The name of an existing server for which the user mapping is to
35 be created.
36
37 OPTIONS ( option 'value' [, ... ] )
38 This clause specifies the options of the user mapping. The
39 options typically define the actual user name and password of
40 the mapping. Option names must be unique. The allowed option
41 names and values are specific to the server's foreign-data wrap‐
42 per.
43
45 Create a user mapping for user bob, server foo:
46
47 CREATE USER MAPPING FOR bob SERVER foo OPTIONS (user 'bob', password 'secret');
48
49
51 CREATE USER MAPPING conforms to ISO/IEC 9075-9 (SQL/MED).
52
54 ALTER USER MAPPING [alter_user_mapping(7)], DROP USER MAPPING
55 [drop_user_mapping(7)], CREATE FOREIGN DATA WRAPPER [create_for‐
56 eign_data_wrapper(7)], CREATE SERVER [create_server(7)]
57
58
59
60SQL - Language Statements 2011-09-22 CREATE USER MAPPING(7)