Re: Cleaning up the INET/CIDR mess

From: Andrew - Supernews <andrew+nonews(at)supernews(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Cleaning up the INET/CIDR mess
Date: 2006-01-25 18:38:54
Message-ID: slrndtfhdt.d6t.andrew+nonews@atlantis.supernews.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2006-01-25, Greg Stark <gsstark(at)MIT(dot)EDU> wrote:
> I have a question in a different direction. What is the meaning of the
> network mask in the inet data type anyways? Hosts don't have network masks,
> only networks.

As far as I can tell, the "inet" semantics are supposed to represent a
network interface, rather than just an address. So it designates a network
and a host within that network. This is a significant semantic overload,
which is not relevent to many applications and may be counterproductive
(for example, if you had a database of hosts and networks, the network info
would more correctly be accessed via a reference to a separate table than
embedded in the host address).

> If we could store inet in four bytes it would be vastly more efficient both
> in disk space usage and in cpu at runtime.

That's not reasonable for inet/cidr due to the need to support ipv6.

If you want that for ip4-only apps, that's why pgfoundry.org/projects/ip4r
exists. It is possible that ip4r will be extended to ipv6 addresses, but
most unlikely that it will ever implement the overloaded "inet" semantics.

--
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Steve Atkins 2006-01-25 18:40:36 Re: Cleaning up the INET/CIDR mess
Previous Message Stephen Frost 2006-01-25 18:36:32 Re: Cleaning up the INET/CIDR mess