Home Explore Blog CI



postgresql

3rd chunk of `doc/src/sgml/ref/alter_foreign_data_wrapper.sgml`
b6c868945c9cd6a7c536e64324725894fa6a05f7e136e1c30000000100000bcf
 of the foreign-data
      wrapper, or of dependent servers, user mappings, or foreign tables, are
      invalid according to the new validator.  <productname>PostgreSQL</productname> does
      not check for this.  It is up to the user to make sure that these
      options are correct before using the modified foreign-data wrapper.
      However, any options specified in this <command>ALTER FOREIGN DATA
      WRAPPER</command> command will be checked using the new validator.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>NO VALIDATOR</literal></term>
    <listitem>
     <para>
      This is used to specify that the foreign-data wrapper should no
      longer have a validator function.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>OPTIONS ( [ ADD | SET | DROP ] <replaceable class="parameter">option</replaceable> ['<replaceable class="parameter">value</replaceable>'] [, ... ] )</literal></term>
    <listitem>
     <para>
      Change options for the foreign-data
      wrapper.  <literal>ADD</literal>, <literal>SET</literal>, and <literal>DROP</literal>
      specify the action to be performed.  <literal>ADD</literal> is assumed
      if no operation is explicitly specified.  Option names must be
      unique; names and values are also validated using the foreign
      data wrapper's validator function, if any.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">new_owner</replaceable></term>
    <listitem>
     <para>
      The user name of the new owner of the foreign-data wrapper.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">new_name</replaceable></term>
    <listitem>
     <para>
      The new name for the foreign-data wrapper.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1>
  <title>Examples</title>

  <para>
   Change a foreign-data wrapper <literal>dbi</literal>, add
   option <literal>foo</literal>, drop <literal>bar</literal>:
<programlisting>
ALTER FOREIGN DATA WRAPPER dbi OPTIONS (ADD foo '1', DROP bar);
</programlisting>
  </para>

  <para>
   Change the foreign-data wrapper <literal>dbi</literal> validator
   to <literal>bob.myvalidator</literal>:
<programlisting>
ALTER FOREIGN DATA WRAPPER dbi VALIDATOR bob.myvalidator;
</programlisting></para>
 </refsect1>

 <refsect1>
  <title>Compatibility</title>

  <para>
   <command>ALTER FOREIGN DATA WRAPPER</command> conforms to ISO/IEC
   9075-9 (SQL/MED), except that the <literal>HANDLER</literal>,
   <literal>VALIDATOR</literal>, <literal>OWNER TO</literal>, and <literal>RENAME</literal>
   clauses are extensions.
  </para>
 </refsect1>

 <refsect1>
  <title>See Also</title>

  <simplelist type="inline">
   <member><xref linkend="sql-createforeigndatawrapper"/></member>
   <member><xref linkend="sql-dropforeigndatawrapper"/></member>
  </simplelist>
 </refsect1>

</refentry>

Title: ALTER FOREIGN DATA WRAPPER: Options, Owner, Name, Examples, and Compatibility
Summary
This section covers the remaining parameters for the ALTER FOREIGN DATA WRAPPER command, including modifying options (ADD, SET, DROP), changing the owner, and renaming the foreign data wrapper. It provides examples of altering a foreign-data wrapper's options and validator. It also mentions compatibility with the SQL/MED standard, noting that HANDLER, VALIDATOR, OWNER TO, and RENAME are extensions, and provides links to related commands.