Re: problem comparing strings when different cluster / database encoding

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: problem comparing strings when different cluster / database encoding
Дата
Msg-id 20060405230316.GE13673@surnet.cl
обсуждение исходный текст
Ответ на problem comparing strings when different cluster / database encoding  (Tomas Vondra <tv@fuzzy.cz>)
Список pgsql-sql
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


В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: problem comparing strings when different cluster / database encoding
Следующее
От: "Eugene E."
Дата:
Сообщение: Re: have you feel anything when you read this ?