2 doc/src/sgml/ref/drop_index.sgml
3 PostgreSQL documentation
6 <refentry id="SQL-DROPINDEX">
7 <indexterm zone="sql-dropindex">
8 <primary>DROP INDEX</primary>
12 <refentrytitle>DROP INDEX</refentrytitle>
13 <manvolnum>7</manvolnum>
14 <refmiscinfo>SQL - Language Statements</refmiscinfo>
18 <refname>DROP INDEX</refname>
19 <refpurpose>remove an index</refpurpose>
24 DROP INDEX [ CONCURRENTLY ] [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, ...] [ CASCADE | RESTRICT ]
29 <title>Description</title>
32 <command>DROP INDEX</command> drops an existing index from the database
33 system. To execute this command you must be the owner of
39 <title>Parameters</title>
43 <term><literal>CONCURRENTLY</literal></term>
46 Drop the index without locking out concurrent selects, inserts, updates,
47 and deletes on the index's table. A normal <command>DROP INDEX</>
48 acquires exclusive lock on the table, blocking other accesses until the
49 index drop can be completed. With this option, the command instead
50 waits until conflicting transactions have completed.
53 There are several caveats to be aware of when using this option.
54 Only one index name can be specified, and the <literal>CASCADE</> option
55 is not supported. (Thus, an index that supports a <literal>UNIQUE</> or
56 <literal>PRIMARY KEY</> constraint cannot be dropped this way.)
57 Also, regular <command>DROP INDEX</> commands can be
58 performed within a transaction block, but
59 <command>DROP INDEX CONCURRENTLY</> cannot.
65 <term><literal>IF EXISTS</literal></term>
68 Do not throw an error if the index does not exist. A notice is issued
75 <term><replaceable class="PARAMETER">name</replaceable></term>
78 The name (optionally schema-qualified) of an index to remove.
84 <term><literal>CASCADE</literal></term>
87 Automatically drop objects that depend on the index,
88 and in turn all objects that depend on those objects
89 (see <xref linkend="ddl-depend">).
95 <term><literal>RESTRICT</literal></term>
98 Refuse to drop the index if any objects depend on it. This is
107 <title>Examples</title>
110 This command will remove the index <literal>title_idx</literal>:
113 DROP INDEX title_idx;
114 </programlisting></para>
118 <title>Compatibility</title>
121 <command>DROP INDEX</command> is a
122 <productname>PostgreSQL</productname> language extension. There
123 are no provisions for indexes in the SQL standard.
128 <title>See Also</title>
130 <simplelist type="inline">
131 <member><xref linkend="sql-createindex"></member>