socketpair@gmail.com writes:
> If I use PQputCopyData() to pass parts of the binary protocol (as documented
> in http://www.postgresql.org/docs/9.3/static/sql-copy.html ), postgres
> binary socket data gets corrupted (i.e. protocol is broken).
I think your test program is buggy; specifically, it doesn't appear to
have any provision for dealing with data endianness, which means it
will not work on a little-endian machine. Per the COPY binary format
spec:
Headers and data are in network byte order.
regards, tom lane