Debian Codegraph @

doc/src/sgml/ref/drop_materialized_view.sgml

raw
1 <!--
2 doc/src/sgml/ref/drop_materialized_view.sgml
3 PostgreSQL documentation
4 -->
5
6 <refentry id="sql-dropmaterializedview">
7 <indexterm zone="sql-dropmaterializedview">
8 <primary>DROP MATERIALIZED VIEW</primary>
9 </indexterm>
10
11 <refmeta>
12 <refentrytitle>DROP MATERIALIZED VIEW</refentrytitle>
13 <manvolnum>7</manvolnum>
14 <refmiscinfo>SQL - Language Statements</refmiscinfo>
15 </refmeta>
16
17 <refnamediv>
18 <refname>DROP MATERIALIZED VIEW</refname>
19 <refpurpose>remove a materialized view</refpurpose>
20 </refnamediv>
21
22 <refsynopsisdiv>
23 <synopsis>
24 DROP MATERIALIZED VIEW [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [, ...] [ CASCADE | RESTRICT ]
25 </synopsis>
26 </refsynopsisdiv>
27
28 <refsect1>
29 <title>Description</title>
30
31 <para>
32 <command>DROP MATERIALIZED VIEW</command> drops an existing materialized
33 view. To execute this command you must be the owner of the materialized
34 view.
35 </para>
36 </refsect1>
37
38 <refsect1>
39 <title>Parameters</title>
40
41 <variablelist>
42 <varlistentry>
43 <term><literal>IF EXISTS</literal></term>
44 <listitem>
45 <para>
46 Do not throw an error if the materialized view does not exist. A notice
47 is issued in this case.
48 </para>
49 </listitem>
50 </varlistentry>
51
52 <varlistentry>
53 <term><replaceable class="parameter">name</replaceable></term>
54 <listitem>
55 <para>
56 The name (optionally schema-qualified) of the materialized view to
57 remove.
58 </para>
59 </listitem>
60 </varlistentry>
61
62 <varlistentry>
63 <term><literal>CASCADE</literal></term>
64 <listitem>
65 <para>
66 Automatically drop objects that depend on the materialized view (such as
67 other materialized views, or regular views),
68 and in turn all objects that depend on those objects
69 (see <xref linkend="ddl-depend"/>).
70 </para>
71 </listitem>
72 </varlistentry>
73
74 <varlistentry>
75 <term><literal>RESTRICT</literal></term>
76 <listitem>
77 <para>
78 Refuse to drop the materialized view if any objects depend on it. This
79 is the default.
80 </para>
81 </listitem>
82 </varlistentry>
83 </variablelist>
84 </refsect1>
85
86 <refsect1>
87 <title>Examples</title>
88
89 <para>
90 This command will remove the materialized view called
91 <literal>order_summary</literal>:
92 <programlisting>
93 DROP MATERIALIZED VIEW order_summary;
94 </programlisting></para>
95 </refsect1>
96
97 <refsect1>
98 <title>Compatibility</title>
99
100 <para>
101 <command>DROP MATERIALIZED VIEW</command> is a
102 <productname>PostgreSQL</productname> extension.
103 </para>
104 </refsect1>
105
106 <refsect1>
107 <title>See Also</title>
108
109 <simplelist type="inline">
110 <member><xref linkend="sql-creatematerializedview"/></member>
111 <member><xref linkend="sql-altermaterializedview"/></member>
112 <member><xref linkend="sql-refreshmaterializedview"/></member>
113 </simplelist>
114 </refsect1>
115
116 </refentry>