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

From Clodoaldo
Subject Re: Move data between two databases SQL-ASCII to UTF8
Date
Msg-id a595de7a0702081642o44e9c349p40662a9ddfbe6598@mail.gmail.com
Whole thread Raw
In response to Move data between two databases SQL-ASCII to UTF8  (MargaretGillon@chromalloy.com)
Responses Re: Move data between two databases SQL-ASCII to UTF8  ("Chad Wagner" <chad.wagner@gmail.com>)
List pgsql-general
2007/2/8, MargaretGillon@chromalloy.com <MargaretGillon@chromalloy.com>:
>
> I need to convert my database to UTF8. Is there a way to do a SELECT ...
> INSERT from the old database table to the new one? Would the INSERT correct
> data errors between the two data types? I only have 10 tables and the
> biggest has < 8000 rows.

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

<GUESS>
If the characters are strictly ASCII (<=127) then the conversion will
not be necessary. But if there are characters bigger than 127 then the
conversion will have to be made from iso-8859-1 to utf-8:

iconv -f ISO_8859-1 -t UTF-8 mydb.dump -o mydb_utf8.dump
</GUESS>

Regards,
--
Clodoaldo Pinto Neto

pgsql-general by date:

Previous
From: MargaretGillon@chromalloy.com
Date:
Subject: Move data between two databases SQL-ASCII to UTF8
Next
From: "Chad Wagner"
Date:
Subject: Re: Move data between two databases SQL-ASCII to UTF8