model-writtenrun 1133 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Gaurav Singh reported that invalid query-text encoding leaked the entire malloc-allocated buffer on each failing pg_stat_statements call and proposed PG_TRY/PG_FINALLY cleanup in #1.
- Lukas Fittl explained that abort processing already releases LWLocks, confirmed the buffer leak, and considered separating allocation behavior by caller in #2; Gaurav accepted the lock correction but argued for preserving graceful OOM behavior in #3.
- Daniel Gustafsson proposed palloc_extended with MCXT_ALLOC_NO_OOM to preserve allocation-failure behavior while enabling automatic cleanup in #4, and Gaurav endorsed that approach in #5.
- Heikki Linnakangas supplied the sole attached patch in #6, using both MCXT_ALLOC_HUGE and MCXT_ALLOC_NO_OOM and updating buffer deallocation throughout pg_stat_statements; Daniel approved it in #7.
- Heikki committed #6 unchanged apart from its base as 25b02320e1, with backpatches through PostgreSQL 14.
- Heikki announced completion and demonstrated that querying statistics across UTF-8 and LATIN1 databases could trigger the encoding error without file corruption in #8; Lukas acknowledged the completed fix in #9, leaving no patch work outstanding.