| От | Robert Haas |
|---|---|
| Тема | converting between netmask formats |
| Дата | |
| Msg-id | 603c8f070908201148y2e2c0fbcwf88c4f99a111827e@mail.gmail.com обсуждение исходный текст |
| Ответы |
Re: converting between netmask formats
|
| Список | pgsql-hackers |
I'm writing some code now that uses the inet and cidr types and I find myself wanting a function that takes an argument of type inet and returns an integer, where: 255.255.255.255 => 32 255.255.255.254 => 31 255.255.255.252 => 30 255.255.255.248 => 29 255.255.255.240 => 28 ... 128.0.0.0 => 1 0.0.0.0 => 0 ...and returning NULL for all other IPv4 IPs. We have the netmask() function that performs this computation in the other direction, but in this case I am trying to go the other way. Anyone else think this would be a useful addition? Anyone have a good idea for a name? parse_netmask()? ...Robert
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера