Re: like/ilike improvements

Andrew Dunstan <andrew@dunslane.net>

From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: andrew@supernews.com, pgsql-hackers@postgresql.org
Date: 2007-05-24T00:36:17Z
Lists: pgsql-hackers

Attachments


Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>   
>> We should only be able to get out of step from the "%_" case, I believe, 
>> so we should only need to do the first-byte test in that case (which is 
>> in a different code path from the normal "_" case. Does that seem right?
>>     
>
> At least put Assert(IsFirstByte()) in the main path.
>
> I'm a bit suspicious of the separate-path business anyway.  Will it do
> the right thing with say "%%%_" ?
>
> 	
>   

OK, Here is a patch that I am fairly confident does what's been 
discussed, as summarised by Tom.

To answer Guillaume's question - it probably won't apply cleanly to 8.2 
sources.

cheers

andrew