Re: plPgSQL + CDIR/INET types ...

Поиск
Список
Период
Сортировка
От Steve Atkins
Тема Re: plPgSQL + CDIR/INET types ...
Дата
Msg-id FC4FC602-BC26-4653-A971-817A3DD4B995@blighty.com
обсуждение исходный текст
Ответ на plPgSQL + CDIR/INET types ...  ("Marc G. Fournier" <scrappy@hub.org>)
Список 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 по дате отправления:

Предыдущее
От: "Marc G. Fournier"
Дата:
Сообщение: plPgSQL + CDIR/INET types ...
Следующее
От: Wojtek
Дата:
Сообщение: Unsubscribe