Re: plPgSQL + CDIR/INET types ... - Mailing list pgsql-general

From Steve Atkins
Subject Re: plPgSQL + CDIR/INET types ...
Date
Msg-id FC4FC602-BC26-4653-A971-817A3DD4B995@blighty.com
Whole thread Raw
In response to plPgSQL + CDIR/INET types ...  ("Marc G. Fournier" <scrappy@hub.org>)
List pgsql-general
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
thestart 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




pgsql-general by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: plPgSQL + CDIR/INET types ...
Next
From: Wojtek
Date:
Subject: Unsubscribe