| 1 |
<!-- |
| 2 |
doc/src/sgml/ref/drop_user_mapping.sgml |
| 3 |
PostgreSQL documentation |
| 4 |
--> |
| 5 |
|
| 6 |
<refentry id="sql-dropusermapping"> |
| 7 |
<indexterm zone="sql-dropusermapping"> |
| 8 |
<primary>DROP USER MAPPING</primary> |
| 9 |
</indexterm> |
| 10 |
|
| 11 |
<refmeta> |
| 12 |
<refentrytitle>DROP USER MAPPING</refentrytitle> |
| 13 |
<manvolnum>7</manvolnum> |
| 14 |
<refmiscinfo>SQL - Language Statements</refmiscinfo> |
| 15 |
</refmeta> |
| 16 |
|
| 17 |
<refnamediv> |
| 18 |
<refname>DROP USER MAPPING</refname> |
| 19 |
<refpurpose>remove a user mapping for a foreign server</refpurpose> |
| 20 |
</refnamediv> |
| 21 |
|
| 22 |
<refsynopsisdiv> |
| 23 |
<synopsis> |
| 24 |
DROP USER MAPPING [ IF EXISTS ] FOR { <replaceable class="parameter">user_name</replaceable> | USER | CURRENT_ROLE | CURRENT_USER | PUBLIC } SERVER <replaceable class="parameter">server_name</replaceable> |
| 25 |
</synopsis> |
| 26 |
</refsynopsisdiv> |
| 27 |
|
| 28 |
<refsect1> |
| 29 |
<title>Description</title> |
| 30 |
|
| 31 |
<para> |
| 32 |
<command>DROP USER MAPPING</command> removes an existing user |
| 33 |
mapping from foreign server. |
| 34 |
</para> |
| 35 |
|
| 36 |
<para> |
| 37 |
The owner of a foreign server can drop user mappings for that server |
| 38 |
for any user. Also, a user can drop a user mapping for their own |
| 39 |
user name if <literal>USAGE</literal> privilege on the server has been |
| 40 |
granted to the user. |
| 41 |
</para> |
| 42 |
</refsect1> |
| 43 |
|
| 44 |
<refsect1> |
| 45 |
<title>Parameters</title> |
| 46 |
|
| 47 |
<variablelist> |
| 48 |
<varlistentry> |
| 49 |
<term><literal>IF EXISTS</literal></term> |
| 50 |
<listitem> |
| 51 |
<para> |
| 52 |
Do not throw an error if the user mapping does not exist. A |
| 53 |
notice is issued in this case. |
| 54 |
</para> |
| 55 |
</listitem> |
| 56 |
</varlistentry> |
| 57 |
|
| 58 |
<varlistentry> |
| 59 |
<term><replaceable class="parameter">user_name</replaceable></term> |
| 60 |
<listitem> |
| 61 |
<para> |
| 62 |
User name of the mapping. <literal>CURRENT_ROLE</literal>, <literal>CURRENT_USER</literal>, |
| 63 |
and <literal>USER</literal> match the name of the current |
| 64 |
user. <literal>PUBLIC</literal> is used to match all present and |
| 65 |
future user names in the system. |
| 66 |
</para> |
| 67 |
</listitem> |
| 68 |
</varlistentry> |
| 69 |
|
| 70 |
<varlistentry> |
| 71 |
<term><replaceable class="parameter">server_name</replaceable></term> |
| 72 |
<listitem> |
| 73 |
<para> |
| 74 |
Server name of the user mapping. |
| 75 |
</para> |
| 76 |
</listitem> |
| 77 |
</varlistentry> |
| 78 |
</variablelist> |
| 79 |
</refsect1> |
| 80 |
|
| 81 |
<refsect1> |
| 82 |
<title>Examples</title> |
| 83 |
|
| 84 |
<para> |
| 85 |
Drop a user mapping <literal>bob</literal>, server <literal>foo</literal> if it exists: |
| 86 |
<programlisting> |
| 87 |
DROP USER MAPPING IF EXISTS FOR bob SERVER foo; |
| 88 |
</programlisting></para> |
| 89 |
</refsect1> |
| 90 |
|
| 91 |
<refsect1> |
| 92 |
<title>Compatibility</title> |
| 93 |
|
| 94 |
<para> |
| 95 |
<command>DROP USER MAPPING</command> conforms to ISO/IEC 9075-9 |
| 96 |
(SQL/MED). The <literal>IF EXISTS</literal> clause is |
| 97 |
a <productname>PostgreSQL</productname> extension. |
| 98 |
</para> |
| 99 |
</refsect1> |
| 100 |
|
| 101 |
<refsect1> |
| 102 |
<title>See Also</title> |
| 103 |
|
| 104 |
<simplelist type="inline"> |
| 105 |
<member><xref linkend="sql-createusermapping"/></member> |
| 106 |
<member><xref linkend="sql-alterusermapping"/></member> |
| 107 |
</simplelist> |
| 108 |
</refsect1> |
| 109 |
|
| 110 |
</refentry> |