Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id DDC80B5DC1C for ; Tue, 13 Sep 2011 22:56:56 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 23072-01-4 for ; Wed, 14 Sep 2011 01:56:50 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail-vw0-f50.google.com (mail-vw0-f50.google.com [209.85.212.50]) by mail.postgresql.org (Postfix) with ESMTP id ECCE4B5DCE9 for ; Tue, 13 Sep 2011 22:56:37 -0300 (ADT) Received: by vws14 with SMTP id 14so1588846vws.23 for ; Tue, 13 Sep 2011 18:56:38 -0700 (PDT) Received: by 10.220.195.73 with SMTP id eb9mr929266vcb.180.1315965397782; Tue, 13 Sep 2011 18:56:37 -0700 (PDT) Received: from ayaki.localdomain (124-148-242-247.dyn.iinet.net.au. [124.148.242.247]) by mx.google.com with ESMTPS id a10sm1778073vdk.7.2011.09.13.18.56.35 (version=SSLv3 cipher=OTHER); Tue, 13 Sep 2011 18:56:37 -0700 (PDT) Message-ID: <4E7009CB.9050807@ringerc.id.au> Date: Wed, 14 Sep 2011 09:56:27 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110707 Thunderbird/5.0 MIME-Version: 1.0 To: Johann Spies , "pgsql-admin@postgresql.org" Subject: Re: Problem restoring a dump References: <20110913091831.GA26669@sun.ac.za> <7728C00C-EFC8-401E-A0A5-76A253269C89@2ndquadrant.it> <196cf71cbca8f7fb8505fb2da9469fbe@2ndquadrant.it> <20110913124740.GA30709@sun.ac.za> In-Reply-To: <20110913124740.GA30709@sun.ac.za> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/92 X-Sequence-Number: 38329 On 09/13/2011 08:47 PM, Johann Spies wrote: > Thanks Giulio and Gabriele, > >> as Giulio pointed out, it seems like the destination database is in >> LATIN1 encoding, rather than UTF8. Could you please confirm this? > That was the case. I deleted one of the databases and recreated it with > as a UTF-8 encoded database and the import went well. > > Question: Can I change the encoding system of an existing database? If > so, how? > You can re-encode a dump (see pg_dump's -E flag) then reload it into a new database with the new encoding. This will only work if the source database contains only characters that exist in the target encoding. You can't change the encoding of a database in-place. -- Craig Ringer -- Craig Ringer