pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Mark Lewis <mark.lewis@mir3.com>
Cc: Tjioe Ai Xin <xinxincute@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Can PostgreSQL do data type automated casting in	prepared
Date: Mon, 21 Nov 2005 19:28:00 -0500 (EST)
Message-ID: <Pine.BSO.4.61.0511211926360.32@leary.csoft.net> (raw)
In-Reply-To: <1132616246.4154.10.camel@archimedes>
References: <200511211718.26679.xinxincute@gmail.com>
	<Pine.BSO.4.61.0511211806430.23994@leary.csoft.net>
	<1132616246.4154.10.camel@archimedes>



On Mon, 21 Nov 2005, Mark Lewis wrote:

> Here's a thought; do you think it's feasible to detect cases where the
> protocol=3 driver throws an error due to invalid or ambiguous typing
> issues when the protocol=2 driver would just do the expected thing?
>
> Instead of throwing the error back to the user, could the driver then
> issue a 'describe statement' call, use the result to disambiguate the
> parameter settings, and re-issue the call?  It increases the overhead
> but only for the error cases, and the result could be cached to avoid
> repeating that overhead.
>

There a number of problems with the fallback approach.  First, since we've 
got a server error that will necessitate the transaction be rolled back so 
we'd have to establish a savepoint before every statement.  Then you'd 
have to detect an error condition as being related to type resolution 
which isn't really clear.  Even if this did work for people it certainly 
wouldn't be optimal because you could end up doing a lot more work, 
parsing twice and establishing and rolling back to savepoint, without 
knowing it.  Your application would look like it was working, but it's 
certainly not how you want it to.

Kris Jurka




view thread (20+ messages)  latest in thread

Message-ID: <Pine.BSO.4.61.0511211926360.32@leary.csoft.net>
Permalink:  ../Pine.BSO.4.61.0511211926360.32@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.61.0511211926360.32@leary.csoft.net

 · 

reply

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: books@ejurka.com, mark.lewis@mir3.com, xinxincute@gmail.com
  Subject: Re: Can PostgreSQL do data type automated casting in	prepared
  In-Reply-To: <Pine.BSO.4.61.0511211926360.32@leary.csoft.net>
  References: <200511211718.26679.xinxincute@gmail.com> <Pine.BSO.4.61.0511211806430.23994@leary.csoft.net> <1132616246.4154.10.camel@archimedes> <Pine.BSO.4.61.0511211926360.32@leary.csoft.net>

* 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