X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B21DED8480 for ; Fri, 30 Sep 2005 16:06:13 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 64889-04 for ; Fri, 30 Sep 2005 19:06:10 +0000 (GMT) Received: from mail.ev.net (unknown [132.235.215.234]) by svr1.postgresql.org (Postfix) with SMTP id 99616D7FC4 for ; Fri, 30 Sep 2005 16:06:09 -0300 (ADT) Received: (qmail 47148 invoked by uid 98); 30 Sep 2005 15:10:49 +0000 Received: from 192.168.1.64 by mail.ev.net (envelope-from , uid 98) with qmail-scanner-1.25 (clamdscan: 0.87/1082. Clear:RC:1(192.168.1.64):. Processed in 0.100812 secs); 30 Sep 2005 15:10:49 -0000 X-Qmail-Scanner-Mail-From: rfrancis@ev.net via mail.ev.net X-Qmail-Scanner: 1.25 (Clear:RC:1(192.168.1.64):. Processed in 0.100812 secs) Received: from unknown (HELO ?192.168.1.64?) (192.168.1.64) by mail.ev.net with SMTP; 30 Sep 2005 15:10:48 +0000 Message-ID: <433D8CA1.3050601@ev.net> Date: Fri, 30 Sep 2005 15:06:09 -0400 From: Russell Francis User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050404) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: queries against CIDR fail against 8.0.3? References: <433BE38F.3080605@ev.net> <433C7725.1040707@opencloud.com> In-Reply-To: <433C7725.1040707@opencloud.com> X-Enigmail-Version: 0.89.6.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200509/144 X-Sequence-Number: 13929 Oliver Jowett wrote: > Russell Francis wrote: > > You will need to either create a PGobject subclass that returns the > correct typename (cidr), or explicitly cast to cidr in your query: > > SELECT * FROM institution WHERE ( institution.network >>= ?::cidr ) > LIMIT 1 > > >>Does anyone have any ideas on how to address this issue? Or at least an >>explanation as to why it works in 7.3.9 but not 8.0.3? > > > The 8.0 drivers type parameters more strongly than earlier drivers due > to a change in the protocol used, so setObject(String) is passing the > parameter explicitly as a 'text' value not as an untyped literal that > gets implicitly casted to cidr. See the archives for more details. Oliver & Kris, Thanks much both of your responses were very helpful. I have decided to subclass PGobject to address the issue and have created a PGcidr class which seems to be working well. If there is any interest in adding this to the project, I would be happy to submit what I have for review and also provide PGinet and PGmacaddr classes to the core. Thanks again, Russ