Re: BUG #15892: URGENT: Using an ICU collation in a primary key column breaks ILIKE query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Arthur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>
Cc: Daniel Verite <daniel(at)manitou-mail(dot)org>, James Inform <james(dot)inform(at)pharmapp(dot)de>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15892: URGENT: Using an ICU collation in a primary key column breaks ILIKE query
Date: 2019-08-11 21:32:49
Message-ID: 8498.1565559169@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Arthur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru> writes:
> On 04.07.2019 19:50, Daniel Verite wrote:
>> Yes. It is because of the index that the code checks if the ILIKE
>> can be evaluated with an index lookup. Otherwise it doesn't.
>> If you feel like recompiling with a temporary fix against v11.4 to do
>> your own tests, please try the attached patch.

> Also this patch works. I thinks we need to use some ICU function to
> check whether a char is a letter.

This topic seems to have slipped through the cracks, which is too bad
because we surely could have gotten it fixed in time for last week's
releases. Oh well.

I think Daniel's patch leaves more on the table than it needs to,
and I don't like Arthur's patch because it's assuming more than it
should about whether it's okay to pass a "char" to u_isalpha().
I propose that we do things as attached, instead.

(I also added a regression test case.)

regards, tom lane

Attachment Content-Type Size
fix-selfuncs-ilike-v3.patch text/x-diff 3.3 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2019-08-11 23:35:06 BUG #15948: TRGM gin index is not be taken into account when using like all (array)
Previous Message Tom Lane 2019-08-11 16:39:17 Re: BUG #15947: Worse plan is chosen after giving the planner more freedom (partitionwise join)