Re: like/ilike improvements - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: like/ilike improvements
Date
Msg-id 4656426A.7000304@dunslane.net
Whole thread Raw
In response to Re: like/ilike improvements  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: like/ilike improvements
List pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>   
>> However, I have just about convinced myself that we don't need 
>> IsFirstByte for matching "_" for UTF8, either preceded by "%" or not, as 
>> it should always be true. Can anyone come up with a counter example?
>>     
>
> You have to be on a first byte before you can meaningfully apply
> NextChar, and you have to use NextChar or else you don't count
> characters correctly (eg "__" must match 2 chars not 2 bytes).
>
>
>   

Yes, I agree completely. However it looks to me like IsFirstByte will in 
fact always be true when we get to call NextChar for matching "_" for UTF8.

cheers

andrew


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: like/ilike improvements
Next
From: Tom Lane
Date:
Subject: Re: like/ilike improvements