| 1 |
<!-- |
| 2 |
doc/src/sgml/ref/alter_user_mapping.sgml |
| 3 |
PostgreSQL documentation |
| 4 |
--> |
| 5 |
|
| 6 |
<refentry id="sql-alterusermapping"> |
| 7 |
<indexterm zone="sql-alterusermapping"> |
| 8 |
<primary>ALTER USER MAPPING</primary> |
| 9 |
</indexterm> |
| 10 |
|
| 11 |
<refmeta> |
| 12 |
<refentrytitle>ALTER USER MAPPING</refentrytitle> |
| 13 |
<manvolnum>7</manvolnum> |
| 14 |
<refmiscinfo>SQL - Language Statements</refmiscinfo> |
| 15 |
</refmeta> |
| 16 |
|
| 17 |
<refnamediv> |
| 18 |
<refname>ALTER USER MAPPING</refname> |
| 19 |
<refpurpose>change the definition of a user mapping</refpurpose> |
| 20 |
</refnamediv> |
| 21 |
|
| 22 |
<refsynopsisdiv> |
| 23 |
<synopsis> |
| 24 |
ALTER USER MAPPING FOR { <replaceable class="parameter">user_name</replaceable> | USER | CURRENT_ROLE | CURRENT_USER | SESSION_USER | PUBLIC } |
| 25 |
SERVER <replaceable class="parameter">server_name</replaceable> |
| 26 |
OPTIONS ( [ ADD | SET | DROP ] <replaceable class="parameter">option</replaceable> ['<replaceable class="parameter">value</replaceable>'] [, ... ] ) |
| 27 |
</synopsis> |
| 28 |
</refsynopsisdiv> |
| 29 |
|
| 30 |
<refsect1> |
| 31 |
<title>Description</title> |
| 32 |
|
| 33 |
<para> |
| 34 |
<command>ALTER USER MAPPING</command> changes the definition of a |
| 35 |
user mapping. |
| 36 |
</para> |
| 37 |
|
| 38 |
<para> |
| 39 |
The owner of a foreign server can alter user mappings for that |
| 40 |
server for any user. Also, a user can alter a user mapping for |
| 41 |
their own user name if <literal>USAGE</literal> privilege on the server has |
| 42 |
been granted to the user. |
| 43 |
</para> |
| 44 |
</refsect1> |
| 45 |
|
| 46 |
<refsect1> |
| 47 |
<title>Parameters</title> |
| 48 |
|
| 49 |
<variablelist> |
| 50 |
<varlistentry> |
| 51 |
<term><replaceable class="parameter">user_name</replaceable></term> |
| 52 |
<listitem> |
| 53 |
<para> |
| 54 |
User name of the mapping. <literal>CURRENT_ROLE</literal>, <literal>CURRENT_USER</literal>, |
| 55 |
and <literal>USER</literal> match the name of the current |
| 56 |
user. <literal>PUBLIC</literal> is used to match all present and future |
| 57 |
user names in the system. |
| 58 |
</para> |
| 59 |
</listitem> |
| 60 |
</varlistentry> |
| 61 |
|
| 62 |
<varlistentry> |
| 63 |
<term><replaceable class="parameter">server_name</replaceable></term> |
| 64 |
<listitem> |
| 65 |
<para> |
| 66 |
Server name of the user mapping. |
| 67 |
</para> |
| 68 |
</listitem> |
| 69 |
</varlistentry> |
| 70 |
|
| 71 |
<varlistentry> |
| 72 |
<term><literal>OPTIONS ( [ ADD | SET | DROP ] <replaceable class="parameter">option</replaceable> ['<replaceable class="parameter">value</replaceable>'] [, ... ] )</literal></term> |
| 73 |
<listitem> |
| 74 |
<para> |
| 75 |
Change options for the user mapping. The new options override |
| 76 |
any previously specified |
| 77 |
options. <literal>ADD</literal>, <literal>SET</literal>, and <literal>DROP</literal> |
| 78 |
specify the action to be performed. <literal>ADD</literal> is assumed |
| 79 |
if no operation is explicitly specified. Option names must be |
| 80 |
unique; options are also validated by the server's foreign-data |
| 81 |
wrapper. |
| 82 |
</para> |
| 83 |
</listitem> |
| 84 |
</varlistentry> |
| 85 |
</variablelist> |
| 86 |
</refsect1> |
| 87 |
|
| 88 |
<refsect1> |
| 89 |
<title>Examples</title> |
| 90 |
|
| 91 |
<para> |
| 92 |
Change the password for user mapping <literal>bob</literal>, server <literal>foo</literal>: |
| 93 |
<programlisting> |
| 94 |
ALTER USER MAPPING FOR bob SERVER foo OPTIONS (SET password 'public'); |
| 95 |
</programlisting></para> |
| 96 |
|
| 97 |
</refsect1> |
| 98 |
|
| 99 |
<refsect1> |
| 100 |
<title>Compatibility</title> |
| 101 |
|
| 102 |
<para> |
| 103 |
<command>ALTER USER MAPPING</command> conforms to ISO/IEC 9075-9 |
| 104 |
(SQL/MED). There is a subtle syntax issue: The standard omits |
| 105 |
the <literal>FOR</literal> key word. Since both <literal>CREATE |
| 106 |
USER MAPPING</literal> and <literal>DROP USER MAPPING</literal> use |
| 107 |
<literal>FOR</literal> in analogous positions, and IBM DB2 (being |
| 108 |
the other major SQL/MED implementation) also requires it |
| 109 |
for <literal>ALTER USER MAPPING</literal>, PostgreSQL diverges from |
| 110 |
the standard here in the interest of consistency and |
| 111 |
interoperability. |
| 112 |
</para> |
| 113 |
</refsect1> |
| 114 |
|
| 115 |
<refsect1> |
| 116 |
<title>See Also</title> |
| 117 |
|
| 118 |
<simplelist type="inline"> |
| 119 |
<member><xref linkend="sql-createusermapping"/></member> |
| 120 |
<member><xref linkend="sql-dropusermapping"/></member> |
| 121 |
</simplelist> |
| 122 |
</refsect1> |
| 123 |
|
| 124 |
</refentry> |