The code to unlink dropped relations in FinishPreparedTransaction() was
[PostgreSQL.git] / doc / src / sgml / ref / drop_opclass.sgml
blobcf498ab2c95f3f7e156ccbf6f5ddbb0e925ebf4c
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-DROPOPCLASS">
7 <refmeta>
8 <refentrytitle id="SQL-DROPOPCLASS-TITLE">DROP OPERATOR CLASS</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>DROP OPERATOR CLASS</refname>
15 <refpurpose>remove an operator class</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-dropopclass">
19 <primary>DROP OPERATOR CLASS</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
24 DROP OPERATOR CLASS [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> USING <replaceable class="PARAMETER">index_method</replaceable> [ CASCADE | RESTRICT ]
25 </synopsis>
26 </refsynopsisdiv>
28 <refsect1>
29 <title>Description</title>
31 <para>
32 <command>DROP OPERATOR CLASS</command> drops an existing operator class.
33 To execute this command you must be the owner of the operator class.
34 </para>
36 <para>
37 <command>DROP OPERATOR CLASS</command> does not drop any of the operators
38 or functions referenced by the class. If there are any indexes depending
39 on the operator class, you will need to specify
40 <literal>CASCADE</> for the drop to complete.
41 </para>
42 </refsect1>
44 <refsect1>
45 <title>Parameters</title>
47 <variablelist>
49 <varlistentry>
50 <term><literal>IF EXISTS</literal></term>
51 <listitem>
52 <para>
53 Do not throw an error if the operator class does not exist. A notice is issued
54 in this case.
55 </para>
56 </listitem>
57 </varlistentry>
59 <varlistentry>
60 <term><replaceable class="parameter">name</replaceable></term>
61 <listitem>
62 <para>
63 The name (optionally schema-qualified) of an existing operator class.
64 </para>
65 </listitem>
66 </varlistentry>
68 <varlistentry>
69 <term><replaceable class="parameter">index_method</replaceable></term>
70 <listitem>
71 <para>
72 The name of the index access method the operator class is for.
73 </para>
74 </listitem>
75 </varlistentry>
77 <varlistentry>
78 <term><literal>CASCADE</literal></term>
79 <listitem>
80 <para>
81 Automatically drop objects that depend on the operator class.
82 </para>
83 </listitem>
84 </varlistentry>
86 <varlistentry>
87 <term><literal>RESTRICT</literal></term>
88 <listitem>
89 <para>
90 Refuse to drop the operator class if any objects depend on it.
91 This is the default.
92 </para>
93 </listitem>
94 </varlistentry>
95 </variablelist>
96 </refsect1>
98 <refsect1>
99 <title>Notes</title>
101 <para>
102 <command>DROP OPERATOR CLASS</> will not drop the operator family
103 containing the class, even if there is nothing else left in the
104 family (in particular, in the case where the family was implicitly
105 created by <command>CREATE OPERATOR CLASS</>). An empty operator
106 family is harmless, but for the sake of tidiness you might wish to
107 remove the family with <command>DROP OPERATOR FAMILY</>; or perhaps
108 better, use <command>DROP OPERATOR FAMILY</> in the first place.
109 </para>
110 </refsect1>
112 <refsect1>
113 <title>Examples</title>
115 <para>
116 Remove the B-tree operator class <literal>widget_ops</literal>:
118 <programlisting>
119 DROP OPERATOR CLASS widget_ops USING btree;
120 </programlisting>
122 This command will not succeed if there are any existing indexes
123 that use the operator class. Add <literal>CASCADE</> to drop
124 such indexes along with the operator class.
125 </para>
126 </refsect1>
128 <refsect1>
129 <title>Compatibility</title>
131 <para>
132 There is no <command>DROP OPERATOR CLASS</command> statement in the
133 SQL standard.
134 </para>
135 </refsect1>
137 <refsect1>
138 <title>See Also</title>
140 <simplelist type="inline">
141 <member><xref linkend="sql-alteropclass" endterm="sql-alteropclass-title"></member>
142 <member><xref linkend="sql-createopclass" endterm="sql-createopclass-title"></member>
143 <member><xref linkend="sql-dropopfamily" endterm="sql-dropopfamily-title"></member>
144 </simplelist>
145 </refsect1>
147 </refentry>