NAME
DROP TRIGGER - 删除一个触发器定义
SYNOPSIS
DROP TRIGGER name ON table [ CASCADE | RESTRICT ]
DESCRIPTION 描述
DROP TRIGGER 将删除所有对一个现存触发器的引用。 要执行这个命令,当前用户必须是触发器的所有者。
PARAMETERS 参数
- name
要删除的触发器名。- table
触发器定义所在的表的名称(可以有模式修饰)。- CASCADE
自动删除依赖此触发器的对象。- RESTRICT
如果有任何依赖对象存在,那么拒绝删除。这个是缺省。
EXAMPLES 例子
删除表films的if_dist_exists触发器:
DROP TRIGGER if_dist_exists ON films;
COMPATIBILITY 兼容性
PostgreSQL 里的 DROP TRIGGER 语句和 SQL 标准不兼容。在 SQL 标准里,触发器名字不是表所局部拥有的,所以命令只是简单的 DROP TRIGGER name。
SEE ALSO 参见
CREATE TRIGGER [create_trigger(7)]
#p#
NAME
DROP TRIGGER - remove a trigger
SYNOPSIS
DROP TRIGGER name ON table [ CASCADE | RESTRICT ]
DESCRIPTION
DROP TRIGGER will remove an existing trigger definition. To execute this command, the current user must be the owner of the table for which the trigger is defined.
PARAMETERS
- name
- The name of the trigger to remove.
- table
- The name (optionally schema-qualified) of a table for which the trigger is defined.
- CASCADE
- Automatically drop objects that depend on the trigger.
- RESTRICT
- Refuse to drop the trigger if any objects depend on it. This is the default.
EXAMPLES
Destroy the trigger if_dist_exists on the table films:
DROP TRIGGER if_dist_exists ON films;
COMPATIBILITY
The DROP TRIGGER statement in PostgreSQL is incompatible with the SQL standard. In the SQL standard, trigger names are not local to tables, so the command is simply DROP TRIGGER name.
SEE ALSO
CREATE TRIGGER [create_trigger(7)]