pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Cramer <pg@fastcrypt.com>
To: 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: Wed, 20 Jul 2005 08:47:47 -0400
Message-ID: <EFF1E178-E913-40B2-BB66-8A401925011E@fastcrypt.com> (raw)
In-Reply-To: <42DE43DF.5020708@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>
	<392278AB-987F-40CF-B59D-DDF53B9A4ACF@fastcrypt.com>
	<Pine.BSO.4.56.0507191100110.68@leary.csoft.net>
	<90876a9e050719093261c52c64@mail.gmail.com>
	<42DDABAE.7050009@opencloud.com>
	<15EA293E-6D5D-4FD2-B498-6546113822C1@fastcrypt.com>
	<42DDB0B0.1020006@opencloud.com>
	<468CE7D4-3BFC-48D8-BC94-3AA73950EBED@fastcrypt.com>
	<42DDBE3B.5040801@opencloud.com>
	<6E6559F0-401F-47E8-A756-245C5B0813A7@fastcrypt.com>
	<42DE43DF.5020708@opencloud.com>

Yes, it does, my mistake ( It was early here )

However reading the notes about setTimestamp:

When the DBMS does not store timezone information the driver will use  
cal to construct a JDBC Timestamp value.
If no Calendar object is specified the driver uses the timezone of  
the JVM.

Frustratingly it does not say what to do when the DBMS does not store  
timezone information. I guess one could infer that
if it doesn't store timezone information, then timezone information  
is ignored ?

Which puts us right back to the original problem... Two SQL types,  
and only one setTimestamp.

Onel way to deal with this is to find out what the underlying type  
is, or to define a different server type, and cast to deal with this  
appropriately. IE Oid.javatimestamp and the cast would be able to do  
the right thing based on the underlying type.

Dave
On 20-Jul-05, at 8:30 AM, Oliver Jowett wrote:

> Dave Cramer wrote:
>
>
>> In order to calculate the milliseconds the driver takes into  
>> account  the time zone, information the DBMS may or may not store.  
>> If no  Calendar object is supplied the driver will use the default  
>> Calendar  whose time zone is that of the JVM that is
>> running the application. If the DBMS does provide timezone   
>> information the driver will simply use that and IGNORE (my caps)  
>> a  Calendar object that may have been passed to it.
>>
>
> Not having read the source material, but isn't this talking about  
> the getTimestamp() path not the setTimestamp() path?
>
> -O
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>               http://archives.postgresql.org
>
>




view thread (92+ messages)  latest in thread

Message-ID: <EFF1E178-E913-40B2-BB66-8A401925011E@fastcrypt.com>
Permalink:  ../EFF1E178-E913-40B2-BB66-8A401925011E@fastcrypt.com/
Also on:    postgresql.org/message-id/EFF1E178-E913-40B2-BB66-8A401925011E@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, oliver@opencloud.com, c.s.cryder@gmail.com
  Subject: Re: Timestamp Conversion Woes Redux
  In-Reply-To: <EFF1E178-E913-40B2-BB66-8A401925011E@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> <Pine.BSO.4.56.0507191100110.68@leary.csoft.net> <90876a9e050719093261c52c64@mail.gmail.com> <42DDABAE.7050009@opencloud.com> <15EA293E-6D5D-4FD2-B498-6546113822C1@fastcrypt.com> <42DDB0B0.1020006@opencloud.com> <468CE7D4-3BFC-48D8-BC94-3AA73950EBED@fastcrypt.com> <42DDBE3B.5040801@opencloud.com> <6E6559F0-401F-47E8-A756-245C5B0813A7@fastcrypt.com> <42DE43DF.5020708@opencloud.com> <EFF1E178-E913-40B2-BB66-8A401925011E@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