DROP OPERATOR

名称

DROP OPERATOR — 从数据库中删除一个操作符

语法

DROP OPERATOR id ( type | NONE [,...] )

输入

id
一个现存的操作符的标识.
type
函数参数的类型.

输出

DROP
命令成功执行的返回函数.
ERROR: RemoveOperator: binary operator 'oper' taking 'type' and 'type2' does not exist
如果声明的二目操作符不存在,返回此信息.
ERROR: RemoveOperator: left unary operator 'oper' taking 'type' does not exist
如果声明的左目操作符不存在,返回此信息.
ERROR: RemoveOperator: right unary operator 'oper' taking 'type' does not exist
如果声明的右目操作符不存在,返回此信息.

描述

DROP OPERATOR 语句从数据库中删除一个现存的操作符.要执行这个命令,你必须是操作符所有者.
 
左目操作符的右类型或右目操作符的左类型可以声明为 NONE.

注意

DROP OPERATOR 语句是 Postgres 语言扩展.

请参考 CREATE OPERATOR 获取如何创建操作符的信息.

删除任何依赖于被删除的操作符的访问模式和操作符表是用户的责任.
 

用法

将用于 int4 的幂操作符 a^n 删除:
DROP OPERATOR ^ (int4, int4);
删除用于布尔变量的左目负号操作符(b !):
DROP OPERATOR ! (none, bool);
删除用于 int4 的右目介乘操作符(! i):
DROP OPERATOR ! (int4, none);

兼容性

SQL92