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

Поиск
Список
Период
Сортировка
От darcy@druid.net (D'Arcy J.M. Cain)
Тема Re: [HACKERS] Re: inet/cidr/bind
Дата
Msg-id m0zVDy5-0000emC@druid.net
обсуждение исходный текст
Ответ на Re: [HACKERS] Re: inet/cidr/bind  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список 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@{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 по дате отправления:

Предыдущее
От: Sferacarta Software
Дата:
Сообщение: using indexes
Следующее
От: darcy@druid.net (D'Arcy J.M. Cain)
Дата:
Сообщение: Re: [HACKERS] Re: inet/cidr/bind