历史版本。 PostgreSQL 6.4 已结束支持。 请参阅 当前版本手册.
DROP OPERATOR
DROP OPERATOR — 从数据库中移除一个操作符
大纲
DROP OPERATORid(type| NONE [,...] )
输入
-
id 现有操作符的标识符。
-
type 函数参数的类型。
输出
- →
DROP 命令成功时返回的消息。
- →
ERROR: RemoveOperator: binary operator 'id' taking 'type1' and 'type2' does not exist 如果指定的二元操作符不存在,就会出现这条消息。
- →
ERROR: RemoveOperator: left unary operator 'id' taking 'type' does not exist 如果指定的左一元操作符不存在,就会出现这条消息。
- →
ERROR: RemoveOperator: right unary operator 'id' taking 'type' does not exist 如果指定的右一元操作符不存在,就会出现这条消息。
描述
DROP OPERATOR 语句从数据库中删除一个现有的操作符。要执行此命令,你必须是该操作符的所有者。
左一元或右一元操作符的左类型或右类型可以相应地指定为 NONE。
注意
DROP OPERATOR 语句是一种
Postgres
语言扩展。
关于如何创建操作符的信息,参见
CREATE OPERATOR。
删除任何依赖被删操作符的访问方法和操作符类是用户的责任。
用法
移除 int4 的幂操作符 a^n:
DROP OPERATOR ^ (int4, int4);
移除布尔值的左一元操作符 !a:
DROP OPERATOR ! (none, bool);
移除 int4 的右一元阶乘操作符 a!:
DROP OPERATOR ! (int4, none);
兼容性
SQL92
SQL92 中没有
DROP OPERATOR。