ALTER USER MAPPING <refpurpose>change the definition of a user mapping</refpurpose> — ユーザマップの定義を変更する
ALTER USER MAPPING FOR { user_name | USER | CURRENT_ROLE | CURRENT_USER | SESSION_USER | PUBLIC }
SERVER server_name
OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] )
<command>ALTER USER MAPPING</command> changes the definition of a
user mapping.
ALTER USER MAPPINGはユーザマップの定義を変更します。
The owner of a foreign server can alter user mappings for that
server for any user. Also, a user can alter a user mapping for
their own user name if <literal>USAGE</literal> privilege on the server has
been granted to the user.
外部サーバの所有者は任意のユーザに対するそのサーバ向けのユーザマップを変更することができます。
また、サーバ上でUSAGE権限がユーザに付与されていた場合、ユーザは自身の持つユーザ名に対応するユーザマップを変更することができます。
user_name
User name of the mapping. <literal>CURRENT_ROLE</literal>, <literal>CURRENT_USER</literal>,
and <literal>USER</literal> match the name of the current
user. <literal>PUBLIC</literal> is used to match all present and future
user names in the system.
対応付けするユーザ名です。
CURRENT_ROLE、CURRENT_USERとUSERは現在のユーザ名に対応します。
PUBLICは現在および将来にシステム上に存在するすべてのユーザに対応させるために使用します。
server_nameServer name of the user mapping. ユーザマップのサーバ名です。
OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] )
Change options for the user mapping. The new options override
any previously specified
options. <literal>ADD</literal>, <literal>SET</literal>, and <literal>DROP</literal>
specify the action to be performed. <literal>ADD</literal> is assumed
if no operation is explicitly specified. Option names must be
unique; options are also validated by the server's foreign-data
wrapper.
ユーザマップのオプションを変更します。
新しいオプションは過去に指定されたオプションをすべて上書きします。
ADD、SET、DROPは実行する動作を指定します。
明示的な動作指定がない場合、ADDとみなされます。
オプション名は一意でなければなりません。
またオプションはサーバの外部データラッパーにより検証されます。
Change the password for user mapping <literal>bob</literal>, server <literal>foo</literal>:
サーバfooのユーザマップbobのパスワードを変更します。
ALTER USER MAPPING FOR bob SERVER foo OPTIONS (SET password 'public');
<command>ALTER USER MAPPING</command> conforms to ISO/IEC 9075-9
(SQL/MED). There is a subtle syntax issue: The standard omits
the <literal>FOR</literal> key word. Since both <literal>CREATE
USER MAPPING</literal> and <literal>DROP USER MAPPING</literal> use
<literal>FOR</literal> in analogous positions, and IBM DB2 (being
the other major SQL/MED implementation) also requires it
for <literal>ALTER USER MAPPING</literal>, PostgreSQL diverges from
the standard here in the interest of consistency and
interoperability.
ALTER USER MAPPINGはISO/IEC 9075-9(SQL/MED)に準拠しています。
小さな構文上の問題があります。
標準ではFORキーワードを省略します。
CREATE USER MAPPINGとDROP USER MAPPINGではFORを似たような位置で使用し、またIBM DB2(他の主なSQL/MED実装になっています)ではALTER USER MAPPINGで必要としていますので、PostgreSQLは、一貫性と相互運用性を目的に、標準と違いを持たせています。