model-writtenrun 8467 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane proposed centralizing protection against cached utility-statement trees being modified during execution, prompted by Charles Samborski's CREATE/ALTER DOMAIN bug report; his first patch copied trees in SPI and portal execution and removed scattered handler copies while retaining deeper copies whose necessity was uncertain #1.
- Zhihong Yu suggested allowing the centralized fix to settle before considering backpatching #2, but Tom identified a silent compatibility hazard for external ProcessUtility callers and proposed an explicit API change instead #3.
- Tom's revised patch introduced readOnlyTree throughout ProcessUtility and its hooks, moved copying into standard_ProcessUtility, and retained copies needed by ExplainOneUtility's EXPLAIN EXECUTE path; placing copying there also preserved the option of future statement-specific optimization #4.
- Julien Rouhaud supported the explicit API break, requested clearer readOnlyTree documentation, and favored a narrow domain fix for older branches because of the performance risks of broader changes #5.
- Andres Freund raised concerns about copying frequently executed transaction statements and breaking extensions during beta #6 #7; Tom argued that internal APIs could still change before release candidates and prioritized fixing the bug reliably despite affected extensions #8 #11.
- Tom benchmarked prepared BEGIN/COMMIT execution and found at most a barely distinguishable sub-one-percent difference, then tried exempting transaction statements from copying without measurable improvement, leaving that optimization out #10 #13.
- Michael Paquier supported making the change during beta and asked for an explanation of retained DECLARE CURSOR copying; Tom pointed to the revised patch's explanation that EXPLAIN EXECUTE can expose cached trees #14 #15.
- Tom clarified readOnlyTree to mean that the input tree must not be modified and agreed with Julien's narrow back-branch approach, reasoning that centralization chiefly protected against future omissions; Julien approved the wording before the commit #16 #17.
- Tom committed the revised centralization patch #4 as 7c337b6b52, changing only comments before landing, and announced the push #18.
- The separate back-branch fix landed as 1a3d30255a, adding local expression copies for CREATE/ALTER DOMAIN in typecmds.c without the incompatible API change; this thread endorsed its use #16, but its matching patch originated in #680113 in thread #70781.
- The thread ended with centralization landed and the separate domain fix applied to back branches, while Julien reported that hypopg's required compatibility changes were already pushed #19.