Thread: LC_COLLATE could cause a LOWER/UPPER/ILIKE malfunction?
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
クルズ クリスチアン ダニエル
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
クルズ クリスチアン ダニエル
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