Postgres:禁用触发所有和更新级联

Postgres: DISABLE TRIGGER ALL and ON UPDATE CASCADE

好像当我

ALTER TABLE foo DISABLE TRIGGER ALL;
DELETE FROM foo;

删除不会级联到其他表

FOREIGN KEY ("fooId") REFERENCES "foo"("id") ON DELETE CASCADE

约束,但我在文档中找不到任何关于此的内容。 我也没有看到任何不是我在

中创建的触发器
SELECT * FROM information_schema.triggers;

我猜 ON UPDATE/ON DELETE 是作为触发器在内部实现的(在 pgAdmin 中不可见)?有谁知道这是在哪里记录的?

尝试 here:

DISABLE/ENABLE [ REPLICA | ALWAYS ] TRIGGER
These forms configure the firing of trigger(s) belonging to the table. A disabled trigger is still known to the system, but is not executed when its triggering event occurs. For a deferred trigger, the enable status is checked when the event occurs, not when the trigger function is actually executed. One can disable or enable a single trigger specified by name, or all triggers on the table, or only user triggers (this option excludes internally generated constraint triggers such as those that are used to implement foreign key constraints or deferrable uniqueness and exclusion constraints). Disabling or enabling internally generated constraint triggers requires superuser privileges; it should be done with caution since of course the integrity of the constraint cannot be guaranteed if the triggers are not executed.