Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id B9187634DA3 for ; Thu, 26 Feb 2009 12:57:39 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 79763-04 for ; Thu, 26 Feb 2009 12:57:37 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by mail.postgresql.org (Postfix) with ESMTP id 090286340EE for ; Thu, 26 Feb 2009 12:57:36 -0400 (AST) Received: by qw-out-2122.google.com with SMTP id 5so590666qwd.61 for ; Thu, 26 Feb 2009 08:57:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.82.68 with SMTP id a4mr1158423qcl.18.1235666196417; Thu, 26 Feb 2009 08:36:36 -0800 (PST) In-Reply-To: <8f750b7c0902260233q639be440qafce23613d9d77db@mail.gmail.com> References: <8f750b7c0902260233q639be440qafce23613d9d77db@mail.gmail.com> Date: Thu, 26 Feb 2009 11:36:36 -0500 Message-ID: <16b031c0902260836p5577e667jdbf120eb07998ef7@mail.gmail.com> Subject: Re: index for inet(ip address or ip range) From: Lee Azzarello To: pgsql-admin@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200902/242 X-Sequence-Number: 31463 On Thu, Feb 26, 2009 at 5:33 AM, Tony Liao wrote: > hello,everybody > =A0=A0=A0=A0=A0=A0=A0=A0=A0 I want to create index for column ip1 and ip2= .I know there is a > contrib name ip4r.but the column ip1(ip2) would be a ip address or ip ran= ge. > =A0=A0=A0=A0=A0=A0=A0=A0=A0 The query would do select ....... where ip1>>= =3D'96.168.65.84' or > ip2>>=3D'96.168.65.84'. > =A0=A0=A0=A0=A0=A0=A0=A0=A0 does anyone have ideas? The ipv4 type can accept CIDR blocks. Would that work for you? -lee