3 PostgreSQL documentation
6 <refentry id=
"SQL-ALTERUSERMAPPING">
8 <refentrytitle id=
"sql-alterusermapping-title">ALTER USER MAPPING
</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
14 <refname>ALTER USER MAPPING
</refname>
15 <refpurpose>change the definition of a user mapping
</refpurpose>
18 <indexterm zone=
"sql-alterusermapping">
19 <primary>ALTER USER MAPPING
</primary>
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>'] [, ... ] )
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 his own user name if
<literal>USAGE<
/> privilege on the server has
42 been granted to the user.
47 <title>Parameters
</title>
51 <term><replaceable class=
"parameter">username
</replaceable></term>
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.
63 <term><replaceable class=
"parameter">servername
</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>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
89 <title>Examples
</title>
92 Change the password for user mapping
<literal>bob<
/>, server
<literal> foo<
/>:
94 ALTER USER MAPPING FOR bob SERVER foo OPTIONS (user 'bob', password 'public');
101 <title>Compatibility
</title>
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
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>