Re: [ADMIN] what's the efficient/safest way to convert database character set ? - Mailing list pgsql-general

From John R Pierce
Subject Re: [ADMIN] what's the efficient/safest way to convert database character set ?
Date
Msg-id 5260D13A.1060804@hogranch.com
Whole thread Raw
In response to Re: [ADMIN] what's the efficient/safest way to convert database character set ?  ("Huang, Suya" <Suya.Huang@au.experian.com>)
Responses Re: [ADMIN] what's the efficient/safest way to convert database character set ?
List pgsql-general
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 multibyte character
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 command should 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



pgsql-general by date:

Previous
From: "Huang, Suya"
Date:
Subject: Re: [ADMIN] what's the efficient/safest way to convert database character set ?
Next
From: Jayadevan M
Date:
Subject: postgresql.conf error