pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gaetano Mendola <mendola@bigfoot.com>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Cc: Devin Atencio <devin@burgoyne.com>
Subject: Re: Datatype Inet and Searching
Date: Wed, 03 Dec 2003 19:02:34 +0100
Message-ID: <3FCE253A.5010105@bigfoot.com> (raw)
In-Reply-To: <200312022353.hB2Nrnji023049@mail.burgoyne.com>
References: <200312022353.hB2Nrnji023049@mail.burgoyne.com>

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





view thread (3+ messages)  latest in thread

Message-ID: <3FCE253A.5010105@bigfoot.com>
Permalink:  ../3FCE253A.5010105@bigfoot.com/
Also on:    postgresql.org/message-id/3FCE253A.5010105@bigfoot.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mendola@bigfoot.com, devin@burgoyne.com
  Subject: Re: Datatype Inet and Searching
  In-Reply-To: <3FCE253A.5010105@bigfoot.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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