Re: problem comparing strings when different cluster / database encoding - Mailing list pgsql-sql

From Tom Lane
Subject Re: problem comparing strings when different cluster / database encoding
Date
Msg-id 12876.1144276764@sss.pgh.pa.us
Whole thread Raw
In response to problem comparing strings when different cluster / database encoding  (Tomas Vondra <tv@fuzzy.cz>)
List pgsql-sql
Tomas Vondra <tv@fuzzy.cz> writes:
> I've encountered a strange problem. We have a PG 8.0.x database cluster
> (in the sense used in initdb, i.e. bunch of databases) created with
> UNICODE encoding, namely cs_CZ.UTF-8 locale.

> When a database is created with a different encoding (in our case it's
> LATIN2) the string comparison doesn't work correctly.

That's right.  This doesn't work, and is warned against in our docs (at
least in recent versions).  You really must keep server_encoding
matching the encoding the locale expects, for all except "trivial"
locales such as C that have no encoding expectations.

We'd forbid these combinations if there were any fully portable way to
detect which encoding the locale expects...
        regards, tom lane


pgsql-sql by date:

Previous
From: Tomas Vondra
Date:
Subject: problem comparing strings when different cluster / database encoding
Next
From: Alvaro Herrera
Date:
Subject: Re: problem comparing strings when different cluster / database encoding