Skip site navigation (1) Skip section navigation (2)

Re: ILIKE vs indices

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: James Cloos <cloos(at)jhcloos(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ILIKE vs indices
Date: 2012-12-28 23:41:29
Message-ID: 22960.1356738089@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
James Cloos <cloos(at)jhcloos(dot)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


In response to

Responses

pgsql-hackers by date

Next:From: Vlad ArkhipovDate: 2012-12-29 01:36:55
Subject: Rewriter hook
Previous:From: Tom LaneDate: 2012-12-28 23:35:02
Subject: Re: enhanced error fields

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group