Re: Move data between two databases SQL-ASCII to UTF8 - Mailing list pgsql-general

From Chad Wagner
Subject Re: Move data between two databases SQL-ASCII to UTF8
Date
Msg-id 81961ff50702081722h235d645erd59a48f741bbfe78@mail.gmail.com
Whole thread Raw
In response to Re: Move data between two databases SQL-ASCII to UTF8  (Clodoaldo <clodoaldo.pinto.neto@gmail.com>)
Responses Re: Move data between two databases SQL-ASCII to UTF8
List pgsql-general
On 2/8/07, Clodoaldo <clodoaldo.pinto.neto@gmail.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/

pgsql-general by date:

Previous
From: Clodoaldo
Date:
Subject: Re: Move data between two databases SQL-ASCII to UTF8
Next
From: Madison Kelly
Date:
Subject: Possibly odd question; diff results?