model-writtenrun 9608 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Matthias Otterbach reported that fetching large BYTEA values through JDBC exhausted server memory on PostgreSQL 11.2 while the same workload succeeded on PostgreSQL 10.7 #1.
- Tom Lane initially could not reproduce the leak using libpq, but after Matthias supplied a complete Java reproducer, Jeff Janes reproduced it and identified JDBC's repeated implicit-cursor fetches as the distinguishing behavior #2 #5 #6.
- Jeff traced the regression to an earlier change that reused printtup's output buffer and confirmed that text values also triggered the leak; Tom identified missing buffer cleanup in printtup_shutdown() #8 #10.
- Tom posted a patch initializing the buffer pointer and explicitly freeing it during shutdown, then committed it with light organizational and comment changes as f2004f19ed, with a backport to PostgreSQL 11 #11.
- After the commit, Andres Freund independently described the same cleanup and questioned broader receiver memory-lifetime assumptions; Tom announced completion and apologized for omitting credit for Jeff's diagnosis #12 #13.
- Tom explained that the leak accumulated in ExecutorState across repeated ExecutorRun calls, and Andres withdrew his separate MessageContext concern while noting that the existing receiver interface made better lifetime isolation difficult; no further patch was proposed #14 #15.
- Matthias rebuilt the PostgreSQL 11 branch and confirmed that the memory issue no longer reproduced, closing the thread with the fix landed and tested #16.