pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Cramer <pg@fastcrypt.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kris Jurka <books@ejurka.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: use of OID.Unknown
Date: Tue, 8 Nov 2005 17:57:20 -0500
Message-ID: <5BDF1E2A-B7FB-4B91-9154-590F3FED0249@fastcrypt.com> (raw)
In-Reply-To: <7620.1131475925@sss.pgh.pa.us>
References: <A9FB7703-8451-4B03-AC70-178F793DF78E@fastcrypt.com>
	<Pine.BSO.4.61.0511081208530.3766@leary.csoft.net>
	<22E34B35-1D29-4DCD-BF81-8AF3CFEAC94B@fastcrypt.com>
	<Pine.BSO.4.61.0511081318120.13491@leary.csoft.net>
	<7620.1131475925@sss.pgh.pa.us>


On 8-Nov-05, at 1:52 PM, Tom Lane wrote:

> Kris Jurka <books@ejurka.com> writes:
>> I don't think this is a simple switch we should throw in a minor  
>> revision
>> either.  The real source of our problems is that for performance  
>> reasons
>> we never issue a Describe Statement protocol message.
>
> No, I don't think that's the issue; the part that I'm worried about is
> this one:
>
>> Finally there are a few cases where the server simply cannot  
>> resolve the
>> provided type and bails out with an error message.  If using the JDBC
>> setXXX provided types, these work.  Consider "SELECT ? IS NULL" or an
>> overloaded function that cannot be resolved.
>
> Sending UNKNOWN creates a risk that the server will barf because it
> can't guess the right data type.
>
> Now, if you are proposing to send a parameter marked UNKNOWN in  
> exactly
> the same cases where the previous driver release would have sent an
> undecorated string literal, then I'm mostly OK with it --- the  
> behavior
> at least won't be a regression, because an undecorated string literal
> is also taken as UNKNOWN to start with.

At this point that is what I would be advocating. It appears that  
using UNKNOWN for the general
case is fraught with problems. Previously we had advocated using  
setString for postgres types which do not have
jdbc counterparts such as inet, or interval. The current driver  
breaks this behaviour.
>
> I remembered what it was that was nagging me about having seen this
> before --- didn't we try using UNKNOWN to avoid having to choose  
> between
> timestamp with/without time zone, and didn't that idea crash and burn?
> It'd be a good idea to go back and look at the details before thinking
> of adopting UNKNOWN in a more general context.

Agreed.
>
> 			regards, tom lane
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match
>




view thread (14+ messages)  latest in thread

Message-ID: <5BDF1E2A-B7FB-4B91-9154-590F3FED0249@fastcrypt.com>
Permalink:  ../5BDF1E2A-B7FB-4B91-9154-590F3FED0249@fastcrypt.com/
Also on:    postgresql.org/message-id/5BDF1E2A-B7FB-4B91-9154-590F3FED0249@fastcrypt.com

 · 

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: pg@fastcrypt.com, tgl@sss.pgh.pa.us, books@ejurka.com
  Subject: Re: use of OID.Unknown
  In-Reply-To: <5BDF1E2A-B7FB-4B91-9154-590F3FED0249@fastcrypt.com>
  References: <A9FB7703-8451-4B03-AC70-178F793DF78E@fastcrypt.com> <Pine.BSO.4.61.0511081208530.3766@leary.csoft.net> <22E34B35-1D29-4DCD-BF81-8AF3CFEAC94B@fastcrypt.com> <Pine.BSO.4.61.0511081318120.13491@leary.csoft.net> <7620.1131475925@sss.pgh.pa.us> <5BDF1E2A-B7FB-4B91-9154-590F3FED0249@fastcrypt.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