Preserve firing-on state when cloning row triggers to partitions
Alvaro Herrera <alvherre@alvh.no-ip.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/tablecmds.c | modified | +4 −4 |
| src/backend/commands/trigger.c | modified | +24 −6 |
| src/include/commands/trigger.h | modified | +5 −0 |
| src/test/regress/expected/triggers.out | modified | +56 −0 |
| src/test/regress/sql/triggers.sql | modified | +32 −0 |
Discussion
- CREATE TABLE .. PARTITION OF fails to preserve tgenabled for inherited row triggers 24 messages · 2020-09-30 → 2021-07-17