2002-07-30 00:14:11 +02:00
<!--
2010-04-03 09:23:02 +02:00
$PostgreSQL: pgsql/doc/src/sgml/ref/drop_opclass.sgml,v 1.14 2010/04/03 07:23:00 petere Exp $
2002-07-30 00:14:11 +02:00
PostgreSQL documentation
-->
<refentry id="SQL-DROPOPCLASS">
<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>
2003-08-31 19:32:24 +02:00
<indexterm zone="sql-dropopclass">
<primary>DROP OPERATOR CLASS</primary>
</indexterm>
2002-07-30 00:14:11 +02:00
<refsynopsisdiv>
2003-05-04 04:23:16 +02:00
<synopsis>
2006-06-17 00:27:55 +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
<literal>CASCADE</> for the drop to complete.
</para>
2003-05-04 04:23:16 +02:00
</refsect1>
<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>
Do not throw an error if the operator class does not exist. A notice is issued
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>
Automatically drop objects that depend on the operator class.
</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>
2007-01-23 06:07:18 +01:00
<refsect1>
<title>Notes</title>
<para>
<command>DROP OPERATOR CLASS</> will not drop the operator family
containing the class, even if there is nothing else left in the
family (in particular, in the case where the family was implicitly
created by <command>CREATE OPERATOR CLASS</>). 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
2007-01-23 06:07:18 +01:00
remove the family with <command>DROP OPERATOR FAMILY</>; or perhaps
better, use <command>DROP OPERATOR FAMILY</> in the first place.
</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
2002-07-30 00:14:11 +02:00
that use the operator class. Add <literal>CASCADE</> to drop
such indexes along with the operator class.
</para>
</refsect1>
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">
2010-04-03 09:23:02 +02: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>