非互換
FUJITSU Enterprise Postgres 13では、ALTER TABLE ONLY ... ENABLE/DISABLE TRIGGER が子テーブルを再帰的に処理しないように変更しました。
「ONLY」が無視されて、子テーブルまで再帰的に処理されます。
[例]
=# create table parent (a int) partition by list (a); =# create table child1 partition of parent for values in (1); =# create trigger tg after insert on parent -# for each row execute procedure trig_nothing(); =# select tgrelid::regclass, tgname, tgenabled from pg_trigger -# where tgrelid in ('parent'::regclass, 'child1'::regclass) -# order by tgrelid::regclass::text; tgrelid | tgname | tgenabled ---------+--------+----------- child1 | tg | O parent | tg | O (2 row) =# alter table only parent enable always trigger tg; =# select tgrelid::regclass, tgname, tgenabled from pg_trigger -# where tgrelid in ('parent'::regclass, 'child1'::regclass) -# order by tgrelid::regclass::text; tgrelid | tgname | tgenabled ---------+--------+----------- child1 | tg | A parent | tg | A (2 row)
子テーブルを再帰的に処理しません。
[例]
=# create table parent (a int) partition by list (a); =# create table child1 partition of parent for values in (1); =# create trigger tg after insert on parent -# for each row execute procedure trig_nothing(); =# select tgrelid::regclass, tgname, tgenabled from pg_trigger -# where tgrelid in ('parent'::regclass, 'child1'::regclass) -# order by tgrelid::regclass::text; tgrelid | tgname | tgenabled ---------+--------+----------- child1 | tg | O parent | tg | O (2 row) =# alter table only parent enable always trigger tg; =# select tgrelid::regclass, tgname, tgenabled from pg_trigger -# where tgrelid in ('parent'::regclass, 'child1'::regclass) -# order by tgrelid::regclass::text; tgrelid | tgname | tgenabled ---------+--------+----------- child1 | tg | O parent | tg | A (2 rows)
対処方法
必要に応じて、「only」を削除してください。