Home Explore Blog CI



postgresql

21th chunk of `doc/src/sgml/ref/alter_table.sgml`
33261d1e26d56204f47ab91063bd66e862f4bebce976597c0000000100000fa9
    <varlistentry id="sql-altertable-parms-if-exists">
      <term><literal>IF EXISTS</literal></term>
      <listitem>
       <para>
        Do not throw an error if the table does not exist. A notice is issued
        in this case.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="sql-altertable-parms-name">
      <term><replaceable class="parameter">name</replaceable></term>
      <listitem>
       <para>
        The name (optionally schema-qualified) of an existing table to
        alter. If <literal>ONLY</literal> is specified before the table name, only
        that table is altered. If <literal>ONLY</literal> is not specified, the table
        and all its descendant tables (if any) are altered.  Optionally,
        <literal>*</literal> can be specified after the table name to explicitly
        indicate that descendant tables are included.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="sql-altertable-parms-column-name">
      <term><replaceable class="parameter">column_name</replaceable></term>
      <listitem>
       <para>
        Name of a new or existing column.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="sql-altertable-parms-new-column-name">
      <term><replaceable class="parameter">new_column_name</replaceable></term>
      <listitem>
       <para>
        New name for an existing column.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="sql-altertable-parms-new-name">
      <term><replaceable class="parameter">new_name</replaceable></term>
      <listitem>
       <para>
        New name for the table.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="sql-altertable-parms-data-type">
      <term><replaceable class="parameter">data_type</replaceable></term>
      <listitem>
       <para>
        Data type of the new column, or new data type for an existing
        column.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="sql-altertable-parms-table-constraint">
      <term><replaceable class="parameter">table_constraint</replaceable></term>
      <listitem>
       <para>
        New table constraint for the table.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="sql-altertable-parms-constraint-name">
      <term><replaceable class="parameter">constraint_name</replaceable></term>
      <listitem>
       <para>
        Name of a new or existing constraint.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="sql-altertable-parms-cascade">
      <term><literal>CASCADE</literal></term>
      <listitem>
       <para>
        Automatically drop objects that depend on the dropped column
        or constraint (for example, views referencing the column),
        and in turn all objects that depend on those objects
        (see <xref linkend="ddl-depend"/>).
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="sql-altertable-parms-restrict">
      <term><literal>RESTRICT</literal></term>
      <listitem>
       <para>
        Refuse to drop the column or constraint if there are any dependent
        objects. This is the default behavior.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="sql-altertable-parms-trigger-name">
      <term><replaceable class="parameter">trigger_name</replaceable></term>
      <listitem>
       <para>
        Name of a single trigger to disable or enable.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="sql-altertable-parms-all">
      <term><literal>ALL</literal></term>
      <listitem>
       <para>
        Disable or enable all triggers belonging to the table.
        (This requires superuser privilege if any of the triggers are
        internally generated constraint triggers, such as those that are used
        to implement foreign key constraints or deferrable uniqueness and
        exclusion

Title: ALTER TABLE Parameters
Summary
This section defines several parameters used with the ALTER TABLE command. It includes parameters like IF EXISTS (which controls error throwing), name (the table to alter), column_name (for new or existing columns), new_column_name, new_name (for tables), data_type, table_constraint, constraint_name, CASCADE, RESTRICT, trigger_name, and ALL (for triggers).