Re: JOINing based on whether an IP address is contained within a CIDR range?

From: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
To: "Harald Fuchs" <hf0217x(at)protecting(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: JOINing based on whether an IP address is contained within a CIDR range?
Date: 2007-10-26 12:03:25
Message-ID: 36e682920710260503w79ebde81la456bdefd304da5a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 10/26/07, Harald Fuchs <hf0217x(at)protecting(dot)net> wrote:
> There are PostgreSQL builtin functions for that, but I think they are
> unable to use indexes. I use http://pgfoundry.org/projects/ip4r/
> and I think it's the best thing since the invention of sliced bread ;-)

Yes:

ip4r('ip') <<= ip4r(cidr('cidr'))

--
Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
499 Thornall Street, 2nd Floor | jonah(dot)harris(at)enterprisedb(dot)com
Edison, NJ 08837 | http://www.enterprisedb.com/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Chuck D. 2007-10-26 16:29:56 Re: request for help with COPY syntax
Previous Message Harald Fuchs 2007-10-26 11:44:14 Re: JOINing based on whether an IP address is contained within a CIDR range?