Re: Bug #3924: Create Database with another encoding as the encoding from postgres - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Bug #3924: Create Database with another encoding as the encoding from postgres
Date
Msg-id 12717.1225375414@sss.pgh.pa.us
Whole thread Raw
In response to Bug #3924: Create Database with another encoding as the encoding from postgres  (Joe <dev@freedomcircle.net>)
Responses Re: Bug #3924: Create Database with another encoding as the encoding from postgres  (Joe <dev@freedomcircle.net>)
List pgsql-bugs
Joe <dev@freedomcircle.net> writes:
> I can understand that creating a LATIN2, EUC_CN or some other encoding
> in a LATIN1 cluster may cause problems, but don't quite see how UTF-8
> can be a problem since in essence it includes the others.  Perhaps
> someone can provide further explanation?

The locale setting implies a specific encoding.  UTF8 may contain all
the same characters that, say, LATIN1 does, but it's not anywhere near
representationally the same, and locale-dependent functions will do the
wrong thing if they are fed UTF8 when they are expecting LATIN1.

> Assuming this situation will remain as is in the immediate future, what
> are my options?  The 8.3 cluster has a LATIN1 database that must stay
> that way (at least for a while).

Why does it have to be LATIN1?  If your answer is "my client code deals
in LATIN1", just set client_encoding = LATIN1.  You could do that with
ALTER DATABASE SET or possibly ALTER USER SET so that it's transparent
to the clients.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Joe
Date:
Subject: Bug #3924: Create Database with another encoding as the encoding from postgres
Next
From: Joe
Date:
Subject: Re: Bug #3924: Create Database with another encoding as the encoding from postgres