Re: INET/CIDR types

Поиск
Список
Период
Сортировка
От darcy@druid.net (D'Arcy J.M. Cain)
Тема Re: INET/CIDR types
Дата
Msg-id m13GjIB-000AXgC@druid.net
обсуждение исходный текст
Ответ на INET/CIDR types  (Larry Rosenman <ler@lerctr.org>)
Ответы Re: INET/CIDR types  (Larry Rosenman <ler@lerctr.org>)
Список pgsql-hackers
Thus spake Larry Rosenman
> I noticed a discussion on this list about a re-do of the INET/CIDR
> types.   I was wondering if there was ANY way at all to add
> an output function that ALWAYS returns all 4 octets of an INET or CIDR
> type with and without the /netmask?
> 
> I'm writing a IP Allocation/Tracking app for the ISP I work for, and
> find the current output format causes confusion for the less
> technical types. 

The host() function does this for the INET type.  It doesn't work for
the CIDR type (it throws an error) because CIDR doesn't have a host
part per se.

darcy=> select '1.2.0.0/23'::inet;
?column?
--------
1.2.0/23
(1 row)

darcy=> select host('1.2.0.0/23'::inet);  host
-------
1.2.0.0
(1 row)

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Zeugswetter Andreas SB
Дата:
Сообщение: AW: libpgtcl on aix
Следующее
От: Larry Rosenman
Дата:
Сообщение: Re: INET/CIDR types