Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B0CE72E3256 for ; Sat, 9 Feb 2008 14:14:44 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 06632-06-2 for ; Sat, 9 Feb 2008 14:14:39 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id E356E2E2D86 for ; Sat, 9 Feb 2008 14:14:36 -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 m19IEZT1025697; Sat, 9 Feb 2008 13:14:36 -0500 (EST) To: Mike Blackwell cc: pgsql-admin@postgresql.org Subject: Re: Character encoding conversion In-reply-to: <47ADB8AA.6070305@sbcglobal.net> References: <47ADB8AA.6070305@sbcglobal.net> Comments: In-reply-to Mike Blackwell message dated "Sat, 09 Feb 2008 08:28:58 -0600" Date: Sat, 09 Feb 2008 13:14:35 -0500 Message-ID: <25696.1202580875@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/119 X-Sequence-Number: 28193 Mike Blackwell writes: > I have a database which was originally created with LATIN1 encoding. > I'd like to move it to UTF8. The data will load ok (COPY) but I am > getting 'invalid byte sequence for encoding..." messages when accessing > the data. How exactly did you move the data? And what PG version are we talking about? > Is there a way to automatically convert the offending characters, or to > easily locate them in a pg_dump file so they can be converted by hand? If you've got client_encoding and server_encoding set up correctly, it should happen automatically during the COPY. I think you messed that up somehow, but it's not clear just how. regards, tom lane