model-writtenrun 2178 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Kozhemyakin reported that `(values(1)) limit 1` triggers a pg_stat_statements assertion failure in PostgreSQL 18 development builds #1; Dilip Kumar reproduced it and traced the failure to query normalization advancing beyond the recorded query length #2 #4.
- Michael Paquier identified nested-query location tracking as the regression's source #3, and Fujii Masao explained that clauses following parenthesized SELECT statements could either trigger assertions or disappear from the recorded query text #5.
- Michael Paquier proposed reverting nested-query tracking and its follow-up fix because correctly handling every enclosing grammar construct looked too risky during beta, while retaining the independent query-ID support for CREATE TABLE AS and DECLARE #6.
- Anthonin Bonnefoy offered an alternative repair that starts SELECT locations at the outermost opening parenthesis and lets enclosing statements supply lengths, while warning about the revert's effect on pgAudit tests #7; Michael questioned whether the repair covered all grammar contexts #8.
- Michael highlighted missing regression coverage for parenthesized queries and normalization #9, Fujii endorsed reverting and revisiting the feature for PostgreSQL 19 #10, and Michael emphasized the limited time before beta2 #11.
- Anthonin extended his repair with CREATE TABLE AS length handling and regression tests, but left views and JSON_ARRAY untreated because pg_stat_statements could not expose their nested-query boundaries for testing #12.
- Michael suggested correcting COPY's starting position but remained concerned about inconsistent locations and lengths in other parser paths, including extension-visible nodes, and chose the revert because another missed case could cause an out-of-bounds write #13.
- Michael committed the revert from #6 as f85f6ab051, preserving its parser changes while retaining the existing semicolon-separated-query regression tests and expanding the rationale.
- After landing, Michael explained the retained tests and proposed a hook-based test module to inspect parsed-node locations and lengths directly #14; Anthonin agreed that this would overcome pg_stat_statements' testing limitations, leaving the alternative repair uncommitted and broader parser testing as future work #15.