Incremental Update: v2 Patch Submitted
Evan Li has responded to Álvaro Herrera's feedback and submitted a v2 patch that follows the suggested direction: replacing the StringInfo usage with a purpose-built file-local struct.
What Changed
- v1 → v2: Instead of merely stack-allocating a
StringInfoData(the minimal fix from v1), the new patch introduces a small file-localCopyBufstructure to hold the three fields (data,len,cursor) used by thecopy_read_data()callback. - Evan confirms he had originally considered this approach but deliberately chose the minimal path for v1. Álvaro's feedback prompted the more architecturally honest refactor.
Assessment
This aligns exactly with the resolution path predicted in the prior analysis. The v2 patch addresses both concerns:
- Performance: Eliminates the unnecessary
makeStringInfo()double-palloc and the orphaned 1024-byte buffer. - Semantic clarity: Removes the misleading use of
StringInfofor state that is never used as a growable string buffer.
No further technical discussion or review has occurred yet beyond this submission.