Re: ILIKE vs indices

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: ILIKE vs indices
Дата
Msg-id CAM-w4HNnap-a3O1+1QgiCA1YaiAy4sqqH-Efj695=HY4HvM1iQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ILIKE vs indices  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: ILIKE vs indices
Список pgsql-hackers
On Fri, Dec 28, 2012 at 11:41 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> James Cloos <cloos@jhcloos.com> writes:
>> Is there any contraindication to recasting:
>>   foo ILIKE 'bar'
>> into:
>>   LOWER(foo) LIKE LOWER('bar')
>
> In some locales those are not equivalent, I believe, or at least
> shouldn't be.  (What the current code actually does is a separate
> question.)

What it actually does is actually *precisely* the above.

I can't quite wrap my head around the idea of "LIKE" and collations
having any meaningful interaction anyways. I certainly can't come up
with anything better than "lower() like lower()" (or "upper() like
upper()").

It would be nice to document what ILIKE actually means. Right now it's
kind of mysterious. And if we can't come up with anything better than
"lower() like lower()" then why not go ahead and document it and take
advantage of it.

-- 
greg



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

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: Event Triggers: adding information
Следующее
От: Dimitri Fontaine
Дата:
Сообщение: Re: Proposal: Store "timestamptz" of database creation on "pg_database"