Home Explore Blog CI



postgresql

5th chunk of `doc/src/sgml/ref/alter_type.sgml`
1e39f4ca7a773f26041e792b47752e488fd8f9f4cda4e53b00000001000009c6
    </listitem>
     </varlistentry>

     <varlistentry>
      <term><replaceable class="parameter">data_type</replaceable></term>
      <listitem>
       <para>
        The data type of the attribute to add, or the new type of the
        attribute to alter.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><replaceable class="parameter">new_enum_value</replaceable></term>
      <listitem>
       <para>
        The new value to be added to an enum type's list of values,
        or the new name to be given to an existing value.
        Like all enum literals, it needs to be quoted.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><replaceable class="parameter">neighbor_enum_value</replaceable></term>
      <listitem>
       <para>
        The existing enum value that the new value should be added immediately
        before or after in the enum type's sort ordering.
        Like all enum literals, it needs to be quoted.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><replaceable class="parameter">existing_enum_value</replaceable></term>
      <listitem>
       <para>
        The existing enum value that should be renamed.
        Like all enum literals, it needs to be quoted.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><replaceable class="parameter">property</replaceable></term>
      <listitem>
       <para>
        The name of a base-type property to be modified; see above for
        possible values.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><literal>CASCADE</literal></term>
      <listitem>
       <para>
        Automatically propagate the operation to typed tables of the
        type being altered, and their descendants.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><literal>RESTRICT</literal></term>
      <listitem>
       <para>
        Refuse the operation if the type being altered is the type of a
        typed table.  This is the default.
       </para>
      </listitem>
     </varlistentry>

    </variablelist>
   </para>
  </refsect1>

 <refsect1>
  <title>Notes</title>

  <para>
   If <command>ALTER TYPE ... ADD VALUE</command> (the form that adds a new
   value to an enum type) is executed inside a transaction block, the new
   value cannot be used until after the transaction has been committed.
  </para>

Title: ALTER TYPE Command: Parameters Continued and Notes
Summary
This section details remaining parameters for the ALTER TYPE command, including parameters for modifying enum types (new enum value, neighbor enum value, existing enum value) and base-type properties. It also covers CASCADE and RESTRICT options for typed tables. A note mentions that new enum values added within a transaction block are not usable until the transaction commits.