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

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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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

pgsql-hackers by date

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

pgsql-patches by date

Next:From: dbDate: 2007-05-23 05:55:04
Subject: Re: like/ilike improvements
Previous:From: Tom LaneDate: 2007-05-22 19:04:32
Subject: Re: like/ilike improvements

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