Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 0A42A634FBD for ; Thu, 26 Feb 2009 22:04:21 -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 71033-03-3 for ; Thu, 26 Feb 2009 22:04:16 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.225]) by mail.postgresql.org (Postfix) with ESMTP id EB8CD634DA3 for ; Thu, 26 Feb 2009 22:04:16 -0400 (AST) Received: by rv-out-0506.google.com with SMTP id f6so823636rvb.43 for ; Thu, 26 Feb 2009 18:04:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.174.18 with SMTP id w18mr971251wfe.239.1235700254337; Thu, 26 Feb 2009 18:04:14 -0800 (PST) In-Reply-To: <16b031c0902260836p5577e667jdbf120eb07998ef7@mail.gmail.com> References: <8f750b7c0902260233q639be440qafce23613d9d77db@mail.gmail.com> <16b031c0902260836p5577e667jdbf120eb07998ef7@mail.gmail.com> Date: Fri, 27 Feb 2009 10:04:14 +0800 Message-ID: <8f750b7c0902261804g20c5f90ax33e95a748ec18835@mail.gmail.com> Subject: Re: index for inet(ip address or ip range) From: Tony Liao To: Lee Azzarello Cc: pgsql-admin@postgresql.org Content-Type: multipart/alternative; boundary=000e0cd32d06b569730463dce298 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001, NORMAL_HTTP_TO_IP=0.001 X-Spam-Level: X-Archive-Number: 200902/253 X-Sequence-Number: 31474 --000e0cd32d06b569730463dce298 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit hi,lee CIDR is only accept ipv4 but not ip range such as 192.168.1.0/24. INET type is what I need,but I don't know how to create index. does anyone have ideas? 2009/2/27 Lee Azzarello > On Thu, Feb 26, 2009 at 5:33 AM, Tony Liao wrote: > > hello,everybody > > 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 > range. > > The query would do select ....... where ip1>>='96.168.65.84' or > > ip2>>='96.168.65.84'. > > does anyone have ideas? > > The ipv4 type can accept CIDR blocks. Would that work for you? > > -lee > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin > --000e0cd32d06b569730463dce298 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable hi,lee
=A0=A0=A0=A0=A0=A0=A0 CIDR is only accept ipv4 but not ip range s= uch as 192.168.1.0/24.
=A0=A0=A0= =A0=A0=A0=A0 INET type is what I need,but I don't know how to create in= dex.
=A0=A0=A0=A0=A0=A0=A0 does anyone have ideas?


--000e0cd32d06b569730463dce298--