OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: mynetworks from database with pgsql - troubles with netmasks

From: Andrej Ricnik-Bay (andrej.groupsgmail.com)
Date: Wed May 10 2006 - 15:39:18 CDT


On 5/11/06, Victor Duchovni <Victor.Duchovnimorganstanley.com> wrote:

> The original (non-SQL) Postgres query language was capable of expressing
> containment relational operators for points in regions, ... and likely
> IP addresses in netblocks. With suitable extended relational operatators
> one can ask:
>
> select cidr.prefix from cidr where ip CONTAINED_IN cidr
>
> So this is in doable in principle, given the right database, but I have
> no experience with the query language of PostreSQL.
Looks to me like it can be done ...

http://www.postgresql.org/docs/7.2/static/datatype-net-types.html#DATATYPE-CIDR
http://www.pgadmin.org/docs/dev/pg/functions-net.html\

Cheers,
Andrej

--
Please don't top post, and don't use HTML e-Mail :} Make your quotes concise.

http://www.american.edu/econ/notes/htmlmail.htm