X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 62E5ED1B4B1 for ; Tue, 2 Dec 2003 23:50:54 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 22520-06 for ; Tue, 2 Dec 2003 19:50:30 -0400 (AST) Received: from mail.burgoyne.com (mail.burgoyne.com [209.197.0.15]) by svr1.postgresql.org (Postfix) with ESMTP id E1AA5D1D0AE for ; Tue, 2 Dec 2003 19:50:22 -0400 (AST) Received: from DEVINLAPTOP (bci-techs.burgoyne.com [209.197.7.250]) by mail.burgoyne.com (8.12.6/8.12.6/Debian-7) with ESMTP id hB2Nrnji023049 for ; Tue, 2 Dec 2003 16:53:52 -0700 Message-Id: <200312022353.hB2Nrnji023049@mail.burgoyne.com> From: "Devin Atencio" To: Subject: Datatype Inet and Searching Date: Tue, 2 Dec 2003 16:50:28 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_002D_01C3B8F4.63EC2FE0" X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Thread-Index: AcO5LxAJMT/4FEBLSyW+HCI29yd8jA== X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=2.3 tagged_above=0.0 required=5.0 tests=FORGED_MUA_OUTLOOK, HTML_60_70, MISSING_OUTLOOK_NAME X-Spam-Level: ** X-Archive-Number: 200312/24 X-Sequence-Number: 16190 This is a multi-part message in MIME format. ------=_NextPart_000_002D_01C3B8F4.63EC2FE0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Dear Users, I am very new to using the inet data type and I have a database with a list of CIDRs in it And I was hoping to be able to do some kind of select statement that would pull the record That the IP given is located in for example. If in my database I have a record like: Id cidr name 1 10.0.0.0/30 user1 2 10.0.0.4/30 user2 3 10.0.0.8/30 user3 I was hoping to be able to do something like: Select * from mytable where cidr <<='10.0.0.5' And the database would return only record 2 since it knows that 10.0.0.5 is contained only within record 2. I can't seem to figure out the correct syntax to make this type of query happen. Any help would greatly Be appreciated. Devin Atencio ------=_NextPart_000_002D_01C3B8F4.63EC2FE0 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

 

Dear Users,

 

I am very new to using the inet data type and I have a database with a list of CIDRs in it

And I was hoping to be able to do some kind of select statement that would pull the record

That the IP given is located in for example. If in my database I have a record like:

 

Id         = cidr            &nb= sp;      name

1          = 10.0.0.0/30        user1

2          = 10.0.0.4/30        user2

3          = 10.0.0.8/30        user3

 

I was hoping to be able to do something like:=

Select * from mytable where cidr <<=3D’10.0.= 0.5’

 

And the database would return only record 2 since it kno= ws that 10.0.0.5 is contained only within record 2.

I can’t seem to figure out the correct syntax to m= ake this type of query happen. Any help would greatly<= /p>

Be appreciated.

 

Devin Atencio

------=_NextPart_000_002D_01C3B8F4.63EC2FE0--