From: Oliver Jowett <oliver@opencloud.com>
To: Byron Nikolaidis <ByronN@routescape.com>
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: prepared statement incompatibility
Date: Wed, 29 Jun 2005 10:29:12 +1200
Message-ID: <42C1CF38.9010603@opencloud.com> (raw)
In-Reply-To: <6E0907A94904D94B99D7F387E08C4F57073222@FALCON.INSIGHT>
References: <6E0907A94904D94B99D7F387E08C4F57073222@FALCON.INSIGHT>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: oliver@opencloud.com, ByronN@routescape.com, pg@fastcrypt.com
Subject: Re: prepared statement incompatibility
In-Reply-To: <42C1CF38.9010603@opencloud.com>
References: <6E0907A94904D94B99D7F387E08C4F57073222@FALCON.INSIGHT> <42C1CF38.9010603@opencloud.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox