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

Поиск
Список
Период
Сортировка
От Chad Wagner
Тема Re: Move data between two databases SQL-ASCII to UTF8
Дата
Msg-id 81961ff50702081722h235d645erd59a48f741bbfe78@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Move data between two databases SQL-ASCII to UTF8  (Clodoaldo <clodoaldo.pinto.neto@gmail.com>)
Ответы Re: Move data between two databases SQL-ASCII to UTF8  (Michael Fuhr <mike@fuhr.org>)
Список 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 по дате отправления:

Предыдущее
От: Clodoaldo
Дата:
Сообщение: Re: Move data between two databases SQL-ASCII to UTF8
Следующее
От: Madison Kelly
Дата:
Сообщение: Possibly odd question; diff results?