BUG #2261: ILIKE seems to be buggy on koi8 input - Mailing list pgsql-bugs

From Evgeny Gridasov
Subject BUG #2261: ILIKE seems to be buggy on koi8 input
Date
Msg-id 20060214173946.3661AF0B05@svr2.postgresql.org
Whole thread Raw
Responses Re: BUG #2261: ILIKE seems to be buggy on koi8 input
List pgsql-bugs
The following bug has been logged online:

Bug reference:      2261
Logged by:          Evgeny Gridasov
Email address:      eugrid@fpm.kubsu.ru
PostgreSQL version: 8.1.2
Operating system:   Debian Linux
Description:        ILIKE seems to be buggy on koi8 input
Details:

my terminal is RU_ru.KOI8-R,
template1's encoding is UTF8.
ILIKE seems to be buggy when comparing russian strings,
while UPPER/LOWER works OK.

template1=# \encoding koi8;

try to get uppercase of some russian letters:
template1=# select upper('фыва');
 upper
-------
 ФЫВА
(1 row)

result is OK!

next, try to compare uppercase and lowercase using
ILIKE:
template1=# select true where 'фыва' ilike 'ФЫВА';
 bool
------
(0 rows)

OOPS! Nothing happened. But why?

try the same but with latin charset letters:

template1=# select true where 'asdf' ilike 'ASDF';
 bool
------
 t
(1 row)

Try to compare lowercase with lowercase (russian):

template1=# select true where 'фыва' ilike 'фыва';
 bool
------
 t
(1 row)

it works.

pgsql-bugs by date:

Previous
From: Andrew Klosterman
Date:
Subject: Re: BUG #2246: Bad malloc interactions: ecpg, openssl
Next
From: Tom Lane
Date:
Subject: Re: BUG #2246: Bad malloc interactions: ecpg, openssl