]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/drop_view.sgml
Fix psql doc typo.
[postgresql] / doc / src / sgml / ref / drop_view.sgml
1 <!--
2 doc/src/sgml/ref/drop_view.sgml
3 PostgreSQL documentation
4 -->
5
6 <refentry id="SQL-DROPVIEW">
7  <refmeta>
8   <refentrytitle>DROP VIEW</refentrytitle>
9   <manvolnum>7</manvolnum>
10   <refmiscinfo>SQL - Language Statements</refmiscinfo>
11  </refmeta>
12
13  <refnamediv>
14   <refname>DROP VIEW</refname>
15   <refpurpose>remove a view</refpurpose>
16  </refnamediv>
17
18  <indexterm zone="sql-dropview">
19   <primary>DROP VIEW</primary>
20  </indexterm>
21
22  <refsynopsisdiv>
23 <synopsis>
24 DROP 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 VIEW</command> drops an existing view.  To execute
33    this command you must be the owner of the view.
34   </para>
35  </refsect1>
36
37  <refsect1>
38   <title>Parameters</title>
39
40   <variablelist>
41    <varlistentry>
42     <term><literal>IF EXISTS</literal></term>
43     <listitem>
44      <para>
45       Do not throw an error if the view does not exist. A notice is issued
46       in this case.
47      </para>
48     </listitem>
49    </varlistentry>
50
51    <varlistentry>
52     <term><replaceable class="PARAMETER">name</replaceable></term>
53     <listitem>
54      <para>
55       The name (optionally schema-qualified) of the view to remove.
56      </para>
57     </listitem>
58    </varlistentry>
59
60    <varlistentry>
61     <term><literal>CASCADE</literal></term>
62     <listitem>
63      <para>
64       Automatically drop objects that depend on the view (such as
65       other views).
66      </para>
67     </listitem>
68    </varlistentry>
69
70    <varlistentry>
71     <term><literal>RESTRICT</literal></term>
72     <listitem>
73      <para>
74       Refuse to drop the view if any objects depend on it.  This is
75       the default.
76      </para>
77     </listitem>
78    </varlistentry>
79   </variablelist>
80  </refsect1>
81
82  <refsect1>
83   <title>Examples</title>
84
85   <para>
86    This command will remove the view called <literal>kinds</literal>:
87 <programlisting>
88 DROP VIEW kinds;
89 </programlisting></para>
90  </refsect1>
91
92  <refsect1>
93   <title>Compatibility</title>
94
95   <para>
96    This command conforms to the SQL standard, except that the standard only
97    allows one view to be dropped per command, and apart from the
98    <literal>IF EXISTS</> option, which is a <productname>PostgreSQL</>
99    extension.
100   </para>
101  </refsect1>
102
103  <refsect1>
104   <title>See Also</title>
105
106   <simplelist type="inline">
107    <member><xref linkend="sql-alterview"></member>
108    <member><xref linkend="sql-createview"></member>
109   </simplelist>
110  </refsect1>
111
112 </refentry>