model-writtenrun 9920 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Dec 2023 - Jan 2024 · 8 entries
- Sutou Kouhei began by extracting COPY TO's text, CSV and binary implementations behind format callbacks, aiming to support formats such as Arrow through extensions without changing existing behavior #1.
- Junwang Zhao reviewed the initial extraction, then expanded it to COPY FROM and proposed a shared handler structure and a new pg_copy_handler catalog #5 #7 #9 #17.
- Michael Paquier argued for separating the two directions, and he and Masahiko Sawada favored SQL handler functions over a new catalog; Sawada demonstrated that alternative using the earlier COPY TO patch and a test extension #11 #18 #19 #32.
- An Arrow prototype exposed practical API requirements, prompting Sutou to add opaque state and exported output helpers; subsequent discussion settled on direction-specific routines, one SQL handler and exposed execution state #44 #56 #59.
- Sutou assembled an eight-patch implementation for both directions, including registration, state access and I/O, but performance concerns led reviewers to concentrate first on the built-in format extraction #62 #63 #68.
- Sawada supplied a delta splitting CSV callbacks from text, and Junwang proposed incompatible-option hooks; Sutou narrowed the main series to two refactoring patches while incorporating review changes #70 #77 #80.
- Junwang separately extended the full earlier series with a JSON exporter, demonstrating that custom formats could require different protocol column metadata; those findings informed an expanded callback proposal #83 #90.
- Michael pushed for a smaller initial interface, so Sutou removed option and protocol hooks from the refactoring series and retained start, row and end callbacks with parsing optimizations #93 #95 #96.
Feb - Apr 2024 · 9 entries
- Michael merged the two refactors and moved routine pointers from format options into execution state, while Sutou proposed storing text/CSV dispatch callbacks directly in that state #107 #109 #112.
- Michael extracted and committed the COPY FROM attribute callback and COPY TO attribute callback from the larger refactor, with local state-dispatch changes; the latter also simplified the CSV output signature #107 95fb5b4902 2889fd23be.
- The remaining refactor added per-type input/output initialization callbacks to centralize memory-context and dropped-column handling, and removed the CSV-specific postprocessing callback #113.
- Andres Freund objected that per-attribute indirect calls duplicated format decisions already made at row level and could obstruct later optimization, leading Michael to revert the COPY TO callback #118 #120 #123 1aa8324b81.
- Michael separately retained the useful CopyAttributeOutCSV signature simplification, removing the single_attr argument and deriving it from COPY state #113 b9d6038d70.
- Andres demonstrated separate text/CSV row callbacks sharing an inline helper with constant arguments, and Sutou supplied corresponding COPY FROM deltas; the redundant COPY FROM attribute callback was then reverted as well #122 #128 #130 #133 06bd311bce.
- A parallel experiment reused FunctionCallInfo structures to reduce per-value initialization, received naming corrections and benchmarking, and remained separate from the main format refactor #132 #136 #138.
- Michael incorporated inline specialization into the main refactor, but conflicting runtime and profiling results left concerns about dispatch overhead unresolved #140 #141 #142 #143.
- To make progress, Sutou proposed retaining the existing built-in paths and dispatching only custom routines, then adopted Michael's early-return cleanup; broader extension support was postponed #145 #146 #147.
Jul - Aug 2024 · 2 entries
- After the long gap, Tomas Vondra requested a complete runnable feature and realistic testing, and Sutou revived a five-part series with built-in conversion, SQL registration and an Arrow extension example #157 #161 #162.
- Benchmarking exposed machine-dependent regressions, leading to a static flushing wrapper and a split between COPY TO and COPY FROM so they could be evaluated independently #165 #166 #168 #169 #173.
Sep - Nov 2024 · 2 entries
- Sawada identified missed compiler inlining, and Sutou switched critical helpers to pg_attribute_always_inline; Sawada then extracted the two built-in refactors, while Alvaro Herrera supplied an accepted header-independence fix #179 #185 #187 #189.
- Sutou restored the complete extension series and added a soft-error helper, while discussion clarified that execution-state definitions should remain outside copyapi.h and extensions needed lower-level input access #191 #193 #202.
2025 · 15 entries
- Sawada supplied an option-processing delta that delayed routine initialization until BeginCopy, and subsequent revisions incorporated it and validated the SQL handler's declared return type before invocation #203 #206 #222.
- Further worst-case COPY TO benchmarking and review established readiness for the two refactors, which Sawada reorganized and polished with Sutou's final comments #212 #223 #226 #227 #228.
- Sawada committed the COPY TO component exactly as attached and the COPY FROM component with only small declaration and comment edits, establishing the built-in callback infrastructure #228 2e4127b6d2 7717f63006.
- The COPY FROM landing immediately broke file_text_array_fdw by hiding NextCopyFromRawFields, prompting agreement to restore a public wrapper around the optimized internal implementation and review of a fix in another thread #231 #232 #233 #234 #235.
- Sutou resent the seven uncommitted extension patches, while Junwang and Coverity identified unnecessary copying of CopyFormatOptions; Sutou's const-pointer fix was forwarded by Sawada and committed unchanged #236 #237 #238 #239 #241 bacbc4863b.
- Sawada requested that built-in formats use SQL handlers too and asked for documentation, which Sutou added and David G. Johnston substantially rewrote #243 #244 #245 #246.
- David demonstrated search_path-dependent interference with FORMAT text, and subsequent revisions added schema-qualified names, regrouped the two directions and expanded invalid-handler tests #247 #248 #251 #253.
- Sawada's JSON Lines extension exercised the API and exposed weak buffering documentation, while Sutou rejected a string-only interface because Arrow and JSON implementations needed efficient direct Datum access #252 #260 #264.
- Further review consolidated tests and removed binary/csv_mode state fields, but registration design remained contentious because SQL handler resolution depended on names and search_path #262 #266 #270.
- Sawada proposed C registration during extension initialization, Michael supported a simpler loading model, and David defended namespaced SQL objects; the eventual revision used backend-local registration and deferred shared monitoring identifiers #271 #272 #278 #294 #296 #298.
- Review of the registration rewrite produced a single API for both directions and removed dynamic registration of built-ins during backend initialization #299 #303 #304.
- Sawada then separated internal execution data through pointers, but Sutou and Andres raised hot-path indirection concerns, leading Sutou to propose contiguous embedded state instead #306 #307 #309 #312 #316.
- The state design evolved through public/internal/built-in structures and then a simpler public/built-in split, with callbacks determining allocation size #326 #327 #328.
- Sawada assembled a complete six-patch implementation covering both state structures, registration, custom options and tests, explicitly deferring random-access and external-storage requirements #330.
- Tomas and Sutou benchmarked the state-splitting implementation on different hardware, finding small mixed results that did not establish a clear performance conclusion #332 #333 #334 #335.
Jun 2026 · 2 entries
- After another long gap, Sawada abandoned the invasive state split, exposed the existing structures with an opaque format pointer, and revised the simpler registration and validation APIs after Sutou's review #336 #337 #338.
- Sutou warned that necessary I/O functions were still missing, and Manu's ndjson experiment confirmed the problem, supplied a delta exporting three helpers, and reported successful round-trip testing #339 #340.
Nov 2026 · 8 entries
- Joao Rito independently tested the series with Manu's exports and traced the regression failure to a missing input terminator after an expected COPY FROM error, rather than validation timing; he also identified silently ignored options and an undocumented error-handling contract, which Manu confirmed his example did not implement #341 #342.
- Sawada agreed to expose and document the I/O helpers and correct the regression test, and chose a fixed-width example because ndjson overlapped existing or proposed JSON support #343.
- Sawada's nine-patch revision added I/O and encoding wrappers, designated extension-accessible state fields, and moved custom COPY FROM conversion, DEFAULT handling, record counting and ON_ERROR behavior into core, including typmod and domain checks for directly constructed Datums #344.
- The revised option API lets formats process their own options and validate format-dependent core options, while core retains general checks; Sawada kept random access outside the initial streaming scope and deferred broader API documentation while the interface remained under discussion #344.
- The revision also isolated reusable per-column FunctionCallInfo initialization as an independently committable optimization with performance results still to follow, and included an AI-generated copy_fixed proof of concept that Sawada explicitly did not plan to commit at this stage #344.
- Manu ported his ndjson module to the new API and verified file, frontend, PROGRAM, file_fdw and SJIS round trips, together with column lists, error policies, defaults, typmods and domains #345.
- Manu's testing showed that flushing only at COPY end consumed excessive memory and eventually exceeded the buffer limit, and he requested clearer guidance on per-row flushing, multibyte record boundaries, transcoded error context, private options and DEFAULT markers, plus correction of the obsolete warning that ON_ERROR cannot help formats constructing Datums themselves #345.
- At the latest message, the previously landed callback infrastructure and pass-by-reference correction remain the committed foundation, while the expanded custom-format series is under review with successful extension testing, unresolved API documentation issues and no reported new landing #344 #345.