2 doc/src/sgml/ref/alter_user_mapping.sgml
3 PostgreSQL documentation
6 <refentry id=
"sql-alterusermapping">
7 <indexterm zone=
"sql-alterusermapping">
8 <primary>ALTER USER MAPPING
</primary>
12 <refentrytitle>ALTER USER MAPPING
</refentrytitle>
13 <manvolnum>7</manvolnum>
14 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
18 <refname>ALTER USER MAPPING
</refname>
19 <refpurpose>change the definition of a user mapping
</refpurpose>
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>'] [, ... ] )
31 <title>Description
</title>
34 <command>ALTER USER MAPPING
</command> changes the definition of a
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.
47 <title>Parameters
</title>
51 <term><replaceable class=
"parameter">user_name
</replaceable></term>
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.
63 <term><replaceable class=
"parameter">server_name
</replaceable></term>
66 Server name of the user mapping.
72 <term><literal>OPTIONS ( [ ADD | SET | DROP ]
<replaceable class=
"parameter">option
</replaceable> ['
<replaceable class=
"parameter">value
</replaceable>'] [, ... ] )
</literal></term>
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
89 <title>Examples
</title>
92 Change the password for user mapping
<literal>bob
</literal>, server
<literal>foo
</literal>:
94 ALTER USER MAPPING FOR bob SERVER foo OPTIONS (SET password 'public');
95 </programlisting></para>
100 <title>Compatibility
</title>
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
116 <title>See Also
</title>
118 <simplelist type=
"inline">
119 <member><xref linkend=
"sql-createusermapping"/></member>
120 <member><xref linkend=
"sql-dropusermapping"/></member>