X-Original-To: pgsql-interfaces@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 339A7474E4F; Sat, 22 Mar 2003 05:33:30 -0500 (EST) Received: from druid.net (druid.net [216.126.72.98]) by postgresql.org (Postfix) with ESMTP id DA77D474E44; Sat, 22 Mar 2003 05:33:29 -0500 (EST) Received: by druid.net (Postfix, from userid 1000) id 964811CA3; Sat, 22 Mar 2003 05:33:31 -0500 (EST) Content-Type: text/plain; charset="iso-8859-1" From: "D'Arcy J.M. Cain" To: Michael Meskes , Rob Fowler Subject: Re: embedded sql interface to ip address type Date: Sat, 22 Mar 2003 05:33:30 -0500 User-Agent: KMail/1.4.3 Cc: pgsql-interfaces@postgresql.org References: <20030321064112.GA5117@firewall.keta.mine.nu> <20030321150648.GB27690@feivel.fam-meskes.de> In-Reply-To: <20030321150648.GB27690@feivel.fam-meskes.de> MIME-Version: 1.0 Message-Id: <200303220533.30512.darcy@druid.net> Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-25.4 required=5.0 tests=IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES, USER_AGENT_KMAIL autolearn=ham version=2.50-cvs X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50-cvs (1.172-2003-02-14-exp) X-Archive-Number: 200303/133 X-Sequence-Number: 3882 > 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=3D# select '123.4.5.6'::inet << '123.4.5.0/24'::cidr; ?column? ---------- t (1 row) darcy=3D# 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=20 but not in 123.4.6.0/24. We also have a MAC address type. See the documentation pages at=20 http://www.postgresql.org/docs/view.php?version=3D7.3&idoc=3D0&file=3Ddatat= ype-net-types.html=20 and=20=20 http://www.postgresql.org/docs/view.php?version=3D7.3&idoc=3D0&file=3Dfunct= ions-net.html=20 for details. --=20 D'Arcy J.M. Cain | 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.