Definitional issue for INET types

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Definitional issue for INET types
Дата
Msg-id 14929.950772313@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: [HACKERS] Definitional issue for INET types  (Peter Eisentraut <e99re41@DoCS.UU.SE>)
Список pgsql-hackers
I tried fixing some of the known problems with comparison of INET values
(cf. thread "uniqueness not always correct" on 11/11/99, among others),
and was surprised to discover that my changes affected the results of
the inet regress test.  Specifically, the regress test exercises all the
inet comparison operators on the two data values'10.1.2.3/8'::inet     '10.0.0.0/32'::cidr
The old code believes that the first of these is greater, while my
revised code thinks the second is greater.

Now, my understanding of things is that '10.1.2.3/8' is just an
unreasonably verbose way of writing '10/8', because if you write /8
you are saying that only the first 8 bits mean anything.  So it seems
to me that we are really comparing '10/8' and '10.0.0.0/32', and the
former should be considered the lesser in the same way that 'ab'
comes before 'abc' in dictionaries.

Is the regress test's expected output wrong, or have I missed
something?
        regards, tom lane


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

Предыдущее
От: Thomas Lockhart
Дата:
Сообщение: Re: [HACKERS] ERROR: Unable to identify an operator '=' for types 'numeric' and 'float8'
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Almost there on column aliases