Обсуждение: LC_COLLATE could cause a LOWER/UPPER/ILIKE malfunction?

Поиск
Список
Период
Сортировка

LC_COLLATE could cause a LOWER/UPPER/ILIKE malfunction?

От
Daniel Cristian Cruz
Дата:
I found this problem, where 'ã' MUST be ILIKE 'Ã' (PostgreSQL 8.2.12, RedHat x86_64):

brd2=# SET client_encoding TO unicode;
SET
brd2=# SELECT 'ã' LIKE 'ã';
 ?column?
----------
 t
(1 registro)

brd2=# SELECT UPPER('ã') LIKE UPPER('ã');
 ?column?
----------
 t
(1 registro)

brd2=# SELECT 'Ã' LIKE UPPER('ã');
 ?column?
----------
 f
(1 registro)

brd2=# SHOW lc_collate ;
   lc_collate  
----------------
 pt_BR.iso88591
(1 registro)

The correct LC_COLLATE would be pt_BR.utf8 or is it a bug?

--
Daniel Cristian Cruz
クルズ  クリスチアン ダニエル

Re: LC_COLLATE could cause a LOWER/UPPER/ILIKE malfunction?

От
Tom Lane
Дата:
Daniel Cristian Cruz <danielcristian@gmail.com> writes:
> I found this problem, where 'ã' MUST be ILIKE 'Ã' (PostgreSQL 8.2.12, RedHat
> x86_64):

Is your database encoding iso88591?  IIRC, 8.2 will try to warn you if
the encoding doesn't match the locale setting, but it doesn't completely
refuse nonsensical combinations.  However, a nonsensical combination
could easily cause bad results from upper().

            regards, tom lane