From: Alvaro Herrera <alvherre@commandprompt.com>
To: Tomas Vondra <tv@fuzzy.cz>
Cc: pgsql-sql@postgresql.org
Subject: Re: problem comparing strings when different cluster / database encoding
Date: Wed, 5 Apr 2006 19:03:16 -0400
Message-ID: <20060405230316.GE13673@surnet.cl> (raw)
In-Reply-To: <443444B5.1010205@fuzzy.cz>
References: <443444B5.1010205@fuzzy.cz>
Tomas Vondra wrote:
Hi,
> 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.
Actually this is sort of expected. Your locale configuration expects a
certain encoding; all databases should be created using that encoding
for string comparison to work properly. What definitely is a bug is the
fact that CREATE DATABASE allows you to create a database with an
encoding different from the one defined by initdb.
The conclusion is that you should create your databases using UTF-8
encoding if you are using cs_CZ.UTF-8, otherwise it won't work as
expected.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: alvherre@commandprompt.com, tv@fuzzy.cz
Subject: Re: problem comparing strings when different cluster / database encoding
In-Reply-To: <20060405230316.GE13673@surnet.cl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox