Re: like/ilike improvements

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: andrew(at)supernews(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: like/ilike improvements
Date: 2007-05-22 22:37:24
Message-ID: 465370A4.7060701@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Yeah. It seems we need three comparison functions after all:
>

Yeah, that was my confusion. I thought we had concluded that we didn't,
but clearly we do.

> 1. Single-byte character set: needs NextByte and ByteEq only.
>
> 2. Generic multi-byte character set: both % and _ must advance by
> characters to ensure we never try an out-of-alignment character
> comparison. But simple character comparison works bytewise given
> that. So primitives are NextChar, NextByte, ByteEq.
>
> 3. UTF8: % can advance bytewise. _ must check it is on a first byte
> (else return match failure) and if so do NextChar. So primitives
> are NextChar, NextByte, ByteEq, IsFirstByte.
>
> In no case do we need CharEq. I'd be inclined to drop ByteEq as a
> macro and just use "==", too.
>
>
>

I'll work this up. I think it will be easier if I marry cases 1 and 2,
with NextChar being the same as NextByte in the single byte case.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrej Ricnik-Bay 2007-05-23 01:06:21 Re: Re: [Oledb-dev] double precision error with pg linux server, but not with windows pg server
Previous Message Tom Lane 2007-05-22 19:04:32 Re: like/ilike improvements

Browse pgsql-patches by date

  From Date Subject
Next Message db 2007-05-23 05:55:04 Re: like/ilike improvements
Previous Message Tom Lane 2007-05-22 19:04:32 Re: like/ilike improvements