CREATE USER MAPPING

Defines a new mapping from users to external servers.

Summary

CREATE USER MAPPING FOR { username | USER | CURRENT_USER | PUBLIC }
    SERVER servername
    [ OPTIONS ( option 'value' [, ... ] ) ]

describe

CREATE USER MAPPING Defines the user's mapping to an external server. You must be the owner of the server to define user mappings for it.

Parameters

username

  • The name of the existing user mapped to the external server. CURRENT_USER and USER match the name of the current user. PUBLIC is used to match all current and future user names in the system.

servername

  • The name of the existing server for which the user map will be created.

OPTIONS ( option 'value' [, ... ] )

  • Options for new user mapping. These options usually define the actual username and password for the map. The option name must be unique. The option name and value are specific to the server-specific external data wrapper.

Example

Create user maps between user bob and server foo:

CREATE USER MAPPING FOR bob SERVER foo OPTIONS (user 'bob', password 'secret');

compatibility

CREATE USER MAPPING complies with ISO/IEC 9075-9 (SQL/MED).

See also

ALTER USER MAPPING,DROP USER MAPPING