model-writtenrun 3172 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Anthonin Bonnefoy reported that utility statements inside functions lost their query IDs when copied into PlannedStmt, preventing pg_stat_statements from tracking them #1.
- Anthonin's patch copied queryId into the utility PlannedStmt and added a SQL procedure regression test containing two SHOW statements #1.
- Michael Paquier confirmed the bug and requested tests for differently capitalized utility statements and pg_stat_statements.track = 'top', while accepting omission of a track_utility = false check #2.
- Michael planned backpatching through PostgreSQL 16 because that version introduced utility query IDs based on parsed trees, although the underlying bug affected older branches #2.
- The change landed as c145f321b6 from #1, preserving the implementation and expanding the tests as proposed in #2; the supplied record includes backports through PostgreSQL 16 and no outstanding work.