The code to unlink dropped relations in FinishPreparedTransaction() was
[PostgreSQL.git] / doc / src / sgml / ref / drop_index.sgml
blob4373c3aff7efd84a43e3c7f76106bf7a64872850
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-DROPINDEX">
7 <refmeta>
8 <refentrytitle id="SQL-DROPINDEX-TITLE">DROP INDEX</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>DROP INDEX</refname>
15 <refpurpose>remove an index</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-dropindex">
19 <primary>DROP INDEX</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
24 DROP INDEX [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, ...] [ CASCADE | RESTRICT ]
25 </synopsis>
26 </refsynopsisdiv>
28 <refsect1>
29 <title>Description</title>
31 <para>
32 <command>DROP INDEX</command> drops an existing index from the database
33 system. To execute this command you must be the owner of
34 the index.
35 </para>
36 </refsect1>
38 <refsect1>
39 <title>Parameters</title>
41 <variablelist>
42 <varlistentry>
43 <term><literal>IF EXISTS</literal></term>
44 <listitem>
45 <para>
46 Do not throw an error if the index does not exist. A notice is issued
47 in this case.
48 </para>
49 </listitem>
50 </varlistentry>
52 <varlistentry>
53 <term><replaceable class="PARAMETER">name</replaceable></term>
54 <listitem>
55 <para>
56 The name (optionally schema-qualified) of an index to remove.
57 </para>
58 </listitem>
59 </varlistentry>
61 <varlistentry>
62 <term><literal>CASCADE</literal></term>
63 <listitem>
64 <para>
65 Automatically drop objects that depend on the index.
66 </para>
67 </listitem>
68 </varlistentry>
70 <varlistentry>
71 <term><literal>RESTRICT</literal></term>
72 <listitem>
73 <para>
74 Refuse to drop the index if any objects depend on it. This is
75 the default.
76 </para>
77 </listitem>
78 </varlistentry>
79 </variablelist>
80 </refsect1>
82 <refsect1>
83 <title>Examples</title>
85 <para>
86 This command will remove the index <literal>title_idx</literal>:
88 <programlisting>
89 DROP INDEX title_idx;
90 </programlisting>
91 </para>
92 </refsect1>
94 <refsect1>
95 <title>Compatibility</title>
97 <para>
98 <command>DROP INDEX</command> is a
99 <productname>PostgreSQL</productname> language extension. There
100 are no provisions for indexes in the SQL standard.
101 </para>
102 </refsect1>
104 <refsect1>
105 <title>See Also</title>
107 <simplelist type="inline">
108 <member><xref linkend="sql-createindex" endterm="sql-createindex-title"></member>
109 </simplelist>
110 </refsect1>
112 </refentry>