Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 9E9DB2E3C38 for ; Mon, 21 Jan 2008 22:49:31 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 49238-05 for ; Mon, 21 Jan 2008 22:49:20 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 5FA612E3285 for ; Mon, 21 Jan 2008 22:49:28 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m0M2nPtv023913; Mon, 21 Jan 2008 21:49:25 -0500 (EST) To: Kevin Kempter cc: pgsql-admin@postgresql.org Subject: Re: pg_restore errors In-reply-to: <200801211806.57989.kevin@kevinkempterllc.com> References: <200801211806.57989.kevin@kevinkempterllc.com> Comments: In-reply-to Kevin Kempter message dated "Mon, 21 Jan 2008 18:06:57 -0700" Date: Mon, 21 Jan 2008 21:49:25 -0500 Message-ID: <23912.1200970165@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/218 X-Sequence-Number: 27992 Kevin Kempter 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