From: Craig Ringer <ringerc@ringerc.id.au>
To: Johann Spies <jspies@sun.ac.za>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Problem restoring a dump
Date: Wed, 14 Sep 2011 09:56:27 +0800
Message-ID: <4E7009CB.9050807@ringerc.id.au> (raw)
In-Reply-To: <20110913124740.GA30709@sun.ac.za>
References: <20110913091831.GA26669@sun.ac.za>
<7728C00C-EFC8-401E-A0A5-76A253269C89@2ndquadrant.it>
<196cf71cbca8f7fb8505fb2da9469fbe@2ndquadrant.it>
<20110913124740.GA30709@sun.ac.za>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: ringerc@ringerc.id.au, jspies@sun.ac.za
Subject: Re: Problem restoring a dump
In-Reply-To: <4E7009CB.9050807@ringerc.id.au>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox