Skip site navigation (1) Skip section navigation (2)

BUG #5164: COPY command: invalid byte sequence 0x80

From: "Bogdan Mihaila" <bm2004mvc(at)yahoo(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5164: COPY command: invalid byte sequence 0x80
Date: 2009-11-04 09:05:55
Message-ID: 200911040905.nA495tej084019@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      5164
Logged by:          Bogdan Mihaila
Email address:      bm2004mvc(at)yahoo(dot)com
PostgreSQL version: 8.1 and 8.3
Operating system:   Linux
Description:        COPY command: invalid byte sequence 0x80
Details: 

Hello!

I searched the internet for this problem, but I didn't find an answer.
Please help me.

I make a COPY TO command (in a 8.1 version, under Linux) for a table that
contains text in the UTF-8 encoding. The command is:

set client_encoding = 'utf8';
DROP TABLE "acte1";
CREATE TEMP TABLE "acte1" AS
    SELECT * FROM "Oficiale"."acte" WHERE id = 57502;
COPY "acte1" TO '/home/bogdanm/eugen.copy';

Then I make a COPY FROM (in a 8.3 version,under the same Linux machine as
above) like this:

set client_encoding = 'utf8';
copy "Oficiale"."acte" from '/home/bogdanm/eugen.copy'

It works!

But, where I specify the interval like this:

WHERE id > 57500 and id < 57600;

it doesn't work, saying:

ERROR:  invalid byte sequence for encoding "UTF8": 0x80
HINT:  This error can also happen if the byte sequence does not match the
encoding expected by the server, which is controlled by "client_encoding".
CONTEXT:  COPY acte, line 51


Why is that? The second range obviously contains the first...


Thanks very much in advance,
   Bogdan

Responses

pgsql-bugs by date

Next:From: Fujii MasaoDate: 2009-11-04 10:40:19
Subject: Re: BUG #4961: pg_standby.exe crashes with no args
Previous:From: Craig RingerDate: 2009-11-04 04:44:39
Subject: Re: BUG #5163: Admin can't connect and won't use port 5432

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group