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