The code to unlink dropped relations in FinishPreparedTransaction() was
[PostgreSQL.git] / doc / src / sgml / ref / alter_foreign_data_wrapper.sgml
blobdac767a9bf81ea0cafb51c22bd45848509207091
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-ALTERFOREIGNDATAWRAPPER">
7 <refmeta>
8 <refentrytitle id="sql-alterforeigndatawrapper-title">ALTER FOREIGN DATA WRAPPER</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>ALTER FOREIGN DATA WRAPPER</refname>
15 <refpurpose>change the definition of a foreign-data wrapper</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-alterforeigndatawrapper">
19 <primary>ALTER FOREIGN DATA WRAPPER</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
24 ALTER FOREIGN DATA WRAPPER <replaceable class="parameter">name</replaceable>
25 [ VALIDATOR <replaceable class="parameter">valfunction</replaceable> | NO VALIDATOR ]
26 [ OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ]) ]
27 ALTER FOREIGN DATA WRAPPER <replaceable class="parameter">name</replaceable> OWNER TO <replaceable>new_owner</replaceable>
28 </synopsis>
29 </refsynopsisdiv>
31 <refsect1>
32 <title>Description</title>
34 <para>
35 <command>ALTER FOREIGN DATA WRAPPER</command> changes the
36 definition of a foreign-data wrapper. The first form of the
37 command changes the library or the generic options of the
38 foreign-data wrapper (at least one clause is required). The second
39 form changes the owner of the foreign-data wrapper.
40 </para>
42 <para>
43 Only superusers can alter foreign-data wrappers. Additionally,
44 only superusers can own foreign-data wrappers.
45 </para>
46 </refsect1>
48 <refsect1>
49 <title>Parameters</title>
51 <variablelist>
52 <varlistentry>
53 <term><replaceable class="parameter">name</replaceable></term>
54 <listitem>
55 <para>
56 The name of an existing foreign-data wrapper.
57 </para>
58 </listitem>
59 </varlistentry>
61 <varlistentry>
62 <term><literal>VALIDATOR <replaceable class="parameter">valfunction</replaceable></literal></term>
63 <listitem>
64 <para>
65 Specifies a new foreign-data wrapper validator function.
66 </para>
68 <para>
69 Note that it is possible that after changing the validator the
70 options to the foreign-data wrapper, servers, and user mappings
71 have become invalid. It is up to the user to make sure that
72 these options are correct before using the foreign-data
73 wrapper.
74 </para>
75 </listitem>
76 </varlistentry>
78 <varlistentry>
79 <term><literal>NO VALIDATOR</literal></term>
80 <listitem>
81 <para>
82 This is used to specify that the foreign-data wrapper should no
83 longer have a validator function.
84 </para>
85 </listitem>
86 </varlistentry>
88 <varlistentry>
89 <term><literal>OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ] )</literal></term>
90 <listitem>
91 <para>
92 Change options for the foreign-data
93 wrapper. <literal>ADD</>, <literal>SET</>, and <literal>DROP</>
94 specify the action to be performed. <literal>ADD</> is assumed
95 if no operation is explicitly specified. Option names must be
96 unique; names and values are also validated using the foreign
97 data wrapper library.
98 </para>
99 </listitem>
100 </varlistentry>
101 </variablelist>
102 </refsect1>
104 <refsect1>
105 <title>Examples</title>
107 <para>
108 Change a foreign-data wrapper <literal>dbi</>, add
109 option <literal>foo</>, drop <literal>bar</>:
110 <programlisting>
111 ALTER FOREIGN DATA WRAPPER dbi OPTIONS (ADD foo '1', DROP 'bar');
112 </programlisting>
113 </para>
115 <para>
116 Change the foreign-data wrapper <literal>dbi</> validator
117 to <literal>bob.myvalidator</>:
118 <programlisting>
119 ALTER FOREIGN DATA WRAPPER dbi VALIDATOR bob.myvalidator;
120 </programlisting>
121 </para>
122 </refsect1>
124 <refsect1>
125 <title>Compatibility</title>
127 <para>
128 <command>ALTER FOREIGN DATA WRAPPER</command> conforms to ISO/IEC
129 9075-9 (SQL/MED). The standard does not specify the <literal>
130 VALIDATOR</literal> and <literal>OWNER TO</> variants of the
131 command.
132 </para>
133 </refsect1>
135 <refsect1>
136 <title>See Also</title>
138 <simplelist type="inline">
139 <member><xref linkend="sql-createforeigndatawrapper" endterm="sql-createforeigndatawrapper-title"></member>
140 <member><xref linkend="sql-dropforeigndatawrapper" endterm="sql-dropforeigndatawrapper-title"></member>
141 </simplelist>
142 </refsect1>
144 </refentry>