diff options
author | Etsuro Fujita <efujita@postgresql.org> | 2025-08-08 17:35:02 +0900 |
---|---|---|
committer | Etsuro Fujita <efujita@postgresql.org> | 2025-08-08 17:35:02 +0900 |
commit | f39a7f32aefcd424bdbe001f08718eaad5170d6b (patch) | |
tree | 62cf4bb693e90d5b63340193f778ef9f97b8dd03 /src/backend/commands/trigger.c | |
parent | 18d2d8ae42af4d3a73b6ae067dead8663f92afb8 (diff) |
Fix oversight in FindTriggerIncompatibleWithInheritance.
This function is called from ATExecAttachPartition/ATExecAddInherit,
which prevent tables with row-level triggers with transition tables from
becoming partitions or inheritance children, to check if there is such a
trigger on the given table, but failed to check if a found trigger is
row-level, causing the caller functions to needlessly prevent a table
with only a statement-level trigger with transition tables from becoming
a partition or inheritance child. Repair.
Oversight in commit 501ed02cf.
Author: Etsuro Fujita <etsuro.fujita@gmail.com>
Discussion: https://postgr.es/m/CAPmGK167mXzwzzmJ_0YZ3EZrbwiCxtM1vogH_8drqsE6PtxRYw%40mail.gmail.com
Backpatch-through: 13
Diffstat (limited to 'src/backend/commands/trigger.c')
-rw-r--r-- | src/backend/commands/trigger.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index 6a266aeed0e..8bb2b35a8b8 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -2348,6 +2348,8 @@ FindTriggerIncompatibleWithInheritance(TriggerDesc *trigdesc) { Trigger *trigger = &trigdesc->triggers[i]; + if (!TRIGGER_FOR_ROW(trigger->tgtype)) + continue; if (trigger->tgoldtable != NULL || trigger->tgnewtable != NULL) return trigger->tgname; } |