model-writtenrun 6321 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Justin Pryzby reported that creating a partition under a table with a disabled row trigger unexpectedly created an enabled child trigger, and noted that CreateTrigStmt had no enabled-state field #1.
- Alvaro Herrera proposed CreateTriggerFiringOn to propagate the firing state while preserving CreateTrigger's API and ABI for existing callers and backpatching, then added regression coverage #3 #4.
- Testing exposed a separate bug in which ALTER TABLE ONLY still changed child triggers, so Alvaro proposed replacing bespoke trigger recursion with ATSimpleRecursion #4 #5.
- The backpatch discussion exposed broader compatibility questions: Justin supported fixing existing releases, Tom Lane questioned interactions with old catalog contents and pg_dump, and Justin identified that dumps also failed to preserve child trigger states differing from their parents #6 #7 #8 #10.
- Alvaro restricted the recursion fix to declarative partitioning to preserve legacy inheritance behavior, added tests, and committed the revised form of #5 as bbb927b4db, backpatched to PostgreSQL 11 #9 #11.
- Alvaro explained that precreating child triggers would fail during partition attachment and proposed restoring their states with ALTER commands; Justin supplied the first pg_dump patch implementing selection of differently enabled child triggers #12 #13.
- Alvaro's review required suppressing duplicate CREATE TRIGGER statements, supporting releases without tgparentid, and considering multilevel partition states; Justin added a pg_depend lookup but then stepped away, leaving trigger-state restoration and child-trigger comments as outstanding concerns #14 #15.
- After nearly nine months, Alvaro revived both fixes as one series, expanded cloning tests, suppressed duplicate trigger creation in dumps, handled all firing states, and separated the PostgreSQL 11–12 queries from older-server queries; his 10,000-table test found little performance impact #16.
- Zhihong Yu supported backpatching to PostgreSQL 11, while Alvaro revised the negative pg_dump test and again requested opinions on changing established partition-creation behavior #17 #18.
- The cloning component of #18 landed as df80fa2ee5 with only whitespace changes to the implementation and unchanged tests, and the final backpatch decision extended to PostgreSQL 11.
- Justin revisited lost child-trigger comments, but Tom argued that preserving modifications to internal objects was not guaranteed; Justin accepted that possible scope decision and reported a separate psql display failure involving identically named statement triggers on parent and child tables #19 #20 #21.
- The pg_dump component of #18 landed as f0e21f2f61, co-authored by Justin and Alvaro, with additional older-server query fixes, suppression of child-trigger DROP commands, and expanded tests; Alvaro subsequently explained the cleanup-output correction and additional pg_upgrade testing #22.
- By the thread's end, all three fixes had landed, child-trigger comment preservation remained outside them, and the newly reported psql display bug was unresolved: Alvaro suspected incorrect trigger matching, while Justin suggested LIMIT 1 if ancestor ordering could be relied on, otherwise a recursive CTE #23 #24.