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 35822D1B8BB for ; Wed, 3 Dec 2003 18:03:47 +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 74780-01 for ; Wed, 3 Dec 2003 14:03:16 -0400 (AST) Received: from sardegna.mbigroup.it (unknown [151.8.40.3]) by svr1.postgresql.org (Postfix) with ESMTP id 8C1E7D1B432 for ; Wed, 3 Dec 2003 14:03:13 -0400 (AST) Received: from sicilia.pisa.mbigroup.it (localhost [127.0.0.1]) by sardegna.mbigroup.it (8.11.6/8.8.7) with ESMTP id hB3I2xo23060; Wed, 3 Dec 2003 19:02:59 +0100 Received: from bigfoot.com (canarie.pisa.mbigroup.it [192.168.9.30]) by sicilia.pisa.mbigroup.it (8.11.6/8.11.6) with ESMTP id hB3I2t316603; Wed, 3 Dec 2003 19:02:55 +0100 Message-ID: <3FCE253A.5010105@bigfoot.com> Date: Wed, 03 Dec 2003 19:02:34 +0100 From: Gaetano Mendola User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "pgsql-sql@postgresql.org" Cc: Devin Atencio Subject: Re: Datatype Inet and Searching References: <200312022353.hB2Nrnji023049@mail.burgoyne.com> In-Reply-To: <200312022353.hB2Nrnji023049@mail.burgoyne.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/30 X-Sequence-Number: 16196 Devin Atencio wrote: > > > 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’ select * from mytable where cider >>= '10.0.0.5' The operation a >>= b mean: a contain or is equal b. Regards Gaetano Mendola