On Fri, 27 Oct 2000, Tom Lane wrote: > 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 network from my_networks where ???' as in my mail: select network from my_network where network>>$1 order by network_prefix(network) desc limit 1; (i.e. if many networks cover the ip address, pick the one with longest prefix). The only hard question here, how to properly index this table. This sounds like a perfect application of user-defined index method. I need to look up documentation on how they work... However, this probably won't pose a major problem in production: the networks table will be relatively small. > 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. Actually, you can scratch my proposal. I realise it could be inconvenient for some people. I'll be probably putting all my hosts as inet::xxx/32, have the above lookup function to get real network, and do operations on that.
- Re: [HACKERS] Summary: what to do about INE... Larry Rosenman
- Re: [HACKERS] Summary: what to do about INE... Alex Pilosov
- Re: [HACKERS] Summary: what to do about INE... Larry Rosenman
- Re: [HACKERS] Summary: what to do about INE... Tom Lane
- Re: [HACKERS] Summary: what to do about INE... Larry Rosenman
- Re: [HACKERS] Summary: what to do about INE... Larry Rosenman
- Re: [HACKERS] Summary: what to do about INE... Tom Lane
- Re: [HACKERS] Summary: what to do about INE... Larry Rosenman
- Re: [HACKERS] Summary: what to do about INE... Alex Pilosov
- Re: [HACKERS] Summary: what to do about INE... Larry Rosenman
- Re: [HACKERS] Summary: what to do about INE... Alex Pilosov
- Re: [HACKERS] Summary: what to do about INE... Alex Pilosov
- Re: [HACKERS] Summary: what to do about INE... Tom Lane
- Re: [HACKERS] Summary: what to do about INE... Larry Rosenman
- [HACKERS] Second proposal: what to do about... Tom Lane
- [HACKERS] Re: Second proposal: what to do a... Larry Rosenman
- [HACKERS] Re: Second proposal: what to do a... Peter Eisentraut
- [HACKERS] Re: Second proposal: what to do a... Tom Lane
- Re: [HACKERS] Summary: what to do about INE... Dominic J. Eidson
- Re: [HACKERS] Summary: what to do about INET/CIDR Tom Lane
- Re: [HACKERS] Summary: what to do about INET/CIDR Alex Pilosov