model-writtenrun 8848 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane opened the thread with #1, explaining that early generation of subsidiary ALTER TABLE commands caused IF NOT EXISTS side effects and identity-column failures; his initial patch moved identity handling into execution and introduced recursive utility calls.
- Robert Haas objected to the layering of calls from AlterTable back into ProcessUtility in #2 and #4, while Tom Lane argued that parsing against stale catalog state caused the bugs and that a context structure would also prevent inconsistent propagation of execution parameters in #3 and #5.
- Movead.Li tested the initial patch and confirmed the identity example worked but IF NOT EXISTS still created an unwanted sequence in #6; Tom Lane clarified in #7 that the initial attachment established infrastructure and did not yet claim to fix those conditional-execution bugs.
- After Movead.Li examined missing-column handling in #9, Tom Lane explained in #11 that the architectural objection had stalled progress and considered representing generated utility statements as additional ALTER TABLE command types with direct execution calls.
- Returning to the problem in #12, Tom Lane proposed postponing parse analysis until each subcommand executes, eliminating the need for conditional-execution flags; Alvaro Herrera explained the event-ordering requirement for DDL replay in #13, while Tom questioned how replay should distinguish generated commands in #14.
- The replacement patch in #15 implemented per-subcommand transformation during phase 2, retained early ALTER COLUMN TYPE analysis so USING expressions see the original row type, and split execution passes so derived subcommands run later; it retained recursive utility handling and deferred residual identity concerns.
- The updates in #16, #17, and #18 kept that implementation current with upstream changes, with #17 additionally expanding regression coverage for CHECK constraints, index-backed primary keys, and exclusion constraints.
- Sergei Kornilov and Alvaro Herrera commented favorably on the final patch in #19 and #21, and Tom Lane confirmed in #20 and #22 that the restructuring was too risky to backpatch.
- The restructuring landed as 1281a5c907 from #18, with only formatting differences from the attachment.
- In the thread's final message, #23, Tom Lane reconsidered the nonempty-table identity example and concluded that preserving the ADD COLUMN value for existing rows was intentional, while later DEFAULT or GENERATED changes should affect subsequent writes.
- That conclusion became 9b9c5f279e, adding documentation, comments, a regression test, and a storage-kind check cleanup without another attached patch; the main restructuring had landed, and the final discussion sought clarification of existing behavior rather than the previously contemplated behavior change.