Re: Range types

From: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: tomas(at)tuxteam(dot)de, hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Range types
Date: 2009-12-15 15:30:09
Message-ID: 4B27AB81.8090505@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 15.12.09 15:52 , Tom Lane wrote:
> tomas(at)tuxteam(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-12-15 15:31:48 Re: Range types
Previous Message Robert Haas 2009-12-15 15:27:40 Re: Range types