pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Preserve firing-on state when cloning row triggers to partitions
Date: Fri, 16 Jul 2021 17:03:15 +0000
Message-ID: <E1m4RF5-0007io-85@gemulon.postgresql.org> (raw)

Preserve firing-on state when cloning row triggers to partitions

When triggers are cloned from partitioned tables to their partitions,
the 'tgenabled' flag (origin/replica/always/disable) was not propagated.
Make it so that the flag on the trigger on partition is initially set to
the same value as on the partitioned table.

Add a test case to verify the behavior.

Backpatch to 11, where this appeared in commit 86f575948c77.

Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reported-by: Justin Pryzby <pryzby@telsasoft.com>
Discussion: https://postgr.es/m/20200930223450.GA14848@telsasoft.com

Branch
------
REL_13_STABLE

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

Modified Files
--------------
src/backend/commands/tablecmds.c       |  8 ++---
src/backend/commands/trigger.c         | 30 ++++++++++++++----
src/include/commands/trigger.h         |  5 +++
src/test/regress/expected/triggers.out | 56 ++++++++++++++++++++++++++++++++++
src/test/regress/sql/triggers.sql      | 32 +++++++++++++++++++
5 files changed, 121 insertions(+), 10 deletions(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1m4RF5-0007io-85@gemulon.postgresql.org>
Permalink:  ../E1m4RF5-0007io-85@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1m4RF5-0007io-85@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Preserve firing-on state when cloning row triggers to partitions
  In-Reply-To: <E1m4RF5-0007io-85@gemulon.postgresql.org>
  References: <E1m4RF5-0007io-85@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox