Re: Summary: what to do about INET/CIDR - Mailing list pgsql-hackers

From Alex Pilosov
Subject Re: Summary: what to do about INET/CIDR
Date
Msg-id Pine.BSO.4.10.10010271918020.22890-100000@spider.pilosoft.com
Whole thread Raw
In response to Summary: what to do about INET/CIDR  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Summary: what to do about INET/CIDR  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, 27 Oct 2000, Tom Lane wrote:

> The way I'm visualizing this, INET is a generalized type that will store
> any 4-octet address plus any netmask width from 1 to 32.  This includes
> not only host addresses, but network specs and broadcast addresses.
> CIDR is a subset type that only accepts valid network specs (ie, no
> nonzero address bits to the right of the netmask).  There is no subset

I really don't think it should. We should have as much error-checking as
possible. Broadcast address does _not_ have a netmask, i.e. 10.0.0.255/24
does not make sense as inet, it should be 10.0.0.255/32

(ie. broadcast() function must return a value with /32 mask)

> type that corresponds to "valid host addresses only" --- if there were,
> it would be a subset of INET but would have no valid values in common
> with CIDR.  We could make such a type but I dunno if it's worth the
> trouble.



pgsql-hackers by date:

Previous
From: Larry Rosenman
Date:
Subject: Re: Summary: what to do about INET/CIDR
Next
From: Peter Eisentraut
Date:
Subject: Re: Idea: cross-check versions during initdb