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

Invalid byte sequence for encoding "UTF8"

From: "Neil Saunders" <n(dot)j(dot)saunders(at)gmail(dot)com>
To: pgsqlnovice <pgsql-novice(at)postgresql(dot)org>
Subject: Invalid byte sequence for encoding "UTF8"
Date: 2007-05-14 21:23:04
Message-ID: ddcd549e0705141423w14feffebu21330422c0a6cf59@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hi All,

I'm at temping to migrate a database from a Windows installation
(8.1.4) to a Linux installation (8.2.4). I've successfully migrated
the schema, but now am running in to difficulties importing the data.

For manageability, I've separated the schema from the reference data,
which is dumped separately with the following command:

pg_dump --encoding=UTF8 --username=postgres
--format=c -f c:\tvp_data\currencies.data --data-only --table=currencies tvclive

Due to short sightedness, the Windows database encoding is SQL_ASCII.
The production database is UTF8. This produced an error, so I tried
using the --encoding=UTF8 on the pg_dump command line, but to no
avail:

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 2279; 0 253991651
TABLE DATA currencies postgres
pg_restore: [archiver (db)] COPY failed: ERROR:  invalid byte sequence
for encoding "UTF8": 0xe76169
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 currencies, line 159
WARNING: errors ignored on restore: 1

I'd appreciate any assistance anyone could offer me with this - It's
driving me nuts!

Cheers,

Neil.

Responses

pgsql-novice by date

Next:From: John DeSoiDate: 2007-05-15 12:23:34
Subject: Re: Invalid byte sequence for encoding "UTF8"
Previous:From: Jim C. NasbyDate: 2007-05-14 18:55:07
Subject: Re: How to use 2PC?

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