2 doc/src/sgml/ref/alter_foreign_data_wrapper.sgml
3 PostgreSQL documentation
6 <refentry id=
"sql-alterforeigndatawrapper">
7 <indexterm zone=
"sql-alterforeigndatawrapper">
8 <primary>ALTER FOREIGN DATA WRAPPER
</primary>
12 <refentrytitle>ALTER FOREIGN DATA WRAPPER
</refentrytitle>
13 <manvolnum>7</manvolnum>
14 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
18 <refname>ALTER FOREIGN DATA WRAPPER
</refname>
19 <refpurpose>change the definition of a foreign-data wrapper
</refpurpose>
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> | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
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 pre-existing options of the foreign-data
95 wrapper, or of dependent servers, user mappings, or foreign tables, are
96 invalid according to the new validator.
<productname>PostgreSQL
</productname> does
97 not check for this. It is up to the user to make sure that these
98 options are correct before using the modified foreign-data wrapper.
99 However, any options specified in this
<command>ALTER FOREIGN DATA
100 WRAPPER
</command> command will be checked using the new validator.
106 <term><literal>NO VALIDATOR
</literal></term>
109 This is used to specify that the foreign-data wrapper should no
110 longer have a validator function.
116 <term><literal>OPTIONS ( [ ADD | SET | DROP ]
<replaceable class=
"parameter">option
</replaceable> ['
<replaceable class=
"parameter">value
</replaceable>'] [, ... ] )
</literal></term>
119 Change options for the foreign-data
120 wrapper.
<literal>ADD
</literal>,
<literal>SET
</literal>, and
<literal>DROP
</literal>
121 specify the action to be performed.
<literal>ADD
</literal> is assumed
122 if no operation is explicitly specified. Option names must be
123 unique; names and values are also validated using the foreign
124 data wrapper's validator function, if any.
130 <term><replaceable class=
"parameter">new_owner
</replaceable></term>
133 The user name of the new owner of the foreign-data wrapper.
139 <term><replaceable class=
"parameter">new_name
</replaceable></term>
142 The new name for the foreign-data wrapper.
150 <title>Examples
</title>
153 Change a foreign-data wrapper
<literal>dbi
</literal>, add
154 option
<literal>foo
</literal>, drop
<literal>bar
</literal>:
156 ALTER FOREIGN DATA WRAPPER dbi OPTIONS (ADD foo '
1', DROP 'bar');
161 Change the foreign-data wrapper
<literal>dbi
</literal> validator
162 to
<literal>bob.myvalidator
</literal>:
164 ALTER FOREIGN DATA WRAPPER dbi VALIDATOR bob.myvalidator;
165 </programlisting></para>
169 <title>Compatibility
</title>
172 <command>ALTER FOREIGN DATA WRAPPER
</command> conforms to ISO/IEC
173 9075-
9 (SQL/MED), except that the
<literal>HANDLER
</literal>,
174 <literal>VALIDATOR
</literal>,
<literal>OWNER TO
</literal>, and
<literal>RENAME
</literal>
175 clauses are extensions.
180 <title>See Also
</title>
182 <simplelist type=
"inline">
183 <member><xref linkend=
"sql-createforeigndatawrapper"/></member>
184 <member><xref linkend=
"sql-dropforeigndatawrapper"/></member>