On Thu, 2 Mar 2023 at 20:45, Jeroen Vermeulen <jtv...@gmail.com> wrote: > I'm attaching a diff now. This is not a patch, it's just a discussion piece.
Did you try with PQExpBuffer? I still think that probably fits better in the API design of libpq. Obviously if it's significantly slower than the callback approach in this patch then it's worth considering using the callback approach. Overall it definitely seems reasonable to me to have an API that doesn't do an allocation per row.