Re: [HACKERS] Definitional issue for INET types

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: [HACKERS] Definitional issue for INET types
Дата
Msg-id Pine.GSO.4.02A.10002171305400.2933-100000@Oxe.DoCS.UU.SE
обсуждение исходный текст
Ответ на Definitional issue for INET types  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Definitional issue for INET types  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thu, 17 Feb 2000, Tom Lane wrote:

>     '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.

I think we can flip a three-sided coin here:

1) '10.1.2.3/8'::inet is not a valid inet input value, sort of in the same
way as 10.5 is not a valid integer.

2) You coerce '10.1.2.3/8'::inet to essentially '10.0.0.0/8'::inet on
input. (In some parts, implicit data mangling that loses information is
not considered good practice.)

3) You can't compare inet and cidr because they're two different (albeit
similar) things. If you want to compare them you have to explicitly cast
inet to cidr or vice versa according to 1) or 2).

In any case I believe you revised code has a very good point.


-- 
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



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

Предыдущее
От: Sevo Stille
Дата:
Сообщение: Re: [HACKERS] Definitional issue for INET types
Следующее
От: "Jeff MacDonald "
Дата:
Сообщение: PC Week PostgreSQL benchmark results posted online (fwd)