From: Craig Ringer <craig@postnewspapers.com.au>
To: AI Rumman <rummandba@gmail.com>
Cc: pgsql-general General <pgsql-general@postgresql.org>
Subject: Re: invalid byte sequence for encoding "UTF8": 0xf1612220
Date: Thu, 12 May 2011 10:52:24 +0800
Message-ID: <4DCB4B68.1070102@postnewspapers.com.au> (raw)
In-Reply-To: <BANLkTinOQRdpcZgc9bJggQaSvU4KtHGDFA@mail.gmail.com>
References: <BANLkTinOQRdpcZgc9bJggQaSvU4KtHGDFA@mail.gmail.com>
On 05/11/2011 03:16 PM, AI Rumman wrote:
> I am trying to migrate a database from Postgresql 8.2 to Postgresql 8.3
> and getting the following error:
>
> pg_restore: [archiver (db)] Error from TOC entry 2764; 0 29708702 TABLE
> DATA originaldata postgres
> pg_restore: [archiver (db)] COPY failed: ERROR: invalid byte sequence
> for encoding "UTF8": 0xf1612220
> 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 wi_originaldata, line 3592
>
> I took a dump from 8.2 server and then tried to restore at 8.3.
>
> Both the client_encoding and server_encoding are UTF8 at both the servers.
Newer versions of Pg got better at caching bad unicode. While this helps
prevent bad data getting into the database, it's a right pain if you're
moving data over from an older version with less strict checks.
I don't know of any way to relax the checks for the purpose of importing
dumps. You'll need to fix your dump files before loading them (by
finding the faulty text and fixing it) or fix it in the origin database
before migrating the data. Neither approach is nice or easy, but nobody
has yet stepped up to write a unicode verifier tool that checks old
databases' text fields against stricter rules...
--
Craig Ringer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: craig@postnewspapers.com.au, rummandba@gmail.com
Subject: Re: invalid byte sequence for encoding "UTF8": 0xf1612220
In-Reply-To: <4DCB4B68.1070102@postnewspapers.com.au>
References: <BANLkTinOQRdpcZgc9bJggQaSvU4KtHGDFA@mail.gmail.com> <4DCB4B68.1070102@postnewspapers.com.au>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox