Re: pg_restore errors - Mailing list pgsql-admin

From Tom Lane
Subject Re: pg_restore errors
Date
Msg-id 23912.1200970165@sss.pgh.pa.us
Whole thread Raw
In response to pg_restore errors  (Kevin Kempter <kevin@kevinkempterllc.com>)
List pgsql-admin
Kevin Kempter <kevin@kevinkempterllc.com> writes:
> Trying to restore a pg_dump I get this:
> pg_restore: ERROR:  invalid byte sequence for encoding "UTF8": 0xae
> 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".

> This is a dump file that was handed to me from a client. I don't know
> anything about what the dump flags were or what the db encoding
> was. Is there a way to find out (I'm assuming this is an encoding
> mis-match) from the dump file.

Well, the fact that you got that message says that the original database
was, or thought it was, in UTF8 encoding: pg_dump would have propagated
that fact into a "set client_encoding" command in the dump script.

I suppose that this data got loaded into the database while it was being
run by one of the early 8.1.x releases that didn't check encoding very
carefully :-(.  You're going to have to guess what the real encoding is;
querying the client about his typical locale settings might help.

When trying to fix up the data, keep in mind that what you have now is
likely a mix of real UTF8 and whatever-this-is.

            regards, tom lane

pgsql-admin by date:

Previous
From: "Phillip Smith"
Date:
Subject: Re: pg_restore errors
Next
From: Guillermo Arias
Date:
Subject: how to create a limited user