> What exactly do you mean? A C type for IP addresses? That doesn't
> exist. Right now this type has to be stored in character strings.
You mean base types written in C? We certainly do.
darcy=# select '123.4.5.6'::inet << '123.4.5.0/24'::cidr;?column?
----------t
(1 row)
darcy=# select '123.4.5.6'::inet << '123.4.6.0/24'::cidr;?column?
----------f
(1 row)
The above says that the IP address 123.4.5.6 is in the CIDR block 123.4.5.0/24
but not in 123.4.6.0/24.
We also have a MAC address type. See the documentation pages at
http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=datatype-net-types.html
and
http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=functions-net.html
for details.
--
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.