model-writtenrun 8596 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Justin Pryzby reported that detaching a partition left cloned triggers dependent on the former parent and prevented reattachment, posting an initial patch that tried to preserve the triggers as independent objects #1.
- Alvaro Herrera outlined preservation versus deletion #2, while Tom Lane argued that preservation and merging would require unwanted inheritance bookkeeping and that triggers lacked indexes' recreation-cost justification #4 #6 #8; Amit Langote likewise identified trigger-equivalence checking as added complexity #7.
- Justin adopted deletion on detach, documented that behavior, added regression tests, and proposed showing inherited status in psql because these triggers would now disappear on detach #9, then corrected an overly broad dependency-deletion path #10.
- Alvaro accepted the simpler deletion policy but questioned recursion into subpartitions and suggested identifying the ancestor table in psql #11; Justin implemented recursive deletion through performDeletion, expanded tests, and added the table label #14.
- Justin explained that preserving triggers would actually suit one of his applications better without requesting a policy reversal #12, and Alvaro suggested a separate local trigger that becomes active when the table is detached #13.
- Amit found that the partition root need not be the trigger's defining ancestor, supplied a corrected ancestor query and server-version check, and proposed a TABLE/TRIGGER display format #15; Justin incorporated the query corrections and separated the backpatchable backend fix from the psql enhancement #16.
- Alvaro revised Justin's backend patch to remove only the relevant partition dependencies and batch trigger deletions in a helper function #17, then proposed identifying cloned triggers solely through tgparentid #18.
- Alvaro supplied additional CREATE TABLE and ALTER TABLE documentation #19, and Justin requested consistent cloning terminology and a missing article #20.
- The backend fix landed as afccd76f1c from #17 with the simplified tgparentid guard, and the supplementary documentation landed as 8803506c41 from #19 with Justin's wording corrections; both changes were backpatched through PostgreSQL 11.
- The psql component of #16 landed as c33869cc3b with same-table suppression, older-server NULL handling, catalog qualification, and a regclass cast; Alvaro retained the ON TABLE suffix and explained that choice in #21, while backpatching the display enhancement was deferred because older servers lack tgparentid.
- After all three commits, Justin posted formatting and quoting follow-ups plus an alternative TABLE/TRIGGER implementation using the ancestor's trigger definition #22; the thread ends with those follow-ups unresolved and no subsequent landing shown.