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

Re: Bug in ILIKE?

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Bug in ILIKE?
Date: 2008-09-26 02:45:18
Message-ID: 48DC4CBE.1060908@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Good:
>
> regression=# select 'T' ilike 't';
>  ?column? 
> ----------
>  t
> (1 row)
>
> Not so good:
>
> regression=# select 'T' ilike E'\\t';
>  ?column? 
> ----------
>  f
> (1 row)
>
> ISTM backslash is only supposed to turn off the pattern-language
> specialness of characters, not render them case sensitive.  The reason
> this happens is that the backslash case in MatchText() checks for exact
> equality.  I think it should be checking for TCHAR() equality, same as
> when it is just checking two ordinary characters.  Comments?  Is this a
> backpatchable bug fix, or should we only change the behavior for 8.4 and
> beyond?
>
>   


Hmm. A quick test shows this working the other way in 8.2, so I assume 
this is a byproduct of the work we did to improve the efficiency of 
LIKE/ILIKE in 8.3 ;-(

The docs actually don't state what are the semantics of escape followed 
by something that is not escape or a metachar. Does the spec say 
anything about that?

cheers

andrew


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2008-09-26 02:54:28
Subject: Re: Updates of SE-PostgreSQL 8.4devel patches
Previous:From: KaiGai KoheiDate: 2008-09-26 02:41:02
Subject: Re: Updates of SE-PostgreSQL 8.4devel patches

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