2
doc/src/sgml/ref/alter_foreign_data_wrapper.sgml
3
PostgreSQL documentation
6
<refentry id="SQL-ALTERFOREIGNDATAWRAPPER">
8
<refentrytitle>ALTER FOREIGN DATA WRAPPER</refentrytitle>
9
<manvolnum>7</manvolnum>
10
<refmiscinfo>SQL - Language Statements</refmiscinfo>
14
<refname>ALTER FOREIGN DATA WRAPPER</refname>
15
<refpurpose>change the definition of a foreign-data wrapper</refpurpose>
18
<indexterm zone="sql-alterforeigndatawrapper">
19
<primary>ALTER FOREIGN DATA WRAPPER</primary>
24
ALTER FOREIGN DATA WRAPPER <replaceable class="parameter">name</replaceable>
25
[ HANDLER <replaceable class="parameter">handler_function</replaceable> | NO HANDLER ]
26
[ VALIDATOR <replaceable class="parameter">validator_function</replaceable> | NO VALIDATOR ]
27
[ OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ]) ]
28
ALTER FOREIGN DATA WRAPPER <replaceable class="parameter">name</replaceable> OWNER TO <replaceable>new_owner</replaceable>
29
ALTER FOREIGN DATA WRAPPER <replaceable class="parameter">name</replaceable> RENAME TO <replaceable>new_name</replaceable>
34
<title>Description</title>
37
<command>ALTER FOREIGN DATA WRAPPER</command> changes the
38
definition of a foreign-data wrapper. The first form of the
39
command changes the support functions or the generic options of the
40
foreign-data wrapper (at least one clause is required). The second
41
form changes the owner of the foreign-data wrapper.
45
Only superusers can alter foreign-data wrappers. Additionally,
46
only superusers can own foreign-data wrappers.
51
<title>Parameters</title>
55
<term><replaceable class="parameter">name</replaceable></term>
58
The name of an existing foreign-data wrapper.
64
<term><literal>HANDLER <replaceable class="parameter">handler_function</replaceable></literal></term>
67
Specifies a new handler function for the foreign-data wrapper.
73
<term><literal>NO HANDLER</literal></term>
76
This is used to specify that the foreign-data wrapper should no
77
longer have a handler function.
80
Note that foreign tables that use a foreign-data wrapper with no
81
handler cannot be accessed.
87
<term><literal>VALIDATOR <replaceable class="parameter">validator_function</replaceable></literal></term>
90
Specifies a new validator function for the foreign-data wrapper.
94
Note that it is possible that after changing the validator the
95
options to the foreign-data wrapper, servers, and user mappings
96
have become invalid. It is up to the user to make sure that
97
these options are correct before using the foreign-data
104
<term><literal>NO VALIDATOR</literal></term>
107
This is used to specify that the foreign-data wrapper should no
108
longer have a validator function.
114
<term><literal>OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ] )</literal></term>
117
Change options for the foreign-data
118
wrapper. <literal>ADD</>, <literal>SET</>, and <literal>DROP</>
119
specify the action to be performed. <literal>ADD</> is assumed
120
if no operation is explicitly specified. Option names must be
121
unique; names and values are also validated using the foreign
122
data wrapper's validator function, if any.
128
<term><replaceable class="PARAMETER">new_owner</replaceable></term>
131
The user name of the new owner of the foreign-data wrapper.
137
<term><replaceable class="parameter">new_name</replaceable></term>
140
The new name for the foreign-data wrapper.
148
<title>Examples</title>
151
Change a foreign-data wrapper <literal>dbi</>, add
152
option <literal>foo</>, drop <literal>bar</>:
154
ALTER FOREIGN DATA WRAPPER dbi OPTIONS (ADD foo '1', DROP 'bar');
159
Change the foreign-data wrapper <literal>dbi</> validator
160
to <literal>bob.myvalidator</>:
162
ALTER FOREIGN DATA WRAPPER dbi VALIDATOR bob.myvalidator;
163
</programlisting></para>
167
<title>Compatibility</title>
170
<command>ALTER FOREIGN DATA WRAPPER</command> conforms to ISO/IEC
171
9075-9 (SQL/MED), except that the <literal>HANDLER</literal>,
172
<literal>VALIDATOR</>, <literal>OWNER TO</>, and <literal>RENAME</literal>
173
clauses are extensions.
178
<title>See Also</title>
180
<simplelist type="inline">
181
<member><xref linkend="sql-createforeigndatawrapper"></member>
182
<member><xref linkend="sql-dropforeigndatawrapper"></member>