Re: Move data between two databases SQL-ASCII to UTF8

From: "Chad Wagner" <chad(dot)wagner(at)gmail(dot)com>
To: Clodoaldo <clodoaldo(dot)pinto(dot)neto(at)gmail(dot)com>
Cc: "MargaretGillon(at)chromalloy(dot)com" <MargaretGillon(at)chromalloy(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Move data between two databases SQL-ASCII to UTF8
Date: 2007-02-09 01:22:40
Message-ID: 81961ff50702081722h235d645erd59a48f741bbfe78@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2/8/07, Clodoaldo <clodoaldo(dot)pinto(dot)neto(at)gmail(dot)com> wrote:
>
> Use pg_dump to dump the db and use iconv on the generated file:
>
> iconv -f ASCII -t UTF-8 mydb.dump -o mydb_utf8.dump
>

Wouldn't it be adequate to set the client encoding to SQL_ASCII in the dump
file (if that was infact the encoding on the original database)?

SET client_encoding TO SQL_ASCII;

And then let the database do the conversion? I would think since the db is
UTF8 and the client is claiming SQL_ASCII then it would convert the data to
UTF8.

I have done this in the past with SQL dumps that had characters that UTF8
didn't like, and I just added the "SET client_encoding TO LATIN1;" since I
knew the source encoding was LATIN1.

--
Chad
http://www.postgresqlforums.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Madison Kelly 2007-02-09 01:31:46 Possibly odd question; diff results?
Previous Message Nicolas Gignac 2007-02-09 01:01:01 Re: Client connection: Port 5432 / Postgres