Re: Range types - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Range types
Date
Msg-id 15621.1260891108@sss.pgh.pa.us
Whole thread Raw
In response to Re: Range types  (Nicolas Barbier <nicolas.barbier@gmail.com>)
Responses Re: Range types  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Nicolas Barbier <nicolas.barbier@gmail.com> writes:
> Assuming lexicographical ordering (first different character
> determines order; end-of-string is sorted before anything else),
> consider the following two strings:
> <whatever>
> and
> <same whatever as before> + the character with the lowest value in
> lexicographical ordering.

> I don't think it is possible to get anything in between those two strings.

OK, point taken.  But in the real world, many locales use
non-lexicographical ordering.

In practice, even if you are willing to grant a maximum string
length, it is tough enough to find a string just a bit greater
than a given string, and damn near impossible to promise that
there will be no strings between.  We learned that the hard way
trying to make LIKE prefix-match indexing work in non-C locales.
So the long and the short of it is that next/previous are not
going to work for string types, maxlength or no maxlength.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: Re: Range types
Next
From: Michael Meskes
Date:
Subject: Re: ECPG patch N+1, fix auto-prepare