Re: [ADMIN] what's the efficient/safest way to convert database character set ?

Поиск
Список
Период
Сортировка
От Huang, Suya
Тема Re: [ADMIN] what's the efficient/safest way to convert database character set ?
Дата
Msg-id D83E55F5F4D99B4A9B4C4E259E6227CD9DF6AE@AUX1EXC01.apac.experian.local
обсуждение исходный текст
Ответ на Re: [ADMIN] what's the efficient/safest way to convert database character set ?  (John R Pierce <pierce@hogranch.com>)
Ответы Re: [ADMIN] what's the efficient/safest way to convert database character set ?  (John R Pierce <pierce@hogranch.com>)
Список pgsql-general
Hi John,

We stored ISO-8859-1, do we still need to use iconv to convert the file?

Thanks,
Suya

-----Original Message-----
From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of John R Pierce
Sent: Friday, October 18, 2013 5:12 PM
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] [ADMIN] what's the efficient/safest way to convert database character set ?

On 10/17/2013 10:51 PM, Huang, Suya wrote:
> Question: How can I pull out the real character set information from the database? does it rely on the understanding
ofbusiness knowledge? 


what did you store in it?   because its declared SQL_ASCII, postgres
doesn't know, its all just bytes.   you could have stored standard 7 bit
USASCII, or you could have stored ISO-8859-1 (-2, -3,...), or you could have stored one of the myriad non-UTF Asian
multibytecharacter  
codes.    postgres doesn't know or care what you put in there, and it
doesn't check to ensure its valid.

IF all your data is in a consistent encoding, and you specify that encoding on the pg_dump command, then the psql
commandshould be able to restore it as-is to the new UTF8 database via the magic of  
client_encoding.    if the data is not consistent, you'll have a much
harder time.





--
john r pierce                                      37N 122W
somewhere on the middle of the left coast



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


В списке pgsql-general по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Preserving the source code of views
Следующее
От: Bill Moran
Дата:
Сообщение: Re: Preserving the source code of views