Re: BUG #13462: Impossible to use COPY FORMAT BINARY in chunks through libpq

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: socketpair(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13462: Impossible to use COPY FORMAT BINARY in chunks through libpq
Date: 2015-06-22 23:08:28
Message-ID: 9889.1435014508@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

socketpair(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2015-06-22 23:43:30 Re: Incomplete Explain for delete
Previous Message David Gould 2015-06-22 22:32:56 Re: Incomplete Explain for delete