The following bug has been logged online: Bug reference: 2261 Logged by: Evgeny Gridasov Email address: [EMAIL PROTECTED] 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. ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend