Re: [HACKERS] cidr - Mailing list pgsql-hackers

From darcy@druid.net (D'Arcy J.M. Cain)
Subject Re: [HACKERS] cidr
Date
Msg-id m0yzvd6-00006FC@druid.net
Whole thread Raw
In response to Re: [HACKERS] cidr  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] cidr
List pgsql-hackers
Thus spake Bruce Momjian
> > I do like the idea of using attypmod to define the form of the type.
> > I assume we can use that to determine the output format, that is, use
> > it to effectively apply one of the functions to it.  That makes for
> > a clean use of the type.
>
> OK.  Sounds good to me.  The only problem is display.  If we don't
> indicate whether it is a cidr or host/netmask on column creation or
> insertion, how do we display it so it makes sense?  Always cidr?

Well, I guess we just decide on a default format if it is not defined.
I think the default should be display as cidr (x.x.x.x/y) except omit
the mask length if it is 32 (or -1 if we go with that usage.)  Perhaps
make one of the defined types always display cidr even in thos special
cases.

> > I agree.  I'm just saying that we can add the netmask function to integer
> > as well.  That gives someone the flexibility to store it either way.
> > However, I don't think I am going to speak to this point again until
> > someone can give me a single example of a requirement for storing
> > netmasks independent of any hosts or networks.  :-)
>
> OK.  Why not?

I'm just saying that given that there isn't any useful situation where
we might want to store netmasks alone independent of IPs, I don't see
much point in arguing how many IPs can dance on the end of a netmask.

--
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] Re: [INTERFACES] ODBC Driver -- Access Order By problem solved!!!
Next
From: Egon Schmid
Date:
Subject: Compile of recent CVS fails