Re: [HACKERS] Definitional issue for INET types

From: Sevo Stille <sevo(at)ip23(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Definitional issue for INET types
Date: 2000-02-17 12:07:59
Message-ID: 38ABE49F.142BC894@ip23.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

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

Not really. In a classed view on a network, the /8 is undefined - and
worse, there is no real concept of a address consisting of a
network/netmask tuple. /8 might imply that 10.1.2.3 is in the class A
segment, it might be considered a 255.0.0.0 netmask with any possible
interpretation of the latter, or it might be entirely ignored. For
::cidr vs. ::cidr the answer is clear - apply the masks and match then,
which would make 10/8 lesser by all means.

> 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?

Tough question. There are some nasty details differing between classed
network notation and CIDR notation, and we certainly cannot reconcile
them all in operators. As the significant digits are meaningless in
classed notation, they might either be ignored or interpreted according
to any rule applying to classed netmasks, which really depends on the
context of the network device - a router, firewall or audit tool might
each have different semantics and requirements.

I'll see whether I can figure out something consistent for the inet data
type. As it is right now, we might just as well drop it - it is both
synonymous to cidr and to a cidr /32 host, which simply can't be.
Personally, I don't think we would lose any functionality if we drop it,
as long as we have functions that return classed network structures like
the base address and a networks subnettable range.

Sevo

--
Sevo Stille
sevo(at)ip23(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2000-02-17 12:10:49 Re: [HACKERS] Definitional issue for INET types
Previous Message Peter Eisentraut 2000-02-17 12:00:17 Re: [HACKERS] Date/time types: big change