Add manvolnum, so that man pages are generated.
[PostgreSQL.git] / doc / src / sgml / ref / alter_user_mapping.sgml
blob56bbb55794306d51007ea46ae5231d451d4e0d3e
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-ALTERUSERMAPPING">
7 <refmeta>
8 <refentrytitle id="sql-alterusermapping-title">ALTER USER MAPPING</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>ALTER USER MAPPING</refname>
15 <refpurpose>change the definition of a user mapping</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-alterusermapping">
19 <primary>ALTER USER MAPPING</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
24 ALTER USER MAPPING FOR { <replaceable class="parameter">username</replaceable> | USER | CURRENT_USER | PUBLIC }
25 SERVER <replaceable class="parameter">servername</replaceable>
26 OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ] )
27 </synopsis>
28 </refsynopsisdiv>
30 <refsect1>
31 <title>Description</title>
33 <para>
34 <command>ALTER USER MAPPING</command> changes the definition of a
35 user mapping.
36 </para>
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 his own user name if <literal>USAGE</> privilege on the server has
42 been granted to the user.
43 </para>
44 </refsect1>
46 <refsect1>
47 <title>Parameters</title>
49 <variablelist>
50 <varlistentry>
51 <term><replaceable class="parameter">username</replaceable></term>
52 <listitem>
53 <para>
54 User name of the mapping. <literal>CURRENT_USER</>
55 and <literal>USER</> match the name of the current
56 user. <literal>PUBLIC</> is used to match all present and future
57 user names in the system.
58 </para>
59 </listitem>
60 </varlistentry>
62 <varlistentry>
63 <term><replaceable class="parameter">servername</replaceable></term>
64 <listitem>
65 <para>
66 Server name of the user mapping.
67 </para>
68 </listitem>
69 </varlistentry>
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>SET</>, and <literal>DROP</>
78 specify the action to be performed. <literal>ADD</> 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>
88 <refsect1>
89 <title>Examples</title>
91 <para>
92 Change the password for user mapping <literal>bob</>, server<literal> foo</>:
93 <programlisting>
94 ALTER USER MAPPING FOR bob SERVER foo OPTIONS (user 'bob', password 'public');
95 </programlisting>
96 </para>
98 </refsect1>
100 <refsect1>
101 <title>Compatibility</title>
103 <para>
104 <command>ALTER USER MAPPING</command> conforms to ISO/IEC 9075-9
105 (SQL/MED). There is a subtle syntax issue: The standard omits
106 the <literal>FOR</literal> key word. Since both <literal>CREATE
107 USER MAPPING</literal> and <literal>DROP USER MAPPING</literal> use
108 <literal>FOR</literal> in analogous positions, and IBM DB2 (being
109 the other major SQL/MED implementation) also requires it
110 for <literal>ALTER USER MAPPING</literal>, PostgreSQL diverges from
111 the standard here in the interest of consistency and
112 interoperability.
113 </para>
114 </refsect1>
116 <refsect1>
117 <title>See Also</title>
119 <simplelist type="inline">
120 <member><xref linkend="sql-createusermapping" endterm="sql-createusermapping-title"></member>
121 <member><xref linkend="sql-dropusermapping" endterm="sql-dropusermapping-title"></member>
122 </simplelist>
123 </refsect1>
125 </refentry>