> What I can't understand is why PQputCopyData() encodes incoming character string, which was exported by "COPY ... TO
'/tmp/t'"SQL command under psql prompt, for bytea columns and refuse to accept or misinterpret zero value.
As far as PQputCopyData() is concerned, server and/or client does not have to decode input character string for bytea
column,does they? My understanding is that all client or server need to do to import data to bytea column is
un-escapingall sets of \nnn (or \x000) character strings back to binary bytes and unconditionally store the result to
thetarget bytea column.
Encoding/Decoding is required only by TEXT and (VAR)CHAR columns, isn't it?
Errors like the following ones should not occur to bytea columns, should they?
ERROR: invalid byte sequence for encoding "UTF8": 0x00
HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is
controlledby "client_encoding".
CONTEXT: COPY tablein, line 1: "abcd\011\000ABCDEFGH"
STATEMENT: COPY tablein FROM STDIN
Regards,
CN