Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 2AE279FC70C for ; Fri, 26 Oct 2007 09:03:32 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 95078-07 for ; Fri, 26 Oct 2007 09:03:27 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.226]) by postgresql.org (Postfix) with ESMTP id 800639FC538 for ; Fri, 26 Oct 2007 09:03:27 -0300 (ADT) Received: by nz-out-0506.google.com with SMTP id l8so705654nzf for ; Fri, 26 Oct 2007 05:03:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=lSNNs94+rK7VB/Tt8jM+IGGD36ClOT4lTgN0W5IZbH8=; b=KD8Wih3w5GxiqUM3APV/X2Ijlge2sVbpr9bx4JHS+P6OG9rNxcn2BB9OKRjoytWSREMdBzFz8r0nXtDwJaleHsA1rMEH/CtfT4Y8SpJ2gdrJVMnGZB2JLvmhlG4Zy70gl88NIOPULImfyea23q8EDFALyfiH6hhF+shHkelrYGc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ojMlb9mhrY4GzcZGZWTZ8hUXomroNIllsJ6EFGrTiCt0ggUi+Cz44raGshosURQ2e8UHXZttIwJDBDfuC8KF3bXevuH7WqwnC9OTuF0FjYO6aaj7BP8DIWYuioPXKuYbyKcpT3cORx2l+NnvefKwsOuCZ6QfY3IGPmkpMxpcgtA= Received: by 10.142.226.2 with SMTP id y2mr798425wfg.1193400205489; Fri, 26 Oct 2007 05:03:25 -0700 (PDT) Received: by 10.143.19.7 with HTTP; Fri, 26 Oct 2007 05:03:25 -0700 (PDT) Message-ID: <36e682920710260503w79ebde81la456bdefd304da5a@mail.gmail.com> Date: Fri, 26 Oct 2007 08:03:25 -0400 From: "Jonah H. Harris" To: "Harald Fuchs" Subject: Re: JOINing based on whether an IP address is contained within a CIDR range? Cc: pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/133 X-Sequence-Number: 29505 On 10/26/07, Harald Fuchs 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.harris@enterprisedb.com Edison, NJ 08837 | http://www.enterprisedb.com/