I'm marking this as "Rejected" in the commitfest. It's quite clear that
this isn't going to fly in its current form.
For the COPY FROM use case, I'd suggest just doing COPY FROM STDIN. Yes,
it's slower, but not much. And you probably could optimize it further -
there's some gratuitous memcpy()ing happening from buffer to buffer in
that codepath.
- Heikki