pgsql: Fix cloning of row triggers to sub-partitions - Mailing list pgsql-committers

From Alvaro Herrera
Subject pgsql: Fix cloning of row triggers to sub-partitions
Date
Msg-id E1in6oG-000540-38@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix cloning of row triggers to sub-partitions

When row triggers exist in partitioned partitions that are not either
part of FKs or deferred unique constraints, they are not correctly
cloned to their partitions.  That's because they are marked "internal",
and those are purposefully skipped when doing the clone triggers dance.
Fix by relaxing the condition on which internal triggers are skipped.

Amit Langote initially diagnosed the problem and proposed a fix, but I
used a different approach.

Reported-by: Petr Fedorov
Discussion: https://postgr.es/m/6b3f0646-ba8c-b3a9-c62d-1c6651a1920f@phystech.edu

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d732148398a6e406170383ab21960ac373cd1316

Modified Files
--------------
src/backend/commands/tablecmds.c       | 65 ++++++++++++++++++++++++++++++++--
src/test/regress/expected/triggers.out | 36 ++++++++++++-------
src/test/regress/sql/triggers.sql      |  4 +++
3 files changed, 90 insertions(+), 15 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Add basic TAP tests for psql's tab-completion logic.
Next
From: Peter Geoghegan
Date:
Subject: pgsql: Correct _bt_delitems_vacuum() lock comments.