Re: BUG #13462: Impossible to use COPY FORMAT BINARY in chunks through libpq - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #13462: Impossible to use COPY FORMAT BINARY in chunks through libpq
Date
Msg-id 9889.1435014508@sss.pgh.pa.us
Whole thread Raw
In response to BUG #13462: Impossible to use COPY FORMAT BINARY in chunks through libpq  (socketpair@gmail.com)
Responses Re: BUG #13462: Impossible to use COPY FORMAT BINARY in chunks through libpq  (Марк Коренберг <socketpair@gmail.com>)
Re: BUG #13462: Impossible to use COPY FORMAT BINARY in chunks through libpq  (Марк Коренберг <socketpair@gmail.com>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: socketpair@gmail.com
Date:
Subject: BUG #13462: Impossible to use COPY FORMAT BINARY in chunks through libpq
Next
From: "David G. Johnston"
Date:
Subject: Re: Incomplete Explain for delete