Re: Migrate postgres databases from SQL_ASCII to UNICODE encoding

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Dario V(dot) Fassi" <software(at)sistemat(dot)com(dot)ar>
Cc: pgsql-jdbc(at)postgresql(dot)org, pgsql-admin(at)postgresql(dot)org
Subject: Re: Migrate postgres databases from SQL_ASCII to UNICODE encoding
Date: 2004-07-17 21:18:16
Message-ID: 16994.1090099096@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-jdbc pgsql-sql

"Dario V. Fassi" <software(at)sistemat(dot)com(dot)ar> writes:
> A simple question, we need to migrate many (>20) postgres databases from
> SQL_ASCII encoding to UNICODE encoding, over a 7.3.6 server.

SQL_ASCII is not an encoding (it's more like the absence of knowledge
about an encoding). What is the data actually stored as?

> With Dump/Restore , we get an error (Invalid Unicode) in any field that
> has a 8 bits character coming from the SQL_ASCII , even setting the
> client_encoding to WIN, ISO-8859-1, and others encodings.

It might work to just UPDATE pg_database to set datencoding to the
correct value reflecting what you have actually stored. You might then
need to REINDEX any indexes on textual columns, but I don't think
anything else would go wrong.

If you have a mishmash of different encodings in a single database, then
of course there is no simple solution; you are in for some pain while
you try to fix the data.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Dario V. Fassi 2004-07-17 23:26:17 Re: [ADMIN] Migrate postgres databases from SQL_ASCII to UNICODE
Previous Message Bruce Momjian 2004-07-17 20:15:21 Re: [HACKERS] Point in Time Recovery

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2004-07-17 22:58:44 Re: revisiting transaction isolation
Previous Message Dario V. Fassi 2004-07-17 20:03:31 Migrate postgres databases from SQL_ASCII to UNICODE encoding

Browse pgsql-sql by date

  From Date Subject
Next Message Dario V. Fassi 2004-07-17 23:26:17 Re: [ADMIN] Migrate postgres databases from SQL_ASCII to UNICODE
Previous Message Dario V. Fassi 2004-07-17 20:03:31 Migrate postgres databases from SQL_ASCII to UNICODE encoding