model-writtenrun 6974 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Sami Imseih reported that implicit cursor closure at COMMIT or END misclassified the underlying query as top-level and could separate planning and execution statistics, proposing a transaction-end flag and regression tests in #1; he left the confusing use of utility-statement text for underlying queries as a separate issue.
- Martin Huang found that the flag could misclassify a subsequent SELECT and requested exception-safe nesting restoration in #2; Sami added hook-entry resets, PG_TRY/PG_FINALLY, and a regression test in #3, which Martin approved in #4.
- Michael Paquier questioned whether errors and subsequent portal execution could leave stale state in #5, prompting Sami to add resets in ExecutorStart, ExecutorRun, and ExecutorEnd in #6.
- Michael challenged the static-flag approach and proposed attaching nesting state to a backend structure in #7; Lukas Fittl supported sharing this infrastructure and suggested QueryDesc while highlighting its absence from ProcessUtility in #8.
- Michael favored state with a shorter lifetime than the session but left the utility integration unresolved in #9; at the thread's final message, Sami remained open to core support while questioning how QueryDesc would represent nested execution in #10, so no replacement implementation had yet been attached.
- The later commit 23bf901fa5, credited to Sami and Michael, saves nesting at ExecutorStart in QueryDesc extension state and uses it at ExecutorEnd, but its matching implementation was submitted in #1158955 in thread #254159, replacing the earlier attribution to this thread's discussion.
- The commit 23bf901fa5 also prevents instrumentation requested by another extension from causing unwanted tracking, leaves broader state sharing and auto_explain changes for future work, and explicitly declines backpatching because the solution requires QueryDesc ABI changes.