The ability to temporarily enable or disable a trigger is provided by ALTER TABLE, not by ALTER TRIGGER, because ALTER TRIGGER has no convenient way to express the option of enabling or disabling all of a table's triggers at once.
参考:
https://www.postgresql.org/docs/current/static/sql-altertrigger.html
https://www.postgresql.org/docs/current/static/sql-altertable.html
alter table tab_xxx enable trigger [ trigger_name | ALL | USER ]
临时启停触发器

本文介绍了如何使用 PostgreSQL 中的 ALTERTABLE 命令来临时启用或禁用触发器,而不是通过 ALTERTRIGGER 实现这一功能,因为后者缺乏对表内所有触发器进行一次性操作的能力。
804

被折叠的 条评论
为什么被折叠?



