pgsql: Fix ALTER TABLE .. ENABLE/DISABLE TRIGGER recursion

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix ALTER TABLE .. ENABLE/DISABLE TRIGGER recursion
Date: 2020-10-20 22:23:50
Message-ID: E1kV02o-0004Q4-NV@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0e6b6f8c7192c82f62b4bbc0b40e9c6252a67bd1

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2020-10-21 00:24:47 pgsql: Review format of code generated by PerfectHash.pm
Previous Message Peter Eisentraut 2020-10-20 16:17:10 pgsql: Avoid invalid alloc size error in shm_mq