Home Explore Blog CI



postgresql

4th chunk of `doc/src/sgml/ref/alter_foreign_table.sgml`
5b816501cf8885117d85040027044afdd1e4f9d27e4a968f0000000100000fa3
 isn't
      assumed to hold, but is only recorded for possible future use.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>VALIDATE CONSTRAINT</literal></term>
    <listitem>
     <para>
      This form marks as valid a constraint that was previously marked
      as <literal>NOT VALID</literal>.  No action is taken to verify the
      constraint, but future queries will assume that it holds.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>DROP CONSTRAINT [ IF EXISTS ]</literal></term>
    <listitem>
     <para>
      This form drops the specified constraint on a foreign table.
      If <literal>IF EXISTS</literal> is specified and the constraint
      does not exist, no error is thrown.
      In this case a notice is issued instead.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>DISABLE</literal>/<literal>ENABLE [ REPLICA | ALWAYS ] TRIGGER</literal></term>
    <listitem>
     <para>
      These forms configure the firing of trigger(s) belonging to the foreign
      table.  See the similar form of <link linkend="sql-altertable"><command>ALTER TABLE</command></link> for more
      details.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>SET WITHOUT OIDS</literal></term>
    <listitem>
     <para>
      Backward compatibility syntax for removing the <literal>oid</literal>
      system column. As <literal>oid</literal> system columns cannot be added
      anymore, this never has an effect.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>INHERIT <replaceable class="parameter">parent_table</replaceable></literal></term>
    <listitem>
     <para>
      This form adds the target foreign table as a new child of the specified
      parent table.
      See the similar form of <link linkend="sql-altertable"><command>ALTER TABLE</command></link>
      for more details.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>NO INHERIT <replaceable class="parameter">parent_table</replaceable></literal></term>
    <listitem>
     <para>
      This form removes the target foreign table from the list of children of
      the specified parent table.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>OWNER</literal></term>
    <listitem>
     <para>
      This form changes the owner of the foreign table to the
      specified user.
     </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 table or one of its columns.
      <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.  Duplicate option names are not
      allowed (although it's OK for a table option and a column option to have
      the same name).  Option names and values are also validated using the
      foreign data wrapper library.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>RENAME</literal></term>
    <listitem>
     <para>
      The <literal>RENAME</literal> forms change the name of a foreign table
      or the name of an individual column in a foreign table.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>SET SCHEMA</literal></term>
    <listitem>
     <para>
      This form moves the foreign table into another schema.
     </para>
    </listitem>
   </varlistentry>

  </variablelist>
  </para>

  <para>
   All the actions except <literal>RENAME</literal> and <literal>SET SCHEMA</literal>
   can be combined into
   a list of multiple alterations to apply

Title: ALTER FOREIGN TABLE - Trigger Configuration, Inheritance, Ownership, Options, and Renaming
Summary
This section describes various ALTER FOREIGN TABLE operations: enabling/disabling triggers (REPLICA/ALWAYS), removing OIDs (legacy), inheriting/uninheriting from parent tables, changing ownership, manipulating options (ADD/SET/DROP) for the table and columns, renaming tables/columns, and moving tables to a different schema. Multiple alterations can be combined, excluding renaming and schema changes.