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

Re: pg_restore errors

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kevin Kempter <kevin(at)kevinkempterllc(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_restore errors
Date: 2008-01-22 02:49:25
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
Kevin Kempter <kevin(at)kevinkempterllc(dot)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

In response to

pgsql-admin by date

Next:From: PostgreSQL AdminDate: 2008-01-22 14:57:34
Subject: Re: how to create a limited user
Previous:From: Phillip SmithDate: 2008-01-22 01:20:18
Subject: Re: pg_restore errors

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