Re: [HACKERS] Re: inet/cidr/bind

From: darcy(at)druid(dot)net (D'Arcy J(dot)M(dot) Cain)
To: maillist(at)candle(dot)pha(dot)pa(dot)us (Bruce Momjian)
Cc: paul(at)vix(dot)com, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Re: inet/cidr/bind
Date: 1998-10-19 11:59:21
Message-ID: m0zVDy5-0000emC@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thus spake Bruce Momjian
> Sorry, but I just have to ask. I am not sure what the issues are, but
> it is possible to have them all be the same type. Have a netmask field
> inside the type and a cidr field inside the type, and just use one of
> them at a time for any given entry? Only one byte each, right? I sure
> would like to avoid "type/function bloat". Also, could a RULE be
> created to simulate the network restriction Paul requires?
>
> Maybe it is clearer to have two types, with different purposes. I am
> just asking, and if people are going to need functions to convert
> between the two types, it may be worth merging them. I was thinking you
> could display them differently based on which field they used.

I can think of two possibilities. I thought of this before for other
purposes but I never asked about it. Can we set up inet_in to take
a second argument? If so then we can set up two types but set them
up such that one calls the in function with 0 and one with 1. We
would store that value in a new field in the structure and check
that for every other function where necessary.

If not then we can do the same thing by creating two wrapper input
functions which call the one I have described with the extra argument.
Almost as good.

If this makes sense I suggest we go forward with our existing plan and
look to fold it after 6.4. It's minor bloat for now and it would
simplify getting everything in there.

--
D'Arcy J.M. Cain <darcy(at){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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message D'Arcy J.M. Cain 1998-10-19 12:44:57 Re: [HACKERS] Re: inet/cidr/bind
Previous Message Alexey Ugnichev 1998-10-19 11:13:32 Very sorry - testing...