Re: [GENERAL] Libpq: copy file to bytea column

2010-03-09 Thread Albe Laurenz
seiliki wrote: >>> The data types of tableout.c1 and tablein.c1 are both bytea. [...] >>> However, I get the following errors from log when calling >>> libpq functions PQputCopyData() and PQputCopyEnd(). >>> >>> 2010-03-06 20:47:42 CST ERROR: invalid byte sequence for encoding "UTF8": >>> 0x

Re: [GENERAL] Libpq: copy file to bytea column

2010-03-08 Thread seiliki
> 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

Re: [GENERAL] Libpq: copy file to bytea column

2010-03-08 Thread seiliki
> > The data types of tableout.c1 and tablein.c1 are both bytea. > > I first export tableout.c1 to a file: > > > > db1=# COPY (SELECT c1 FROM tableout LIMIT 1) TO '/tmp/t'; > > > > Then I try to import the file to another table. > > > > This works without flaw: > > > > db1=# COPY tablein FROM

Re: [GENERAL] Libpq: copy file to bytea column

2010-03-08 Thread Albe Laurenz
seiliki wrote: > The data types of tableout.c1 and tablein.c1 are both bytea. > I first export tableout.c1 to a file: > > db1=# COPY (SELECT c1 FROM tableout LIMIT 1) TO '/tmp/t'; > > Then I try to import the file to another table. > > This works without flaw: > > db1=# COPY tablein FROM '/tmp

[GENERAL] Libpq: copy file to bytea column

2010-03-06 Thread seiliki
Hi! The data types of tableout.c1 and tablein.c1 are both bytea. I first export tableout.c1 to a file: db1=# COPY (SELECT c1 FROM tableout LIMIT 1) TO '/tmp/t'; Then I try to import the file to another table. This works without flaw: db1=# COPY tablein FROM '/tmp/t'; However, I get the follo