<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_operator.sgml,v 1.9 2000/12/25 23:15:26 petere Exp $
Postgres documentation
-->

<refentry id="SQL-DROPOPERATOR">
 <refmeta>
  <refentrytitle id="SQL-DROPOPERATOR-TITLE">
   DROP OPERATOR
  </refentrytitle>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>
 <refnamediv>
  <refname>
   DROP OPERATOR
  </refname>
  <refpurpose>
   Removes an operator from the database
  </refpurpose>
 </refnamediv>
  
 <refsynopsisdiv>
  <refsynopsisdivinfo>
   <date>1999-07-20</date>
  </refsynopsisdivinfo>
  <synopsis>
DROP OPERATOR <replaceable class="PARAMETER">id</replaceable> ( <replaceable class="PARAMETER">lefttype</replaceable> | NONE , <replaceable class="PARAMETER">righttype</replaceable> | NONE )
  </synopsis>
  
  <refsect2 id="R2-SQL-DROPOPERATOR-1">
   <refsect2info>
    <date>1998-09-22</date>
   </refsect2info>
   <title>
    Inputs
   </title>
   <para>
    <variablelist>
     <varlistentry>
      <term><replaceable class="parameter">id</replaceable></term>
      <listitem>
       <para>
	The identifier of an existing operator.
       </para>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term><replaceable class="parameter">lefttype</replaceable></term>
      <listitem>
       <para>
	The type of the operator's left argument; write <literal>NONE</literal> if the
	operator has no left argument.
       </para>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term><replaceable class="parameter">righttype</replaceable></term>
      <listitem>
       <para>
	The type of the operator's right argument; write <literal>NONE</literal> if the
	operator has no right argument.
       </para>
      </listitem>
     </varlistentry>
    </variablelist>
   </para>
  </refsect2>

  <refsect2 id="R2-SQL-DROPOPERATOR-2">
   <refsect2info>
    <date>1998-09-22</date>
   </refsect2info>
   <title>
    Outputs
   </title>
   <para>

    <variablelist>
     <varlistentry>
      <term><computeroutput>
DROP
       </computeroutput></term>
      <listitem>
       <para>
	The message returned if the command is successful.
       </para>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term><computeroutput>
ERROR:  RemoveOperator: binary operator '<replaceable class="PARAMETER">oper</replaceable>' taking '<replaceable class="PARAMETER">type</replaceable>' and '<replaceable class="PARAMETER">type2</replaceable>' does not exist
       </computeroutput></term>
      <listitem>
       <para>
	This message occurs if the specified binary operator does not exist.
       </para>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term><computeroutput>
ERROR:  RemoveOperator: left unary operator '<replaceable class="PARAMETER">oper</replaceable>' taking '<replaceable class="PARAMETER">type</replaceable>' does not exist
       </computeroutput></term>
      <listitem>
       <para>
	This message occurs if the left unary operator
	specified does not exist.
       </para>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term><computeroutput>
ERROR:  RemoveOperator: right unary operator '<replaceable class="PARAMETER">oper</replaceable>' taking '<replaceable class="PARAMETER">type</replaceable>' does not exist
       </computeroutput></term>
      <listitem>
       <para>
	This message occurs if the right unary operator
	specified does not exist.
       </para>
      </listitem>
     </varlistentry>
    </variablelist>
   </para>
  </refsect2>
 </refsynopsisdiv>

 <refsect1 id="R1-SQL-DROPOPERATOR-1">
  <refsect1info>
   <date>1998-09-22</date>
  </refsect1info>
  <title>
   Description
  </title>
  <para>
   <command>DROP OPERATOR</command> drops an existing operator from the
   database.
   To execute this command you must be the owner of the operator.
  </para>
  <para>
   The left or right type of a left or right unary
   operator, respectively, must be specified as <literal>NONE</literal>.
  </para>

  <refsect2 id="R2-SQL-DROPOPERATOR-3">
   <refsect2info>
    <date>1998-09-22</date>
   </refsect2info>
   <title>
    Notes
   </title>
   <para>
    The <command>DROP OPERATOR</command> statement is a 
    <productname>Postgres</productname>
    language extension.
   </para>
   <para>
    Refer to
    <xref linkend="sql-createoperator" endterm="sql-createoperator-title">
    for information on how to create operators.
   </para>
   <para>
    It is the user's responsibility to remove any access methods and
    operator classes that rely on the deleted operator.
   </para>
  </refsect2>
 </refsect1>

 <refsect1 id="R1-SQL-DROPOPERATOR-2">
  <title>
   Usage
  </title>
  <para>
   Remove power operator <literal>a^n</literal> for <literal>int4</literal>:

   <programlisting>
DROP OPERATOR ^ (int4, int4);
   </programlisting>
  </para>
  <para>
   Remove left unary negation operator (<literal>! b</literal>) for booleans:
   <programlisting>
DROP OPERATOR ! (none, bool);
   </programlisting>
  </para>
  <para>
   Remove right unary factorial operator (<literal>i !</literal>) for
   <literal>int4</literal>:
   <programlisting>
DROP OPERATOR ! (int4, none);
   </programlisting>
  </para>
 </refsect1>
 
 <refsect1 id="R1-SQL-DROPOPERATOR-3">
  <title>
   Compatibility
  </title>

  <refsect2 id="R2-SQL-DROPOPERATOR-4">
   <refsect2info>
    <date>1998-09-22</date>
   </refsect2info>
   <title>
    SQL92
   </title>
   <para>
    There is no <command>DROP OPERATOR</command> in <acronym>SQL92</acronym>.
   </para>
  </refsect2>
 </refsect1>
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:nil
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:"/usr/lib/sgml/catalog"
sgml-local-ecat-files:nil
End:
-->
