<!--
doc/src/sgml/ref/alter_foreign_data_wrapper.sgml
PostgreSQL documentation
-->
<refentry id="sql-alterforeigndatawrapper">
<indexterm zone="sql-alterforeigndatawrapper">
<primary>ALTER FOREIGN DATA WRAPPER</primary>
</indexterm>
<refmeta>
<refentrytitle>ALTER FOREIGN DATA WRAPPER</refentrytitle>
<manvolnum>7</manvolnum>
<refmiscinfo>SQL - Language Statements</refmiscinfo>
</refmeta>
<refnamediv>
<refname>ALTER FOREIGN DATA WRAPPER</refname>
<refpurpose>change the definition of a foreign-data wrapper</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
ALTER FOREIGN DATA WRAPPER <replaceable class="parameter">name</replaceable>
[ HANDLER <replaceable class="parameter">handler_function</replaceable> | NO HANDLER ]
[ VALIDATOR <replaceable class="parameter">validator_function</replaceable> | NO VALIDATOR ]
[ OPTIONS ( [ ADD | SET | DROP ] <replaceable class="parameter">option</replaceable> ['<replaceable class="parameter">value</replaceable>'] [, ... ]) ]
ALTER FOREIGN DATA WRAPPER <replaceable class="parameter">name</replaceable> OWNER TO { <replaceable>new_owner</replaceable> | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
ALTER FOREIGN DATA WRAPPER <replaceable class="parameter">name</replaceable> RENAME TO <replaceable>new_name</replaceable>
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
<command>ALTER FOREIGN DATA WRAPPER</command> changes the
definition of a foreign-data wrapper. The first form of the
command changes the support functions or the generic options of the
foreign-data wrapper (at least one clause is required). The second
form changes the owner of the foreign-data wrapper.
</para>
<para>
Only superusers can alter foreign-data wrappers. Additionally,
only superusers can own foreign-data wrappers.
</para>
</refsect1>
<refsect1>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term><replaceable class="parameter">name</replaceable></term>
<listitem>
<para>
The name of an existing foreign-data wrapper.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>HANDLER <replaceable class="parameter">handler_function</replaceable></literal></term>
<listitem>
<para>
Specifies a new handler function for the foreign-data wrapper.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>NO HANDLER</literal></term>
<listitem>
<para>
This is used to specify that the foreign-data wrapper should no
longer have a handler function.
</para>
<para>
Note that foreign tables that use a foreign-data wrapper with no
handler cannot be accessed.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>VALIDATOR <replaceable class="parameter">validator_function</replaceable></literal></term>
<listitem>
<para>
Specifies a new validator function for the foreign-data wrapper.
</para>
<para>
Note that it is