Re: [HACKERS] Postgres 6.5 beta2 and beta3 problem - Mailing list pgsql-hackers

From Goran Thyni
Subject Re: [HACKERS] Postgres 6.5 beta2 and beta3 problem
Date
Msg-id 375EC369.783E6623@kirra.net
Whole thread Raw
In response to Re: [HACKERS] Postgres 6.5 beta2 and beta3 problem  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
It was me who found the bug and supplied the ugly fix, but that was the
only
quick fix we could find until someone figure out how to get the correct
one from
locale.
USE_LOCALE uses strcoll instead of strcmp for comparasion and indexes
and it sorts
correctly but does not work with the MakeIndexable trick since \377
might not
be the highest char in the alphabet or worse might not be a char of the
alphabet at
all (like in sv/fi locales).

The patch gives a slower correct result instead of a fast incorrect one,
which is better IMHO, but maybe I am old fashion. :-)

Anyway I think a correct solution should be:
"a LIKE 'abc%'" should generate:
"a >= 'abc\0' AND a < 'abd'"                        ^
where d is the last char before % + 1, or more correct the next char in
alphabet
after the last char before %.

Still looking for a locale guru. Hello!! :-(

regards,
-- 
-----------------
Göran Thyni
This is Penguin Country. On a quiet night you can hear Windows NT
reboot!


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: [HACKERS] PL/Lang (was: Priorities for 6.6)
Next
From: Massimo Dal Zotto
Date:
Subject: out of memory with large queries