Fix ALTER TABLE .. ENABLE/DISABLE TRIGGER recursion
Alvaro Herrera <alvherre@alvh.no-ip.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/tablecmds.c | modified | +2 −0 |
| src/backend/commands/trigger.c | modified | +0 −21 |
| src/test/regress/expected/triggers.out | modified | +56 −0 |
| src/test/regress/sql/triggers.sql | modified | +35 −0 |
Discussion
- CREATE TABLE .. PARTITION OF fails to preserve tgenabled for inherited row triggers 24 messages · 2020-09-30 → 2021-07-17