pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedembedded sql interface to ip address type
5+ messages / 3 participants
[nested] [flat]
* embedded sql interface to ip address type
@ 2003-03-21 06:41 Rob Fowler <postgres@mianos.com>
0 siblings, 1 reply; 5+ messages in thread
From: Rob Fowler @ 2003-03-21 06:41 UTC (permalink / raw)
To: pgsql-interfaces
Is there such thing? Is there an example? I have had no trouble with the
embedded sql until now. The documentation is a bit thin but it's so close to
everyone else's implementation it's a breeze, great work by the developers.
--
Rob Fowler
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: embedded sql interface to ip address type
@ 2003-03-21 15:06 Michael Meskes <meskes@postgresql.org>
parent: Rob Fowler <postgres@mianos.com>
0 siblings, 2 replies; 5+ messages in thread
From: Michael Meskes @ 2003-03-21 15:06 UTC (permalink / raw)
To: Rob Fowler <postgres@mianos.com>; +Cc: pgsql-interfaces
On Fri, Mar 21, 2003 at 05:41:12PM +1100, Rob Fowler wrote:
> Is there such thing? Is there an example? I have had no trouble with the
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.
I've just started working on a seperate lib to implement all the special types in C as well. But IP addresses is not on my todo list for the near future.
Michael
--
Michael Meskes
Email: Michael@Fam-Meskes.De
ICQ: 179140304
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: embedded sql interface to ip address type
@ 2003-03-22 02:27 Rob Fowler <postgres@mianos.com>
parent: Michael Meskes <meskes@postgresql.org>
1 sibling, 0 replies; 5+ messages in thread
From: Rob Fowler @ 2003-03-22 02:27 UTC (permalink / raw)
To: Michael Meskes <meskes@postgresql.org>; +Cc: 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.
Thanks for the answer Michael. That was exactly what I meant and your answer
was exactly what I needed. I thought I needed to bind the address structure
to the ipaddr column but that did not work so I changed the type to text and
converted the address to a char string. Now you tell me it's just text, I
went back and changed the database datatype to inet address and it's all
good.
--
Rob Fowler
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: embedded sql interface to ip address type
@ 2003-03-22 10:33 D'Arcy J.M. Cain <darcy@druid.net>
parent: Michael Meskes <meskes@postgresql.org>
1 sibling, 1 reply; 5+ messages in thread
From: D'Arcy J.M. Cain @ 2003-03-22 10:33 UTC (permalink / raw)
To: Michael Meskes <meskes@postgresql.org>; Rob Fowler <postgres@mianos.com>; +Cc: 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.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: embedded sql interface to ip address type
@ 2003-03-22 12:16 Michael Meskes <meskes@postgresql.org>
parent: D'Arcy J.M. Cain <darcy@druid.net>
0 siblings, 0 replies; 5+ messages in thread
From: Michael Meskes @ 2003-03-22 12:16 UTC (permalink / raw)
To: D'Arcy J.M. Cain <darcy@druid.net>; +Cc: Michael Meskes <meskes@postgresql.org>; Rob Fowler <postgres@mianos.com>; pgsql-interfaces
On Sat, Mar 22, 2003 at 05:33:30AM -0500, D'Arcy J.M. Cain wrote:
> > 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.
Yes, we have that in PGSQL, but not as a seperate C library. In C you
can only use char * so far. I'd like to have an implementation of CIDR
as C types as well.
Michael
--
Michael Meskes
Email: Michael@Fam-Meskes.De
ICQ: 179140304
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2003-03-22 12:16 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-03-21 06:41 embedded sql interface to ip address type Rob Fowler <postgres@mianos.com>
2003-03-21 15:06 ` Michael Meskes <meskes@postgresql.org>
2003-03-22 02:27 ` Rob Fowler <postgres@mianos.com>
2003-03-22 10:33 ` D'Arcy J.M. Cain <darcy@druid.net>
2003-03-22 12:16 ` Michael Meskes <meskes@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox