model-writtenrun 6842 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Gaurav Singh reported that cursor cleanup at a different nesting level could make pg_stat_statements store duplicate, unnormalized query text, including when auto_explain supplied instrumentation, in #1.
- Sami Imseih proposed saving an extension-supplied nesting level in QueryDesc in #2, but Gaurav explained in #3 that auto_explain and pg_stat_statements count nesting differently, making a shared value dependent on hook order.
- Sami initially rejected core-managed nesting and per-extension slots, instead attaching a shared field restricted to extensions using pg_stat_statements semantics in #4; he added regression coverage and clearer comments in #5, which Gaurav approved in #6.
- After Gaurav requested a backpatch in #8, Michael Paquier rejected changing QueryDesc on stable branches and argued for extension-specific state to prevent conflicts in #9.
- Michael supplied a two-patch rework in #10: a generic QueryDesc extension-state facility followed by the pg_stat_statements fix adapted to store its nesting level privately.
- Sami approved both patches in #11 and demonstrated further problems involving user attribution after SET ROLE, auto_explain sampling changes, and tracking-setting changes; he agreed these could remain follow-up work, and Michael confirmed the infrastructure approach in #12.
- Michael committed the infrastructure portion of #10 with light declaration, function-placement, and comment edits as e5d5d1ad1e, then committed its unchanged pg_stat_statements implementation as 23bf901fa5, announcing both in #13; neither was backpatched because of the QueryDesc ABI changes.
- After the commits, Lukas Fittl questioned whether core should provide a common nesting level in #14; Sami explained the existing semantic differences between extensions in #15, and Michael defended separate per-extension state in #16.
- The submitted series was fully committed, while user attribution and other extension-state improvements remained follow-up work: Sami promised further patches in #17, and Michael acknowledged that plan in the final message #18.