model-writtenrun 8317 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Joe Conway reported that pg_read_file('/proc/self/status') returned an empty string because stat reported zero bytes, and proposed a StringInfo-based fix with backpatching through PostgreSQL 11 in #1.
- Tom Lane identified missing read-error handling, unsuitable string operations for binary input, signed-comparison risks, and size-limit problems in #2; Joe addressed these and removed stat-based sizing in #3, while his suggestion of a two-argument SQL interface remained outside the patches.
- Tom required explicit zero-length requests to keep returning zero bytes in #4, and Joe incorporated that correction while reducing copying to mitigate a measured performance regression in #5.
- Tom supplied direct reads into StringInfo's growing buffer and fixed a pointer invalidated by reallocation in #6; Joe's testing in #8 found performance back on par with the existing implementation.
- Joe replaced StringInfo with custom allocation logic to retain the exact legacy size limit in #10, but Tom considered the complexity unjustified in #11; subsequent boundary tests in #12 showed the StringInfo version lost only two bytes of capacity.
- Joe explored consuming StringInfo's reserved byte in #14, but Tom rejected violating its length invariant in #15; Joe instead restored Tom's implementation and added a separate EOF probe in #16.
- Tom left the EOF-probe choice to Joe and agreed to backpatching in #17; Joe committed #16 as 96d1f423f9, changing only the oversized-file diagnostic and error code, and confirmed backpatching through PostgreSQL 11 in #18.
- Justin Pryzby reported compiler failures caused by ignoring the EOF probe's fread return value in #19, and Tom supplied an inline condition that checks it while retaining the feof test in #20.
- Joe applied that inline correction as 1d05627fcf, also backpatched through PostgreSQL 11, and confirmed completion in #22, leaving both the main fix and its build correction committed.