Re: like/ilike improvements

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: like/ilike improvements
Дата
Msg-id 465370A4.7060701@dunslane.net
обсуждение исходный текст
Ответ на Re: like/ilike improvements  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: mark@mark.mielke.cc
Дата:
Сообщение: Re: like/ilike improvements
Следующее
От: "Andrej Ricnik-Bay"
Дата:
Сообщение: Re: Re: [Oledb-dev] double precision error with pg linux server, but not with windows pg server