Re: ILIKE vs indices - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ILIKE vs indices
Date
Msg-id 22960.1356738089@sss.pgh.pa.us
Whole thread Raw
In response to ILIKE vs indices  (James Cloos <cloos@jhcloos.com>)
Responses Re: ILIKE vs indices
Re: ILIKE vs indices
List pgsql-hackers
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.)

> Perhaps the parser could read the former as the latter?

Not unless the equivalence can be shown to be exact, which I doubt.
In any case it's not obvious why LOWER rather than UPPER.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: enhanced error fields
Next
From: Vlad Arkhipov
Date:
Subject: Rewriter hook