CREATE_USER_MAPPING(7pg16)
β¨ NAME β¨
okay bestie, this is CREATE USER MAPPING(7) from the PostgreSQL 16.15 Documentation β the page for CREATE_USER_MAPPING, which defines a new mapping of a user to a foreign server. that's literally the job, no cap. π
πΈ SYNOPSIS πΈ
CREATE USER MAPPING [ IF NOT EXISTS ] FOR { user_name | USER | CURRENT_ROLE | CURRENT_USER | PUBLIC }
SERVER server_name
[ OPTIONS ( option 'value' [ , ... ] ) ]
π DESCRIPTION π
CREATE USER MAPPING defines a mapping of a user to a foreign server. A user mapping typically encapsulates connection information that a foreign-data wrapper uses together with the information encapsulated by a foreign server to access an external data resource. π«Ά
The owner of a foreign server can create user mappings for that server for any user. Also, a user can create a user mapping for their own user name if USAGE privilege on the server has been granted to the user. slay.
β¨ PARAMETERS β¨
IF NOT EXISTSβ do not throw an error if a mapping of the given user to the given foreign server already exists. a notice is issued in this case. note that there is no guarantee that the existing user mapping is anything like the one that would have been created. πuser_nameβ the name of an existing user that is mapped to foreign server.CURRENT_ROLE,CURRENT_USER, andUSERmatch the name of the current user. whenPUBLICis specified, a so-called public mapping is created that is used when no user-specific mapping is applicable.server_nameβ the name of an existing server for which the user mapping is to be created.OPTIONS ( option 'value' [, ... ] )β this clause specifies the options of the user mapping. the options typically define the actual user name and password of the mapping. option names must be unique. the allowed option names and values are specific to the server's foreign-data wrapper.
π₯ EXAMPLES π₯
create a user mapping for user bob, server foo:
CREATE USER MAPPING FOR bob SERVER foo OPTIONS (user 'bob', password 'secret');
π¦ COMPATIBILITY π¦
CREATE USER MAPPING conforms to ISO/IEC 9075-9 (SQL/MED). periodt.
π SEE ALSO π
ALTER USER MAPPING(ALTER_USER_MAPPING(7))DROP USER MAPPING(DROP_USER_MAPPING(7))CREATE FOREIGN DATA WRAPPER(CREATE_FOREIGN_DATA_WRAPPER(7))CREATE SERVER(CREATE_SERVER(7))
signed, sealed, and sent with π by PostgreSQL 16.15, dated 2026 β this has been your CREATE USER MAPPING(7) moment. bestie out! π«Άβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms