pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christian Cryder <c.s.cryder@gmail.com>
To: Dave Cramer <pg@fastcrypt.com>
Cc: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: work in progress: timestamp patch
Date: Tue, 26 Jul 2005 13:47:40 -0600
Message-ID: <90876a9e05072612478f36c41@mail.gmail.com> (raw)
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>

On 7/25/05, Dave Cramer <pg@fastcrypt.com> wrote:
> 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

Just a clarification guys.
a) this time is only invalid in a US timezone that uses Daylight Savings
b) if you insert it via Statement like this, it inserts into the db
just fine; if you insert it using PreparedStatement the value will get
munged
c) once you have the value in the DB, the question is: "How can I read
the value and then rewrite it without munging it"

The only answer to c right now is
a) reconfigure both your client and your server to run in UTC (or some
other non-DST zone)
b) reconfigure your client to turn DST off, and then adjust the server
zone programatically just for the scope of the connection (that was
what my little patch was about)

Neither of these solutions is particularly appealing. I'm surprised
the basic data-integrity aspects of this issue don't bother people
more...

Christian



view thread (10+ messages)

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