DROP OPERATOR

An SQL command for removing an operator

DROP OPERATOR is a DDL command for removing an operator.

DROP OPERATOR has always been present in PostgreSQL.

Usage

In contrast to CREATE OPERATOR, DROP OPERATOR does not accept named arguments; the data types of the left and right operand are provided as is (substitute NONE for the left operand if the operator does not have one).

Multiple operators can be dropped at the same time.

Change history

Examples

Example usage of DROP OPERATOR:

postgres=# DROP OPERATOR +@+ (
             numeric,
             numeric);
DROP OPERATOR

Attempting to drop a non-existent operator:

postgres=# DROP OPERATOR @@@ (NONE, int);
ERROR:  operator does not exist: @@@ integer

Categories

DDL, Operators, SQL command

See also

CREATE OPERATOR, ALTER OPERATOR, DROP OPERATOR CLASS, DROP OPERATOR FAMILY