pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: John Lister <john.lister-ps@kickstone.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: getTiIme/Timestamp with TimeZone inconsistency
Date: Mon, 04 May 2009 12:43:57 +1200
Message-ID: <49FE3A4D.5050704@opencloud.com> (raw)
In-Reply-To: <49FD74BF.7050003@kickstone.com>
References: <49FC495F.1020302@kickstone.com>
	<49FCD8DB.7000707@opencloud.com>
	<49FD74BF.7050003@kickstone.com>

John Lister wrote:

> I agree the JDBC spec is vague, but I read the spec such that the
> supplied calendar is *only* used if the server doesn't support a
> timezone. I think my main concern is that setTimestamp behaves
> differently to setTime. I'm not sure which is correct (i'd tend to the
> former) but i think they should behave the same...

The problem is that there's a bit of a disconnect between the server's
idea of time / timestamp with or without timezone, and the Java
representations. java.sql.Time is just a hideous hack to begin with.
It's going to be at best a patch job getting them to fit together.

> I'm not sure what the correct behaviour should be if the server has a
> timezone and you specify one to use. Hopefully the app writer would only
> use this case for none timezone columns/results.... maybe too much to
> ask for :)

I'm reluctant to touch that date/time handling code without an actual
testcase showing a problem. It's quite fragile as it is, and small
changes can have unintended consequences :/

-O




view thread (4+ messages)

Message-ID: <49FE3A4D.5050704@opencloud.com>
Permalink:  ../49FE3A4D.5050704@opencloud.com/
Also on:    postgresql.org/message-id/49FE3A4D.5050704@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, john.lister-ps@kickstone.com
  Subject: Re: getTiIme/Timestamp with TimeZone inconsistency
  In-Reply-To: <49FE3A4D.5050704@opencloud.com>
  References: <49FC495F.1020302@kickstone.com> <49FCD8DB.7000707@opencloud.com> <49FD74BF.7050003@kickstone.com> <49FE3A4D.5050704@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