Re: Range types

Поиск
Список
Период
Сортировка
От Florian G. Pflug
Тема Re: Range types
Дата
Msg-id 4B27AB81.8090505@phlo.org
обсуждение исходный текст
Ответ на Re: Range types  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 15.12.09 15:52 , Tom Lane wrote:
> tomas@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


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Range types
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Range types