From: Dave Cramer <pg@fastcrypt.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Oliver Jowett <oliver@opencloud.com>
Cc: Christian Cryder <c.s.cryder@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Timestamp Conversion Woes Redux
Date: Tue, 19 Jul 2005 11:22:09 -0400
Message-ID: <392278AB-987F-40CF-B59D-DDF53B9A4ACF@fastcrypt.com> (raw)
In-Reply-To: <23396.1121781259@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>
What about creating two extension classes
PGTimestamp, and PGTimestamptz
then allowing setObject to recognize these internally and bind to
Oid.Timestamp, and Oid.Timestamptz repectively
for setString I am in favour of using UNKNOWN as this is no worse
than what 7.4 drivers do now
Dave
On 19-Jul-05, at 9:54 AM, Tom Lane wrote:
> Oliver Jowett <oliver@opencloud.com> writes:
>
>> Dave Cramer wrote:
>>
>>> I'm also thinking we should use UNKOWN for setString as well,
>>> hopefully
>>> this would reduce the number of upgrade problems people are
>>> having when
>>> they upgrade from 7.x to 8.x
>>>
>
>
>> I still think this is a bad idea.
>>
>
> I think one main point against using UNKNOWN is that it creates a risk
> of "could not resolve parameter type" query failures. That's OK for
> generic setString() cases, since the user can always escape the
> failure
> by changing his code to specify the parameter type more clearly.
>
> The other argument against UNKNOWN is that the backend might choose an
> unexpected data type. Again, that doesn't scare me a lot for
> setString,
> because the backend's rules for dealing with UNKNOWN are biased in
> favor
> of resolving the parameter type as TEXT, which seems perfectly
> reasonable for setString cases.
>
> Unfortunately, both of these considerations speak *against* using
> UNKNOWN for Timestamp. If the backend rejects the query --- or more
> likely, makes the wrong datatype choice --- there will be no way for
> the user to fix it.
>
> So I'm in favor of using UNKNOWN for setString, but I think we gotta
> find another answer for Christian's problem.
>
> regards, tom lane
>
>
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, oliver@opencloud.com, c.s.cryder@gmail.com
Subject: Re: Timestamp Conversion Woes Redux
In-Reply-To: <392278AB-987F-40CF-B59D-DDF53B9A4ACF@fastcrypt.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> <392278AB-987F-40CF-B59D-DDF53B9A4ACF@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