model-writtenrun 7987 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Takamichi Osumi opened the thread with an implementation of CREATE OR REPLACE TRIGGER for ordinary and constraint triggers, reviving an earlier proposal and asking whether replacement should acquire AccessExclusiveLock instead of ShareRowExclusiveLock #1.
- After a four-month gap, Osumi rebased the patch, and Surafel Temesgen's review prompted style corrections, removal of obsolete code, and a substantial reduction in regression-test size #8 #9 #10.
- Tom Lane argued that ShareRowExclusiveLock was sufficient and that replacement should not unexpectedly require a stronger lock; he also requested clearer catalog interfaces and duplicate-trigger checks and rejected testing unstable psql help output, leading to the next revision #11 #15.
- Michael Paquier identified an obsolete heap_open call that prevented compilation, and Osumi updated it to table_open #16 #17.
- In March 2020, Lane identified missing node-copy and equality support, incorrect internal-trigger lookup, and unresolved partition and pending-event semantics; Osumi added the node support, skipped lookup for internally generated triggers, and expanded partition tests while leaving the harder questions open #19 #20.
- Wolfgang Walther argued that pending trigger events should block replacement just as they block other constraint changes, and Osumi incorporated a deferrable-trigger pending-event check when rebasing after another gap #21 #23.
- Peter Smith's sustained review simplified error handling and test functions, added missing failure cases, improved partition coverage, and expanded the documentation, culminating in a version he marked ready for a committer #24 #25 #26 #29 #32 #33.
- Lane reopened the correctness questions around foreign-key and child-partition triggers, challenged the pending-event check, and requested simpler tuple lookup and replacement code #34.
- Osumi added protection against direct replacement of internal triggers, revised partition tests, removed the inadequate pending-event guard, and changed lookup to use both indexed keys and retain the matching tuple, while reporting difficulties applying CheckTableNotInUse during partition recursion #35 #36.
- Takayuki Tsunakawa proposed excluding PostgreSQL-specific constraint-trigger replacement because ordinary-trigger replacement met the Oracle-migration use case, and Osumi removed that grammar and the associated constraint-catalog machinery #37 #38.
- Smith's next review rounds clarified the grammar-level restriction, added an assertion, and corrected the replacement-combination tests, including supplied test examples; he then reported successful regression and documentation checks #39 #41 #42 #43 #44 #45.
- Dilip Kumar identified redundant test setup and teardown, which Osumi removed in the final attached version #46 #47.
- Tom Lane committed the final submission as 92bf7e2d02, simplifying tuple construction, adding an explicit unsupported-feature error for constraint replacement, completing initialization sites, and revising tests and documentation; the documentation warns that previously made trigger-firing decisions are not reconsidered.
- The thread ends with Lane's confirmation that the patch was pushed, leaving ordinary and partitioned-trigger replacement landed, constraint-trigger replacement excluded, and no further attached work awaiting review #48 92bf7e2d02.