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 27F6F52CCA for ; Mon, 18 Jul 2005 16:27:02 -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 36371-01 for ; Mon, 18 Jul 2005 19:26:53 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 09DD152CC7 for ; Mon, 18 Jul 2005 16:26:52 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j6IJQnAE016336; Mon, 18 Jul 2005 15:26:49 -0400 (EDT) To: Christian Cryder Cc: pgsql-jdbc@postgresql.org Subject: Re: Timestamp Conversion Woes Redux In-reply-to: <90876a9e05071810503606d431@mail.gmail.com> References: <90876a9e05071810503606d431@mail.gmail.com> Comments: In-reply-to Christian Cryder message dated "Mon, 18 Jul 2005 11:50:58 -0600" Date: Mon, 18 Jul 2005 15:26:49 -0400 Message-ID: <16335.1121714809@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/111 X-Sequence-Number: 13259 Christian Cryder writes: >> The problem isn't with PreparedStatement, rather with Timestamp itself. > Actually, I still think it is a problem w/ PreparedStatement, and I'll > see if I can explain why, as well as provide a better test case to > illustrate. I'm hardly a JDBC expert, but I recall some considerable discussion awhile back about how JDBC ought to map Java's (one) Timestamp type into Postgres' TIMESTAMP WITH/WITHOUT TIME ZONE types, neither of which apparently match the semantics of Timestamp very well. You should go digging in the pgsql-jdbc archives for background. As for the problem at hand, I suspect that the driver is prespecifying the parameter data type as either TIMESTAMP WITH or TIMESTAMP WITHOUT TIME ZONE, and that whichever choice is used is different from what the server would infer without the prespecification. This would in turn affect what the server assumes about the timezone spec (or lack of one) in the supplied input string. Worse, there could be an ensuing run-time conversion between the two data types, leading to adding or subtracting your local GMT offset. (For that matter, is the parameter being sent in text or binary? If it's binary then most of these theories fall to the ground...) regards, tom lane