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 5A97552B0E for ; Mon, 18 Jul 2005 18:28:24 -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 59690-07 for ; Mon, 18 Jul 2005 21:28:22 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 4D77F52896 for ; Mon, 18 Jul 2005 18:28:21 -0300 (ADT) Received: (qmail 1894 invoked from network); 18 Jul 2005 21:28:24 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 18 Jul 2005 21:28:24 -0000 In-Reply-To: <16335.1121714809@sss.pgh.pa.us> References: <90876a9e05071810503606d431@mail.gmail.com> <16335.1121714809@sss.pgh.pa.us> Mime-Version: 1.0 (Apple Message framework v733) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <10C90079-DD0A-43D7-9389-7486803F0AB1@fastcrypt.com> Cc: Christian Cryder , pgsql-jdbc@postgresql.org Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: Timestamp Conversion Woes Redux Date: Mon, 18 Jul 2005 17:28:20 -0400 To: Tom Lane X-Mailer: Apple Mail (2.733) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.016 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/113 X-Sequence-Number: 13261 Tom, You are correct, the driver is binding it to a timestamptz. The underlying data is without timezone so the server probably attempts to remove it I'm starting to think that binding the type to "unknown" might be better as you suggested earlier. Dave On 18-Jul-05, at 3:26 PM, Tom Lane wrote: > 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 > > ---------------------------(end of > broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings > >