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 1DDE552DE0 for ; Tue, 26 Jul 2005 00:28:17 -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 76144-08 for ; Tue, 26 Jul 2005 03:28:11 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 30D3F52B92 for ; Tue, 26 Jul 2005 00:28:11 -0300 (ADT) Received: (qmail 10345 invoked from network); 26 Jul 2005 03:28:10 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 26 Jul 2005 03:28:10 -0000 In-Reply-To: <42E5ABD8.1080608@opencloud.com> References: <42E57D80.4040501@opencloud.com> <42E5ABD8.1080608@opencloud.com> Mime-Version: 1.0 (Apple Message framework v733) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <7E3F468F-93C8-4082-9248-B9B52020E5F9@fastcrypt.com> Cc: "pgsql-jdbc@postgresql.org" Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: work in progress: timestamp patch Date: Mon, 25 Jul 2005 23:28:09 -0400 To: Oliver Jowett X-Mailer: Apple Mail (2.733) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.014 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/311 X-Sequence-Number: 13459 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 > >