Search Postgresql Archives

Re: plPgSQL + CDIR/INET types ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mar 30, 2010, at 7:09 PM, Marc G. Fournier wrote:

> 
> Has anyone either played with, or gotten to work, a plPgSQL function that would take:  192.168.1.1/24 and determine the start and end IP from that? Or even start IP + # of IPs in the subnet?

If that was a valid cidr value (like 192.168.1.0/24) you could just use host() or broadcast() to get the first and last addresses (and subtraction to get the size of the subnet).

You could probably convert it to the equivalent cidr range with some combo of set_masklen() and masklen().

Cheers,
  Steve




-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux