X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5954452A1E for ; Wed, 20 Jul 2005 12:41:25 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 99394-08 for ; Wed, 20 Jul 2005 15:41:15 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.205]) by svr1.postgresql.org (Postfix) with ESMTP id B2C4E52A15 for ; Wed, 20 Jul 2005 12:41:11 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id i21so1461194wra for ; Wed, 20 Jul 2005 08:41:11 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=lSdRng/nhnnXNbUPIuuk0tzIhBPbKQlDBs3FI5aGemkR1d3rYikWyh3ZCm8HWiNO3Wj8nFHUsBSCr4cW1cc648XmjmAxhlBY/De4H0U+xzFRnUZ6TDIcJc59EIRqpixoNb6cbtZh+3gWC6/xIJ9biWwJXB6f4Pl7Kk/cXOiB9TY= Received: by 10.54.113.13 with SMTP id l13mr124348wrc; Wed, 20 Jul 2005 08:40:44 -0700 (PDT) Received: by 10.54.86.16 with HTTP; Wed, 20 Jul 2005 08:40:44 -0700 (PDT) Message-ID: <90876a9e05072008402337966@mail.gmail.com> Date: Wed, 20 Jul 2005 09:40:44 -0600 From: Christian Cryder Reply-To: Christian Cryder To: List Subject: Re: Timestamp Conversion Woes Redux In-Reply-To: <42DE42E5.6010206@opencloud.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <90876a9e05071810503606d431@mail.gmail.com> <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> <42DE42E5.6010206@opencloud.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.104 tagged_above=0 required=5 tests=AWL, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200507/179 X-Sequence-Number: 13327 Holy schmoly, there's a lot of reading to catch up on here. Couple of comments as I try to take it all in... On 7/20/05, Oliver Jowett wrote: > Ok, so this sounds like JDBC doesn't distinguish with-timezone and > without-timezone at all so trying to base the semantics on the spec is > hopeless; we should just pick something that's sensible and do that. >=20 > I still think my suggestion of using the two setTimestamp methods to > support the two types makes sense -- but I'm out of time to deal with > this, sorry. I like Oliver's suggestion (because it would work for me) even though I think Dave is probably right when he says > > It would appear that the setTimestamp is intended to do one or the > > other, but not both. One issue which no one has really mentioned is that when we flatten a timestamp to a string via toString() (eg. I ran into this even when creating a custom PGTimestamp object yesterday) - when you flatten to a String, you ARE using a calendar whether you realize it or not (eg. the Default). Which means that you are performing a DST shift on the client whether you like it or not. So if the date falls into the right segment, it may still get munged. The point here is that not only do we need to consider how to pass the value to the server w/ TIMESTAMP rather than TIMESTAMPTZ, we also need to consider how to render it to a string in PGobject.value w/out munging the date. And the problem here (I think) is that you really need to know the column info (w/ tz or w/out) in order to know whether DST applies. So that's something that needs to be considered. Right now, I can work around the existing problems using PGTimestamp (per Dave's suggestion), but I still have to tweak the timezone I am running in to turn DST off in order to keep the dates from getting munged when rendered to strings. One other thing - could the problem be alleviated simply by=20 a) sending the data across the wire, always using UNKNOWN (thereby deferring the decision to the DB) b) sending the data across as millisecs value, rather than flattening to a Timestamp string? That way to could avoid the toString() issues mentioned above, plus it'd probably be faster to reconsitute from millis on the server than by parsing a timestamp string anyways. Those are just some thoughts to consider... Christian