X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0573B55AD6 for ; Tue, 8 Mar 2005 21:47:47 +0000 (GMT) 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 08184-09 for ; Tue, 8 Mar 2005 21:47:38 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 3F33B55A07 for ; Tue, 8 Mar 2005 21:47:37 +0000 (GMT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1D8mYC-00045b-00; Wed, 09 Mar 2005 10:47:36 +1300 Message-ID: <422E1D76.6080307@opencloud.com> Date: Wed, 09 Mar 2005 10:47:34 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0 (X11/20041228) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Silvio Bierman Cc: PostgreSQL JDBC Subject: Re: FW: PreparedStatement#setString on non-string parameters References: In-Reply-To: X-Enigmail-Version: 0.89.5.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.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/76 X-Sequence-Number: 12468 Silvio Bierman wrote: > Either the JDBC drivers for the databases I mentioned earlier do the > conversion or the database backends do it on the server side. Any way, this > works in all cases. PostgreSQL is the first database to break our > application due to this behaviour. We have had problems on earlier versions > of MySQL because of lack of subselect support etc. but never these issues. I'd suggest using CAST in your SQL -- that in theory should work everywhere and reflects your application's intent (to interpret a string as a numeric value). The problem with reverting to the old way of doing parameters (direct text substitution into the query) is that we cannot take advantage of most of the new stuff in the V3 protocol -- that means no server-side prepared statement reuse, no low-overhead transfer of large parameters, and reduced support for cursor-based resultsets. -O