pgsql: Fix oversight in FindTriggerIncompatibleWithInheritance.

Started by Etsuro Fujitaabout 1 year ago1 messagescomitters
Jump to latest
#1Etsuro Fujita
fujita.etsuro@lab.ntt.co.jp

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: /messages/by-id/CAPmGK167mXzwzzmJ_0YZ3EZrbwiCxtM1vogH_8drqsE6PtxRYw@mail.gmail.com
Backpatch-through: 13

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9e63f83a7e7f8211581bfe9e9d05b72695261f4f

Modified Files
--------------
src/backend/commands/trigger.c | 2 ++
src/test/regress/expected/triggers.out | 8 ++++++++
src/test/regress/sql/triggers.sql | 10 ++++++++++
3 files changed, 20 insertions(+)