Re: embedded sql interface to ip address type - Mailing list pgsql-interfaces

From D'Arcy J.M. Cain
Subject Re: embedded sql interface to ip address type
Date
Msg-id 200303220533.30512.darcy@druid.net
Whole thread Raw
In response to Re: embedded sql interface to ip address type  (Michael Meskes <meskes@postgresql.org>)
Responses Re: embedded sql interface to ip address type  (Michael Meskes <meskes@postgresql.org>)
List pgsql-interfaces
> 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.



pgsql-interfaces by date:

Previous
From: Tom Lane
Date:
Subject: Re: persistent variables between cross-calls in C functions
Next
From: Michael Meskes
Date:
Subject: Re: esql problem