Re: Move data between two databases SQL-ASCII to UTF8
От | Clodoaldo |
---|---|
Тема | Re: Move data between two databases SQL-ASCII to UTF8 |
Дата | |
Msg-id | a595de7a0702081642o44e9c349p40662a9ddfbe6598@mail.gmail.com обсуждение исходный текст |
Ответ на | Move data between two databases SQL-ASCII to UTF8 (MargaretGillon@chromalloy.com) |
Ответы |
Re: Move data between two databases SQL-ASCII to UTF8
|
Список | 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 по дате отправления: