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: Fix ALTER TABLE .. ENABLE/DISABLE TRIGGER recursion
Date: Tue, 20 Oct 2020 22:23:50 +0000
Message-ID: <E1kV02o-0004Q7-Nt@gemulon.postgresql.org> (raw)

Fix ALTER TABLE .. ENABLE/DISABLE TRIGGER recursion

More precisely, correctly handle the ONLY flag indicating not to
recurse.  This was implemented in 86f575948c77 by recursing in
trigger.c, but that's the wrong place; use ATSimpleRecursion instead,
which behaves properly.  However, because legacy inheritance has never
recursed in that situation, make sure to do that only for new-style
partitioning.

I noticed this problem while testing a fix for another bug in the
vicinity.

This has been wrong all along, so backpatch to 11.

Discussion: https://postgr.es/m/20201016235925.GA29829@alvherre.pgsql

Branch
------
REL_11_STABLE

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

Modified Files
--------------
src/backend/commands/tablecmds.c       |  2 ++
src/backend/commands/trigger.c         | 21 -------------
src/test/regress/expected/triggers.out | 56 ++++++++++++++++++++++++++++++++++
src/test/regress/sql/triggers.sql      | 35 +++++++++++++++++++++
4 files changed, 93 insertions(+), 21 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1kV02o-0004Q7-Nt@gemulon.postgresql.org>
Permalink:  ../E1kV02o-0004Q7-Nt@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kV02o-0004Q7-Nt@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: Fix ALTER TABLE .. ENABLE/DISABLE TRIGGER recursion
  In-Reply-To: <E1kV02o-0004Q7-Nt@gemulon.postgresql.org>
  References: <E1kV02o-0004Q7-Nt@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