Re: problem comparing strings when different cluster / database encoding

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tomas Vondra <tv(at)fuzzy(dot)cz>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: problem comparing strings when different cluster / database encoding
Date: 2006-04-05 22:39:24
Message-ID: 12876.1144276764@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tomas Vondra <tv(at)fuzzy(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Alvaro Herrera 2006-04-05 23:03:16 Re: problem comparing strings when different cluster / database encoding
Previous Message Tom Lane 2006-04-05 22:29:28 Re: SELECT composite type