Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 561E86329AA for ; Sun, 3 May 2009 21:44:07 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 29353-04 for ; Sun, 3 May 2009 21:44:01 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mail.postgresql.org (Postfix) with ESMTP id DBA4A63222C for ; Sun, 3 May 2009 21:44:02 -0300 (ADT) Received: from 219-89-243-186.adsl.xtra.co.nz ([219.89.243.186] helo=[192.168.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1M0mHm-0001Yd-8f; Mon, 04 May 2009 12:43:58 +1200 Message-ID: <49FE3A4D.5050704@opencloud.com> Date: Mon, 04 May 2009 12:43:57 +1200 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: John Lister CC: pgsql-jdbc@postgresql.org Subject: Re: getTiIme/Timestamp with TimeZone inconsistency References: <49FC495F.1020302@kickstone.com> <49FCD8DB.7000707@opencloud.com> <49FD74BF.7050003@kickstone.com> In-Reply-To: <49FD74BF.7050003@kickstone.com> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200905/32 X-Sequence-Number: 19582 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