| 1 |
<!-- |
| 2 |
doc/src/sgml/ref/drop_operator.sgml |
| 3 |
PostgreSQL documentation |
| 4 |
--> |
| 5 |
|
| 6 |
<refentry id="sql-dropoperator"> |
| 7 |
<indexterm zone="sql-dropoperator"> |
| 8 |
<primary>DROP OPERATOR</primary> |
| 9 |
</indexterm> |
| 10 |
|
| 11 |
<refmeta> |
| 12 |
<refentrytitle>DROP OPERATOR</refentrytitle> |
| 13 |
<manvolnum>7</manvolnum> |
| 14 |
<refmiscinfo>SQL - Language Statements</refmiscinfo> |
| 15 |
</refmeta> |
| 16 |
|
| 17 |
<refnamediv> |
| 18 |
<refname>DROP OPERATOR</refname> |
| 19 |
<refpurpose>remove an operator</refpurpose> |
| 20 |
</refnamediv> |
| 21 |
|
| 22 |
<refsynopsisdiv> |
| 23 |
<synopsis> |
| 24 |
DROP OPERATOR [ IF EXISTS ] <replaceable class="parameter">name</replaceable> ( { <replaceable class="parameter">left_type</replaceable> | NONE } , <replaceable class="parameter">right_type</replaceable> ) [, ...] [ CASCADE | RESTRICT ] |
| 25 |
</synopsis> |
| 26 |
</refsynopsisdiv> |
| 27 |
|
| 28 |
<refsect1> |
| 29 |
<title>Description</title> |
| 30 |
|
| 31 |
<para> |
| 32 |
<command>DROP OPERATOR</command> drops an existing operator from |
| 33 |
the database system. To execute this command you must be the owner |
| 34 |
of the operator. |
| 35 |
</para> |
| 36 |
</refsect1> |
| 37 |
|
| 38 |
<refsect1> |
| 39 |
<title>Parameters</title> |
| 40 |
|
| 41 |
<variablelist> |
| 42 |
|
| 43 |
<varlistentry> |
| 44 |
<term><literal>IF EXISTS</literal></term> |
| 45 |
<listitem> |
| 46 |
<para> |
| 47 |
Do not throw an error if the operator does not exist. A notice is issued |
| 48 |
in this case. |
| 49 |
</para> |
| 50 |
</listitem> |
| 51 |
</varlistentry> |
| 52 |
|
| 53 |
<varlistentry> |
| 54 |
<term><replaceable class="parameter">name</replaceable></term> |
| 55 |
<listitem> |
| 56 |
<para> |
| 57 |
The name (optionally schema-qualified) of an existing operator. |
| 58 |
</para> |
| 59 |
</listitem> |
| 60 |
</varlistentry> |
| 61 |
|
| 62 |
<varlistentry> |
| 63 |
<term><replaceable class="parameter">left_type</replaceable></term> |
| 64 |
<listitem> |
| 65 |
<para> |
| 66 |
The data type of the operator's left operand; write |
| 67 |
<literal>NONE</literal> if the operator has no left operand. |
| 68 |
</para> |
| 69 |
</listitem> |
| 70 |
</varlistentry> |
| 71 |
|
| 72 |
<varlistentry> |
| 73 |
<term><replaceable class="parameter">right_type</replaceable></term> |
| 74 |
<listitem> |
| 75 |
<para> |
| 76 |
The data type of the operator's right operand. |
| 77 |
</para> |
| 78 |
</listitem> |
| 79 |
</varlistentry> |
| 80 |
|
| 81 |
<varlistentry> |
| 82 |
<term><literal>CASCADE</literal></term> |
| 83 |
<listitem> |
| 84 |
<para> |
| 85 |
Automatically drop objects that depend on the operator (such as views |
| 86 |
using it), and in turn all objects that depend on those objects |
| 87 |
(see <xref linkend="ddl-depend"/>). |
| 88 |
</para> |
| 89 |
</listitem> |
| 90 |
</varlistentry> |
| 91 |
|
| 92 |
<varlistentry> |
| 93 |
<term><literal>RESTRICT</literal></term> |
| 94 |
<listitem> |
| 95 |
<para> |
| 96 |
Refuse to drop the operator if any objects depend on it. This |
| 97 |
is the default. |
| 98 |
</para> |
| 99 |
</listitem> |
| 100 |
</varlistentry> |
| 101 |
</variablelist> |
| 102 |
</refsect1> |
| 103 |
|
| 104 |
<refsect1> |
| 105 |
<title>Examples</title> |
| 106 |
|
| 107 |
<para> |
| 108 |
Remove the power operator <literal>a^b</literal> for type <type>integer</type>: |
| 109 |
<programlisting> |
| 110 |
DROP OPERATOR ^ (integer, integer); |
| 111 |
</programlisting> |
| 112 |
</para> |
| 113 |
|
| 114 |
<para> |
| 115 |
Remove the bitwise-complement prefix operator |
| 116 |
<literal>~b</literal> for type <type>bit</type>: |
| 117 |
<programlisting> |
| 118 |
DROP OPERATOR ~ (none, bit); |
| 119 |
</programlisting> |
| 120 |
</para> |
| 121 |
|
| 122 |
<para> |
| 123 |
Remove multiple operators in one command: |
| 124 |
<programlisting> |
| 125 |
DROP OPERATOR ~ (none, bit), ^ (integer, integer); |
| 126 |
</programlisting></para> |
| 127 |
</refsect1> |
| 128 |
|
| 129 |
<refsect1> |
| 130 |
<title>Compatibility</title> |
| 131 |
|
| 132 |
<para> |
| 133 |
There is no <command>DROP OPERATOR</command> statement in the SQL standard. |
| 134 |
</para> |
| 135 |
</refsect1> |
| 136 |
|
| 137 |
<refsect1> |
| 138 |
<title>See Also</title> |
| 139 |
|
| 140 |
<simplelist type="inline"> |
| 141 |
<member><xref linkend="sql-createoperator"/></member> |
| 142 |
<member><xref linkend="sql-alteroperator"/></member> |
| 143 |
</simplelist> |
| 144 |
</refsect1> |
| 145 |
|
| 146 |
</refentry> |