2002-07-30 00:14:11 +02:00
<!--
2010-09-20 22:08:53 +02:00
doc/src/sgml/ref/drop_opclass.sgml
2002-07-30 00:14:11 +02:00
PostgreSQL documentation
-->
2017-10-20 03:16:39 +02:00
<refentry id="sql-dropopclass">
2014-02-24 03:25:35 +01:00
<indexterm zone="sql-dropopclass">
<primary>DROP OPERATOR CLASS</primary>
</indexterm>
2002-07-30 00:14:11 +02:00
<refmeta>
2010-04-03 09:23:02 +02:00
<refentrytitle>DROP OPERATOR CLASS</refentrytitle>
2008-11-14 11:22:48 +01:00
<manvolnum>7</manvolnum>
2002-07-30 00:14:11 +02:00
<refmiscinfo>SQL - Language Statements</refmiscinfo>
</refmeta>
2003-05-04 04:23:16 +02:00
2002-07-30 00:14:11 +02:00
<refnamediv>
2003-05-04 04:23:16 +02:00
<refname>DROP OPERATOR CLASS</refname>
2003-09-22 02:16:58 +02:00
<refpurpose>remove an operator class</refpurpose>
2002-07-30 00:14:11 +02:00
</refnamediv>
2010-11-23 21:27:50 +01:00
2002-07-30 00:14:11 +02:00
<refsynopsisdiv>
2003-05-04 04:23:16 +02:00
<synopsis>
2017-10-09 04:00:57 +02:00
DROP OPERATOR CLASS [ IF EXISTS ] <replaceable class="parameter">name</replaceable> USING <replaceable class="parameter">index_method</replaceable> [ CASCADE | RESTRICT ]
2003-05-04 04:23:16 +02:00
</synopsis>
2002-07-30 00:14:11 +02:00
</refsynopsisdiv>
2003-05-04 04:23:16 +02:00
<refsect1>
<title>Description</title>
2002-07-30 00:14:11 +02:00
<para>
2003-05-04 04:23:16 +02:00
<command>DROP OPERATOR CLASS</command> drops an existing operator class.
2002-07-30 00:14:11 +02:00
To execute this command you must be the owner of the operator class.
</para>
2007-01-23 06:07:18 +01:00
<para>
<command>DROP OPERATOR CLASS</command> does not drop any of the operators
or functions referenced by the class. If there are any indexes depending
on the operator class, you will need to specify
2017-10-09 03:44:17 +02:00
<literal>CASCADE</literal> for the drop to complete.
2007-01-23 06:07:18 +01:00
</para>
2003-05-04 04:23:16 +02:00
</refsect1>
2010-11-23 21:27:50 +01:00
2003-05-04 04:23:16 +02:00
<refsect1>
<title>Parameters</title>
2002-07-30 00:14:11 +02:00
2003-05-04 04:23:16 +02:00
<variablelist>
2006-06-17 00:27:55 +02:00
<varlistentry>
<term><literal>IF EXISTS</literal></term>
<listitem>
<para>
2010-11-23 21:27:50 +01:00
Do not throw an error if the operator class does not exist. A notice is issued
2006-06-17 00:27:55 +02:00
in this case.
</para>
</listitem>
</varlistentry>
2003-05-04 04:23:16 +02:00
<varlistentry>
<term><replaceable class="parameter">name</replaceable></term>
<listitem>
<para>
The name (optionally schema-qualified) of an existing operator class.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">index_method</replaceable></term>
<listitem>
<para>
The name of the index access method the operator class is for.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>CASCADE</literal></term>
<listitem>
<para>
2016-08-13 00:45:18 +02:00
Automatically drop objects that depend on the operator class (such as
indexes), and in turn all objects that depend on those objects
2017-11-23 15:39:47 +01:00
(see <xref linkend="ddl-depend"/>).
2003-05-04 04:23:16 +02:00
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>RESTRICT</literal></term>
<listitem>
<para>
Refuse to drop the operator class if any objects depend on it.
This is the default.
</para>
</listitem>
</varlistentry>
</variablelist>
2002-07-30 00:14:11 +02:00
</refsect1>
2010-11-23 21:27:50 +01:00
2007-01-23 06:07:18 +01:00
<refsect1>
<title>Notes</title>
<para>
2017-10-09 03:44:17 +02:00
<command>DROP OPERATOR CLASS</command> will not drop the operator family
2007-01-23 06:07:18 +01:00
containing the class, even if there is nothing else left in the
family (in particular, in the case where the family was implicitly
2017-10-09 03:44:17 +02:00
created by <command>CREATE OPERATOR CLASS</command>). An empty operator
Update reference documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
2007-02-01 00:26:05 +01:00
family is harmless, but for the sake of tidiness you might wish to
2017-10-09 03:44:17 +02:00
remove the family with <command>DROP OPERATOR FAMILY</command>; or perhaps
better, use <command>DROP OPERATOR FAMILY</command> in the first place.
2007-01-23 06:07:18 +01:00
</para>
</refsect1>
2002-07-30 00:14:11 +02:00
2003-05-04 04:23:16 +02:00
<refsect1>
<title>Examples</title>
2002-07-30 00:14:11 +02:00
<para>
2003-05-04 04:23:16 +02:00
Remove the B-tree operator class <literal>widget_ops</literal>:
2002-07-30 00:14:11 +02:00
2003-05-04 04:23:16 +02:00
<programlisting>
2002-07-30 00:14:11 +02:00
DROP OPERATOR CLASS widget_ops USING btree;
2003-05-04 04:23:16 +02:00
</programlisting>
2002-07-30 00:14:11 +02:00
2003-05-04 04:23:16 +02:00
This command will not succeed if there are any existing indexes
2017-10-09 03:44:17 +02:00
that use the operator class. Add <literal>CASCADE</literal> to drop
2002-07-30 00:14:11 +02:00
such indexes along with the operator class.
</para>
</refsect1>
2010-11-23 21:27:50 +01:00
2003-05-04 04:23:16 +02:00
<refsect1>
<title>Compatibility</title>
<para>
There is no <command>DROP OPERATOR CLASS</command> statement in the
SQL standard.
</para>
2002-07-30 00:14:11 +02:00
</refsect1>
2003-05-04 04:23:16 +02:00
<refsect1>
<title>See Also</title>
<simplelist type="inline">
2017-11-23 15:39:47 +01:00
<member><xref linkend="sql-alteropclass"/></member>
<member><xref linkend="sql-createopclass"/></member>
<member><xref linkend="sql-dropopfamily"/></member>
2003-05-04 04:23:16 +02:00
</simplelist>
</refsect1>
2002-07-30 00:14:11 +02:00
</refentry>