From: Tom Lane on
Robert Haas <robertmhaas(a)gmail.com> writes:
> I also have to say that I'm very skeptical of the argument
> that there is only a small list of types people will want this for.

I'm not sure that anyone has argued that. I did suggest that there
might be a small list of types for which we should provide discrete
behavior (ie, with next/previous functions) and the rest could have
continuous behavior (without that assumption). But I quite agree
that we want both types of ranges.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Robert Haas on
On Tue, Dec 15, 2009 at 10:19 AM, Tom Lane <tgl(a)sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas(a)gmail.com> writes:
>> I also have to say that I'm very skeptical of the argument
>> that there is only a small list of types people will want this for.
>
> I'm not sure that anyone has argued that.  I did suggest that there
> might be a small list of types for which we should provide discrete
> behavior (ie, with next/previous functions) and the rest could have
> continuous behavior (without that assumption).  But I quite agree
> that we want both types of ranges.

Oh, I think you're right. I guess I'm skeptical that the set for
which discrete treatment is appropriate is a small, fixed set, too.
Unless hard-coding that assumption buys us some really significant
economies, I think we should avoid doing so.

....Robert

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: "Florian G. Pflug" on
On 15.12.09 15:52 , Tom Lane wrote:
> tomas(a)tuxteam.de writes:
>> (and as Andrew Dunstan pointed out off-list: I was wrong with my
>> bold assertion that one can squeeze infinitely many (arbitrary
>> length) strings between two given. This is not always the case).
>
> Really? If the string length is unbounded I think you were right.

One example is "a" and "aa" (assuming "a" is minimal character in your
alphabet). The general case is the strings A and Aaaaaaa...a I think -
it doesn't get any more exciting than this.

This *is* a bit surprising, since one usually assumes that the ordering
of strings and reals is fairly similar, since both are lexical.

But note that the mapping of strings into the reals this intuition is
based on (simply prefix a the string with "0." and interpret as a real,
or something similar if the alphabet isn't {0,1}) isn't one-to-one - the
strings "1", "10", "100", ... are all mapped to the *same* real number 0.1

So for reals, the statement is reduced to the trivial fact that for
every x there is no y with x < y < x. Which is of course true..

best regards,
Florian Pflug

From: Tom Lane on
Nicolas Barbier <nicolas.barbier(a)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

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Andrew Dunstan on


Tom Lane wrote:
> So the long and the short of it is that next/previous are not
> going to work for string types, maxlength or no maxlength.
>
>
>

Even more importantly, I strongly doubt they would be of the slightest
practical value.

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Prev: Winflex
Next: [HACKERS] Fast or immediate shutdown