Home Explore Blog CI



postgresql

2nd chunk of `doc/src/sgml/ref/alter_materialized_view.sgml`
98bc2c9070a0160d28c98ff7bd7dc433788e465685dc322b00000001000008d4
 COMPRESSION <replaceable class="parameter">compression_method</replaceable>
    CLUSTER ON <replaceable class="parameter">index_name</replaceable>
    SET WITHOUT CLUSTER
    SET ACCESS METHOD <replaceable class="parameter">new_access_method</replaceable>
    SET TABLESPACE <replaceable class="parameter">new_tablespace</replaceable>
    SET ( <replaceable class="parameter">storage_parameter</replaceable> [= <replaceable class="parameter">value</replaceable>] [, ... ] )
    RESET ( <replaceable class="parameter">storage_parameter</replaceable> [, ... ] )
    OWNER TO { <replaceable class="parameter">new_owner</replaceable> | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   <command>ALTER MATERIALIZED VIEW</command> changes various auxiliary
   properties of an existing materialized view.
  </para>

  <para>
   You must own the materialized view to use <command>ALTER MATERIALIZED
   VIEW</command>.  To change a materialized view's schema, you must also have
   <literal>CREATE</literal> privilege on the new schema.
   To alter the owner, you must be able to <literal>SET ROLE</literal> to the
   new owning role, and that role must have <literal>CREATE</literal>
   privilege on the materialized view's schema.
   (These restrictions enforce that altering
   the owner doesn't do anything you couldn't do by dropping and recreating the
   materialized view.  However, a superuser can alter ownership of any view
   anyway.)
  </para>

  <para>
   The statement subforms and actions available for
   <command>ALTER MATERIALIZED VIEW</command> are a subset of those available
   for <command>ALTER TABLE</command>, and have the same meaning when used for
   materialized views.  See the descriptions for
   <link linkend="sql-altertable"><command>ALTER TABLE</command></link>
   for details.
  </para>
 </refsect1>

 <refsect1>
  <title>Parameters</title>

   <variablelist>

    <varlistentry>
     <term><replaceable class="parameter">name</replaceable></term>
     <listitem>
      <para>
       The name (optionally schema-qualified) of an existing materialized view.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable

Title: ALTER MATERIALIZED VIEW - Description and Parameters
Summary
The ALTER MATERIALIZED VIEW command allows modifying properties of existing materialized views, including setting compression methods, cluster indexes, access methods, tablespaces, storage parameters, and ownership. Users must own the materialized view and have appropriate privileges to alter the schema or ownership. The statement subforms and actions available are a subset of those for ALTER TABLE. The parameters section details the 'name' parameter, which specifies the name of the materialized view to be altered.