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 F092652C88 for ; Tue, 26 Jul 2005 16:47:42 -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 68241-02 for ; Tue, 26 Jul 2005 19:47:40 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.206]) by svr1.postgresql.org (Postfix) with ESMTP id 52A1B52C93 for ; Tue, 26 Jul 2005 16:47:39 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id i32so20836wra for ; Tue, 26 Jul 2005 12:47:41 -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:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ewgH8lKuT4IOX89sIYkczu0VgZkJOHTi9IS70/gw4GyYONFY7JHnkXk/UpBv/G5Vm+h69DzDadKRB1+aKYXBcGayazlnle3vlXPdx6EI0UdSGf4rsUjWnA4JVhQGZo6tg3yvlEUFXlO66/vrUzoVUeF9S1iN37PW32yMlzsxWoU= Received: by 10.54.99.7 with SMTP id w7mr48857wrb; Tue, 26 Jul 2005 12:47:41 -0700 (PDT) Received: by 10.54.86.16 with HTTP; Tue, 26 Jul 2005 12:47:40 -0700 (PDT) Message-ID: <90876a9e05072612478f36c41@mail.gmail.com> Date: Tue, 26 Jul 2005 13:47:40 -0600 From: Christian Cryder Reply-To: Christian Cryder To: Dave Cramer Subject: Re: work in progress: timestamp patch Cc: Oliver Jowett , "pgsql-jdbc@postgresql.org" In-Reply-To: <7E3F468F-93C8-4082-9248-B9B52020E5F9@fastcrypt.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <42E57D80.4040501@opencloud.com> <42E5ABD8.1080608@opencloud.com> <7E3F468F-93C8-4082-9248-B9B52020E5F9@fastcrypt.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.065 tagged_above=0 required=5 tests=AWL, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200507/336 X-Sequence-Number: 13484 On 7/25/05, Dave Cramer 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 >=20 > stmt.execute("INSERT INTO Foo (t1) VALUES ('2005-04-03 02:29:43.0')"); >=20 > 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 fro= m > 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