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: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: work in progress: timestamp patch
Date: Mon, 25 Jul 2005 23:28:09 -0400
Message-ID: <7E3F468F-93C8-4082-9248-B9B52020E5F9@fastcrypt.com> (raw)
In-Reply-To: <42E5ABD8.1080608@opencloud.com>
References: <42E57D80.4040501@opencloud.com>
	<F9D18D4E-C078-4791-896F-556D71A3D4CA@fastcrypt.com>
	<42E5ABD8.1080608@opencloud.com>

Oliver,



Dave
On 25-Jul-05, at 11:19 PM, Oliver Jowett wrote:

> Dave Cramer wrote:
>
>
>> I've been messing with it a bit myself, and noticed that
>> TimeStampUtils.toString used the timezone of the incoming
>> timestamp, not the calendar. So the call to appendTimeZone, passes in
>> the timestamp, not the new calendar.
>>
>
> Yeah, looking at the stringizing TimestampUtils code is my next step.
> I've just overhauled the parsing side of things to correctly use  
> passed
> Calendars (for getTimestamp() and friends)
>
>
>> Also I've added functionality to track the servers's timezone so that
>> stmt.execute("set timezone='newtimezone'") allows you to
>> programatically set the server timezone to UTC. Which would be
>> necessary to get Christian's problem to work even using  
>> Oid.INVALID  ( I
>> think )
>>
>
> I don't think it's necessary to track the server timezone at all..
> what's the case where this goes wrong?

One of the times he is trying to stick in the db is a non-existant  
time if it is associated with a
time zone

stmt.execute("INSERT INTO Foo (t1) VALUES ('2005-04-03 02:29:43.0')");

in any US timezone this time does not exist. In US/Mountain timezone  
this
inserts as  2005-04-03 03:29:43.0' note the hour has incremented from  
2 to 3

The only way to insert this time correctly is to use UTC

>
> I'll send you an updated version of my patch offlist (it's changing
> fairly fast at the moment so I'll avoid spamming the list with every
> revision)
Ok, I'll test it in the morning... Thanks
>
> -O
>
>




view thread (10+ messages)  latest in thread

Message-ID: <7E3F468F-93C8-4082-9248-B9B52020E5F9@fastcrypt.com>
Permalink:  ../7E3F468F-93C8-4082-9248-B9B52020E5F9@fastcrypt.com/
Also on:    postgresql.org/message-id/7E3F468F-93C8-4082-9248-B9B52020E5F9@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
  Subject: Re: work in progress: timestamp patch
  In-Reply-To: <7E3F468F-93C8-4082-9248-B9B52020E5F9@fastcrypt.com>
  References: <42E57D80.4040501@opencloud.com> <F9D18D4E-C078-4791-896F-556D71A3D4CA@fastcrypt.com> <42E5ABD8.1080608@opencloud.com> <7E3F468F-93C8-4082-9248-B9B52020E5F9@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