model-writtenrun 3506 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Jan - Mar 2023 · 4 entries
- Dean Rasheed proposed MERGE RETURNING in January 2023, using one final output list and WITH WHEN CLAUSE to identify the executed branch, with new target values for INSERT/UPDATE and old values for DELETE #1.
- Isaac Morland requested an explicit action type and discussed old/new row access, while Vik Fearing suggested a GROUPING-like function; Dean deferred old/new support and replaced the extra WITH syntax with two context-sensitive support functions #2 #3 #4 #6.
- Alvaro Herrera requested better COPY testing and placing the clause index in the parsed MergeAction, leading to a fuller patch with documentation, tests and procedural-language integration; Dean also identified pre-existing MERGE issues for separate threads #7 #9.
- After several rebases and missing the PostgreSQL 16 development window, Dean resumed the work for PostgreSQL 17 with RETURNING deparsing and rule tests #10 #11 #12 #13.
Jul - Aug 2023 · 3 entries
- Gurjeet Singh's testing and review identified the inability to use support functions in subqueries as a serious limitation, prompting planner parameterization and an experimental implementation using saved global action state #14 #19.
- Jeff Davis questioned functions callable outside their meaningful context, and Gurjeet explored a special table-reference alternative; Dean instead restored parse-time restrictions and executor context passing while retaining subquery support #34 #36 #37 #40.
- Further review tightened impossible-state errors and planner handling, added SELECT-policy enforcement for inserted rows returned by MERGE, and fixed an uninitialized-variable warning #41 #42 #43.
Oct - Nov 2023 · 4 entries
- Jeff renewed his concerns about special function handling and Merlin Moncure questioned clause numbers, leading Dean to implement an alternative with per-action RETURNING lists, matching output types and separate projections #44 #45 #46.
- The per-action experiment exposed grammar complexity and repetitive output lists, while allowing only some actions to return rows risked misleading row counts; subsequent discussion favored one list and a dedicated expression rather than ordinary functions #46 #49 #50.
- Dean returned to the single-list branch and introduced MERGING(ACTION), MERGING(CLAUSE_NUMBER) and a MergingFunc node with executor and JIT support; Merlin's named-clause suggestion remained unimplemented, and a pre-existing cross-partition issue was handled separately before rebasing #53 #55 #56.
- Jian He's testing uncovered unclear privilege documentation and missing glossary coverage, so Dean prepared a separate documentation change, accepted Jian's wording correction and committed 4bc8f29088, leaving the feature patch applicable unchanged #57 #58 #59 #60.
Jan - Mar 2024 · 10 entries
- In January 2024, Jian found that the raw parse-tree walker omitted the new RETURNING list, leading to a recursive-reference regression test, corrected syntax-error reporting and documentation improvements #61 #62.
- Jian's next review prompted Dean to remove a redundant action-state reset and use explicit CMD_MERGE checks, after which Jian reported finding no further issues #63 #64 #65.
- Dean rebased over MERGE support for views and added view tests, while Jeff reopened the language-design question after the developers meeting had reached no conclusion #66 #67 #68.
- Peter Eisentraut proposed a zero-argument MERGE_ACTION() expression, Merlin again opposed numeric clause identifiers, and Wolfgang Walther argued for selective per-action results; Dean settled on one RETURNING list, MERGE_ACTION(), a dedicated node and no clause-number facility #69 #71 #72 #73.
- Jian's question about WITH RECURSIVE led Dean to document its existing prohibition and notice missing ROW and multi-column subquery syntax, producing the separate documentation commit 97d4262683 from his inline proposal #74 #75 #76.
- The next feature revision incorporated clearer output documentation and more readable test setup, while Alvaro explained that the WITH RECURSIVE restriction had originally reflected insufficient testing rather than a known fundamental obstacle #76 #78.
- Jian's final review found a missing PL/pgSQL FOR-loop documentation update, which Dean included; translation maintenance and unrelated trigger or variable-substitution documentation were left to separate work #77 #79.
- Dean proposed committing the settled design, and Jeff endorsed it after noting that MERGE_ACTION's keyword classification prevents an unquoted user-defined function with that name #80 #81.
- Dean committed the final feature as c649fa24a4, reproducing the submitted files from #79 exactly and adding only a catalog-version bump, then announced completion in #82.
- At the thread's close, MERGE RETURNING and both documentation fixes had landed, while old/new row access remained separate work and clause numbers, named clauses and per-action RETURNING were outside the committed feature #70 #73 #82.