3 PostgreSQL documentation
6 <refentry id=
"SQL-DROPOPCLASS">
8 <refentrytitle id=
"SQL-DROPOPCLASS-TITLE">DROP OPERATOR CLASS
</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
14 <refname>DROP OPERATOR CLASS
</refname>
15 <refpurpose>remove an operator class
</refpurpose>
18 <indexterm zone=
"sql-dropopclass">
19 <primary>DROP OPERATOR CLASS
</primary>
24 DROP OPERATOR CLASS [ IF EXISTS ]
<replaceable class=
"PARAMETER">name
</replaceable> USING
<replaceable class=
"PARAMETER">index_method
</replaceable> [ CASCADE | RESTRICT ]
29 <title>Description
</title>
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.
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.
45 <title>Parameters
</title>
50 <term><literal>IF EXISTS
</literal></term>
53 Do not throw an error if the operator class does not exist. A notice is issued
60 <term><replaceable class=
"parameter">name
</replaceable></term>
63 The name (optionally schema-qualified) of an existing operator class.
69 <term><replaceable class=
"parameter">index_method
</replaceable></term>
72 The name of the index access method the operator class is for.
78 <term><literal>CASCADE
</literal></term>
81 Automatically drop objects that depend on the operator class.
87 <term><literal>RESTRICT
</literal></term>
90 Refuse to drop the operator class if any objects depend on it.
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.
113 <title>Examples
</title>
116 Remove the B-tree operator class
<literal>widget_ops
</literal>:
119 DROP OPERATOR CLASS widget_ops USING btree;
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.
129 <title>Compatibility
</title>
132 There is no
<command>DROP OPERATOR CLASS
</command> statement in the
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>