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

From Tom Lane
Subject Re: Summary: what to do about INET/CIDR
Date
Msg-id 6298.972701586@sss.pgh.pa.us
Whole thread Raw
In response to Re: Summary: what to do about INET/CIDR  (Alex Pilosov <alex@pilosoft.com>)
List pgsql-hackers
>>>> e) have a function network(inet) which would look up the address in a
>>>> table of networks using longest-prefix-match. I.E. something similar to:

>> No need.  Let the user do it themselves. Similar to what we did for
>> macaddr's back in the summer. 

> Yeah, it can be user-defined (or a contrib), no question about it, and for
> people who have more than one table of networks, it will _have_ to be
> user-defined.

It seems clear to me that this mapping is best left to the user.

A more interesting question is whether the system needs to provide any
assisting functions that aren't there now.  The lookup function you guys
are postulating seems like it would be (in the simple cases)create function my_network(inet) returns cidr as'select
networkfrom my_networks where ???'
 
Maybe it's too late at night, but I'm having a hard time visualizing
what the ??? condition is and whether any additional system-level
functions are needed to make it simple/efficient.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alex Pilosov
Date:
Subject: Re: Summary: what to do about INET/CIDR
Next
From: Alex Pilosov
Date:
Subject: Re: Summary: what to do about INET/CIDR