model-writtenrun 7652 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Heikki Linnakangas proposed converting and validating COPY FROM input before splitting it into lines, both to reduce per-line overhead and prepare for future parallel parsing; his initial series added string verifiers, direct EUC_TW/Big5 conversion, and a noError API returning the number of input bytes consumed #1.
- Heikki supplied a separate exhaustive conversion test suite to verify the direct converters, explaining that eliminating the intermediate MULE_INTERNAL representation also improved error messages; he considered the suite too large to include in the source tree #3.
- John Naylor questioned compatibility with custom conversion functions, and Heikki proposed rejecting such installations in pg_upgrade with instructions to drop and recreate their conversions, rather than preserving the old function signature #4 #5 #6.
- John reviewed the prerequisites, measured faster EUC_TW/Big5 conversions, and caught incorrect byte constants in the auxiliary test suite #7; Heikki's subsequent benchmarks showed that the proposed extra UTF-8 optimization often hurt GCC performance, so he dropped it and left more ambitious verification optimizations for future work #8.
- Heikki committed the string-verifier prerequisite as b80e10638e and the direct converters as 6c5576075b, both drawn from #1 with light cleanup, then reposted the remaining API and COPY patches with the pg_upgrade check #9 #10.
- Testing the remaining patches, John found that invalid UTF-8-to-EUC_CN input could silently produce COPY 0 and supplied a proposed UtfToLocal fix, while also identifying obsolete comments and buffer-accounting cleanup #11.
- Heikki corrected converted-byte accounting with a different implementation, aligned LocalToUtf with it, added conversion regression tests, and renamed and documented the COPY buffers; he kept fixes separate for review in the expanded series #12.
- Following John's review of the new tests, comments, and buffer sizes, Heikki consolidated the series and reworked COPY's loading and error states, including fixes found through fuzz testing #13 #14; the experimental copycorners tests present in #12 were absent from the replacement series.
- John found one remaining stale CopyReadLine comment, and Heikki also corrected a missing allocation byte responsible for a Windows failure before posting the updated pair #15 #16 #17.
- After a gap, John rebased the pair and benchmarked it, initially finding no standalone improvement on his small input; he clarified that a FreeBSD run had been terminated rather than failed, and Heikki later measured a modest improvement with a larger input #18 #19 #20 #21.
- Heikki landed the two members of #18 as the conversion-API commit ea1b99a661 and the chunked-COPY commit f82de5c46b, with final documentation, diagnostic, catalog-version, and comment cleanup, and announced completion #22.
- After the implementation had landed, Chapman Flack proposed extending the streaming API further with destination-buffer limits, explicit stopping reasons, updated pointers, and converter state to align with ICU and Java interfaces; that broader API proposal remained unanswered at the end of the thread #23.