COPY 'invalid byte sequence for encoding "UTF8": 0xff'

From: Chris Worley <chris(dot)worley(at)timco(dot)aero>
To: pgsql-general(at)postgresql(dot)org
Subject: COPY 'invalid byte sequence for encoding "UTF8": 0xff'
Date: 2009-04-21 16:52:12
Message-ID: 2c73a7ae0904210952u103d9115vf33e29ea322ace72@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I get the following error when running a sql script containing a COPY command:

ERROR: invalid byte sequence for encoding "UTF8": 0xff
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".

What I have done is write a perl script that selects out certain data
from a database and places it tab separated output between a line with
COPY from stdin and .\. Just like the pg_dump output looks.

The data I have contains binary data from a tcp dump. After running
my perl script I put the result through this command, to escape the
octets. (thought i needed to do this)

cat data.dump | iconv -c -f utf8 -t utf8 > fixed.dump

Does anybody know how the dump pulls a column with binary data? It is
a varchar column.

-chris worley

Responses

Browse pgsql-general by date

  From Date Subject
Next Message jc_mich 2009-04-21 17:03:53 Re: Doubt about join queries
Previous Message Michael Nolan 2009-04-21 16:41:57 Re: Doubt about join queries