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 061F7528D5 for ; Tue, 28 Jun 2005 19:29:15 -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 67451-06 for ; Tue, 28 Jun 2005 22:29:13 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 7953252806 for ; Tue, 28 Jun 2005 19:29:13 -0300 (ADT) 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 (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DnOZt-0001Ca-3Z; Wed, 29 Jun 2005 10:29:13 +1200 Message-ID: <42C1CF38.9010603@opencloud.com> Date: Wed, 29 Jun 2005 10:29:12 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Byron Nikolaidis Cc: Dave Cramer , pgsql-jdbc@postgresql.org Subject: Re: prepared statement incompatibility References: <6E0907A94904D94B99D7F387E08C4F57073222@FALCON.INSIGHT> In-Reply-To: <6E0907A94904D94B99D7F387E08C4F57073222@FALCON.INSIGHT> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit 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: 200506/151 X-Sequence-Number: 13113 Byron Nikolaidis wrote: > But with the previous driver, we were actually using protocol version 3, > so it doesn’t appear that the driver strictness is actually directly > related to protocol version 3. I’m curious as to what is it that > actually changed in the 8.x drivers and why? It *is* related to use of protocol version 3. However the 7.4-era drivers used the simple query protocol which doesn't let you parameterize queries, and did parameter substitution on the driver side -- this was basically a dumb translation of the v2 code. The 8.0-era drivers use the v3 extended query protocol to parameterize queries and bind parameters, even when the resulting statement is not preserved (i.e. prepareThreshold has not been reached). This requires supplying types for each parameter, and the driver believes what you tell it at the JDBC layer. You then get into trouble with the backend's strict typing rules. See http://www.postgresql.org/docs/8.0/static/protocol.html for protocol docs -- compare "simple query" vs "extended query". > Would it be possible to add a connection property to control just this > strict type behavior, something like “strictTypes=false” ? Not easily, see the archives for previous discussion. Passing "unknown type" for a String parameter doesn't always work and has the potential to hide real errors. -O