Stopgap solution for ILIKE in multibyte encodings

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Stopgap solution for ILIKE in multibyte encodings
Дата
Msg-id 26399.1157391276@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Stopgap solution for ILIKE in multibyte encodings  ("Guillaume Smet" <guillaume.smet@gmail.com>)
Список pgsql-hackers
I've gotten a little tired of reading reports that ILIKE doesn't work as
expected in UTF8.  The problem is that iwchareq() in like.c is several
bricks shy of a load, as noticed e.g. here
http://archives.postgresql.org/pgsql-bugs/2005-10/msg00001.php

I looked a little bit at making iwchareq less broken, but it seems like
a mess because of the disconnect between pg_wchar and whatever the
system towlower() function might be expecting.  And in any case it can
be expected that all this code will be thrown away someday, whenever
we bite the bullet and do our own locale handling --- so I'm disinclined
to spend a great deal of effort on it.

I propose that for ILIKE in multibyte encodings, we just pass the strings
through lower() and then use the normal LIKE code.  This will be a bit
slower than what we do now, but as a wise man once said, code can be
arbitrarily fast if it needn't give the right answer.  And we can't just
ignore the bug for still another release cycle.

Any objections?
        regards, tom lane


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

Предыдущее
От: Hans-Juergen Schoenig
Дата:
Сообщение: Re: Planner estimates and cast operations ,...
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Getting a move on for 8.2 beta