pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: Christian Cryder <c.s.cryder@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Timestamp Conversion Woes Redux
Date: Wed, 20 Jul 2005 10:58:17 +1200
Message-ID: <42DD8589.2070906@opencloud.com> (raw)
In-Reply-To: <23729.1121783651@sss.pgh.pa.us>
References: <90876a9e05071810503606d431@mail.gmail.com>
	<16335.1121714809@sss.pgh.pa.us>
	<10C90079-DD0A-43D7-9389-7486803F0AB1@fastcrypt.com>
	<42DC37AC.5030704@opencloud.com>
	<C36F2D5F-093E-489C-8D6F-A67B746EA6C8@fastcrypt.com>
	<42DCF0C9.4030501@opencloud.com>
	<23396.1121781259@sss.pgh.pa.us>
	<42DD0824.9060002@opencloud.com>
	<23729.1121783651@sss.pgh.pa.us>

Tom Lane wrote:

> My previous response was based on what was in my inbox, which I now see
> wasn't the whole thread.  I agree with you that if we make setString
> default to UNKNOWN, there had better be a way to say "by golly this
> really is TEXT" for the corner cases.  It'd be a good idea if it wasn't
> limited to TEXT, either, but could allow specification of any random
> datatype.

We already have a mechanism for setting values of arbitary type: pass a
PGobject implementation to setObject(). We could extend this easily so
that passing a String with Types.UNKNOWN is a shorthand for passing a
PGobject with a type of 'unknown'.

It seems very odd to have a situation where the standard JDBC way of
setting a VARCHAR parameter -- setString -- sometimes doesn't work and
you have to go and use a non-standardi postgresql-specific method to say
"no, really, this *is* VARCHAR".

If we change setString() then we've gone from the existing case where
correct applications work and broken applications break, to a situation
where some correct applications do *not* work and must add this
nonstandard code to continue to work, and broken applications have the
breakage hidden.

I can understand why people want this from the perspective of supporting
existing apps that expect implicit casting of string parameters, but
from a driver-correctness and new-development perspective it seems all
wrong.

Maybe a driver URL parameter that changes the behaviour of setString()
is a reasonable compromise between the two?

-O



view thread (92+ messages)  latest in thread

Message-ID: <42DD8589.2070906@opencloud.com>
Permalink:  ../42DD8589.2070906@opencloud.com/
Also on:    postgresql.org/message-id/42DD8589.2070906@opencloud.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: oliver@opencloud.com, tgl@sss.pgh.pa.us, pg@fastcrypt.com, c.s.cryder@gmail.com
  Subject: Re: Timestamp Conversion Woes Redux
  In-Reply-To: <42DD8589.2070906@opencloud.com>
  References: <90876a9e05071810503606d431@mail.gmail.com> <16335.1121714809@sss.pgh.pa.us> <10C90079-DD0A-43D7-9389-7486803F0AB1@fastcrypt.com> <42DC37AC.5030704@opencloud.com> <C36F2D5F-093E-489C-8D6F-A67B746EA6C8@fastcrypt.com> <42DCF0C9.4030501@opencloud.com> <23396.1121781259@sss.pgh.pa.us> <42DD0824.9060002@opencloud.com> <23729.1121783651@sss.pgh.pa.us> <42DD8589.2070906@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