Home Explore Blog CI



postgresql

2nd chunk of `doc/src/sgml/ref/alter_view.sgml`
5dfd6902c1408222e7324135631eab3cc1d266cee59f1d6200000001000009a0
 class="parameter">name</replaceable></term>
    <listitem>
     <para>
      The name (optionally schema-qualified) of an existing view.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">column_name</replaceable></term>
    <listitem>
     <para>
      Name of an existing column.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">new_column_name</replaceable></term>
    <listitem>
     <para>
      New name for an existing column.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>IF EXISTS</literal></term>
    <listitem>
     <para>
      Do not throw an error if the view does not exist. A notice is issued
      in this case.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>SET</literal>/<literal>DROP DEFAULT</literal></term>
    <listitem>
     <para>
      These forms set or remove the default value for a column.
      A view column's default value is substituted into any
      <command>INSERT</command> or <command>UPDATE</command> command whose target is the
      view, before applying any rules or triggers for the view.  The view's
      default will therefore take precedence over any default values from
      underlying relations.
     </para>
    </listitem>
   </varlistentry>

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

   <varlistentry>
    <term><replaceable class="parameter">new_name</replaceable></term>
    <listitem>
     <para>
      The new name for the view.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">new_schema</replaceable></term>
    <listitem>
     <para>
      The new schema for the view.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>SET ( <replaceable class="parameter">view_option_name</replaceable> [= <replaceable class="parameter">view_option_value</replaceable>] [, ... ] )</literal></term>
    <term><literal>RESET ( <replaceable class="parameter">view_option_name</replaceable> [, ... ] )</literal></term>
    <listitem>
     <para>
      Sets or resets a view option.  Currently supported options are:
      <variablelist>
       <varlistentry>

Title: ALTER VIEW: Parameters Explained
Summary
This section details the parameters used with the `ALTER VIEW` command in PostgreSQL. It covers parameters like the view's name, column names (existing and new), `IF EXISTS` clause, setting/dropping default values for columns, the new owner of the view, the new name of the view, the new schema, and setting/resetting view options. It also explains that view's default values take precedence over default values from underlying relations.