]> granicus.if.org Git - postgresql/blobdiff - doc/src/sgml/ref/drop_operator.sgml
Make the SQL command synopses appear less random.
[postgresql] / doc / src / sgml / ref / drop_operator.sgml
index 375cd0e596708fc26a29b70a404643b742450c4a..cb75b4e0896ee273e42678b1688cf977ecf0bd06 100644 (file)
 <!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_operator.sgml,v 1.10 2001/05/08 17:51:30 momjian Exp $
-Postgres documentation
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_operator.sgml,v 1.22 2003/09/22 00:16:58 petere Exp $
+PostgreSQL documentation
 -->
 
 <refentry id="SQL-DROPOPERATOR">
  <refmeta>
-  <refentrytitle id="SQL-DROPOPERATOR-TITLE">
-   DROP OPERATOR
-  </refentrytitle>
+  <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>
+  <refname>DROP OPERATOR</refname>
+  <refpurpose>remove an operator</refpurpose>
  </refnamediv>
   
+ <indexterm zone="sql-dropoperator">
+  <primary>DROP OPERATOR</primary>
+ </indexterm>
+
  <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">lefttype</replaceable>' and '<replaceable class="PARAMETER">righttype</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">lefttype</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">righttype</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>
+<synopsis>
+DROP OPERATOR <replaceable class="PARAMETER">name</replaceable> ( <replaceable class="PARAMETER">lefttype</replaceable> | NONE , <replaceable class="PARAMETER">righttype</replaceable> | NONE ) [ CASCADE | RESTRICT ]
+</synopsis>
  </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>
+ <refsect1>
+  <title>Description</title>
+
   <para>
-   The left or right type of a left or right unary
-   operator, respectively, must be specified as <literal>NONE</literal>.
+   <command>DROP OPERATOR</command> drops an existing operator from
+   the database system.  To execute this command you must be the owner
+   of the operator.
   </para>
+ </refsect1>
+  
+ <refsect1>
+  <title>Parameters</title>
+
+  <variablelist>
+   <varlistentry>
+    <term><replaceable class="parameter">name</replaceable></term>
+    <listitem>
+     <para>
+      The name (optionally schema-qualified) of an existing operator.
+     </para>
+    </listitem>
+   </varlistentry>
+
+   <varlistentry>
+    <term><replaceable class="parameter">lefttype</replaceable></term>
+    <listitem>
+     <para>
+      The data type of the operator's left operand; write
+      <literal>NONE</literal> if the operator has no left operand.
+     </para>
+    </listitem>
+   </varlistentry>
+
+   <varlistentry>
+    <term><replaceable class="parameter">righttype</replaceable></term>
+    <listitem>
+     <para>
+      The data type of the operator's right operand; write
+      <literal>NONE</literal> if the operator has no right operand.
+     </para>
+    </listitem>
+   </varlistentry>
+
+   <varlistentry>
+    <term><literal>CASCADE</literal></term>
+    <listitem>
+     <para>
+      Automatically drop objects that depend on the operator.
+     </para>
+    </listitem>
+   </varlistentry>
 
-  <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>
+   <varlistentry>
+    <term><literal>RESTRICT</literal></term>
+    <listitem>
+     <para>
+      Refuse to drop the operator if any objects depend on it.  This
+      is the default.
+     </para>
+    </listitem>
+   </varlistentry>
+  </variablelist>
  </refsect1>
 
- <refsect1 id="R1-SQL-DROPOPERATOR-2">
-  <title>
-   Usage
-  </title>
-  <para>
-   Remove power operator <literal>a^n</literal> for <literal>int4</literal>:
+ <refsect1>
+  <title>Examples</title>
 
-   <programlisting>
-DROP OPERATOR ^ (int4, int4);
-   </programlisting>
+  <para>
+   Remove the power operator <literal>a^b</literal> for type <type>integer</type>:
+<programlisting>
+DROP OPERATOR ^ (integer, integer);
+</programlisting>
   </para>
+
   <para>
-   Remove left unary negation operator (<literal>! b</literal>) for booleans:
-   <programlisting>
-DROP OPERATOR ! (none, bool);
-   </programlisting>
+   Remove the left unary bitwise complement operator
+   <literal>~b</literal> for type <type>bit</type>:
+<programlisting>
+DROP OPERATOR ~ (none, bit);
+</programlisting>
   </para>
+
   <para>
-   Remove right unary factorial operator (<literal>i !</literal>) for
-   <literal>int4</literal>:
-   <programlisting>
-DROP OPERATOR ! (int4, none);
-   </programlisting>
+   Remove the right unary factorial operator <literal>x!</literal>
+   for type <type>integer</type>:
+<programlisting>
+DROP OPERATOR ! (integer, 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>
+  <title>Compatibility</title>
+
+  <para>
+   There is no <command>DROP OPERATOR</command> statement in the SQL standard.
+  </para>
  </refsect1>
+
+ <refsect1>
+  <title>See Also</title>
+
+  <simplelist type="inline">
+   <member><xref linkend="sql-createoperator" endterm="sql-createoperator-title"></member>
+  </simplelist>
+ </refsect1>
+
 </refentry>
 
 <!-- Keep this comment at the end of the file