Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wu8yj-0001hl-L5 for pgsql-odbc@arkaria.postgresql.org; Mon, 09 Jun 2014 23:27:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wu8yj-0001Pq-50 for pgsql-odbc@arkaria.postgresql.org; Mon, 09 Jun 2014 23:27:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Wu8yi-0001Pj-4D for pgsql-odbc@postgresql.org; Mon, 09 Jun 2014 23:27:48 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Wu8yd-00043g-Cz for pgsql-odbc@postgresql.org; Mon, 09 Jun 2014 23:27:46 +0000 Received: from compute2.internal (compute2.nyi.mail.srv.osa [10.202.2.42]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 6622E21313; Mon, 9 Jun 2014 19:27:40 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Mon, 09 Jun 2014 19:27:40 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h= message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=sSscxA+HXD6tWv7VLIrpLh8dyjo=; b=glpPuBdKuEpaYgYJvV6hKFx05XkZ MeuOCd6xGthWlKyQgQuSHqtCmQ7A5Py6NRT+eRpYVJKd9nHwMsdMC8fDWi5g+z3o 1Ml9E76o5dqPu/BOcP8QMHx+x0KvKGyIFa/sMwzYdQO+E4KOYKT847vKfUR1m/5g Sv0nTt44XQUaZ5M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=sSscxA+HXD6tWv7VLIrpLh 8dyjo=; b=CS2LfPh5fplsVK5TIT5R6YfmEL3aRy+BGv2y19AkDakUj/pGp10Heg SoqFGhYbUarGp31/cJFKJEu6bAmC2TuQIyF3Q7j1/mHJyjPnm5MPq5z1RG60V/+A pwD82as/2N88dp1DSp25oaVMgBLGEukMAcqrBXYXhIGRIILw8xww0= X-Sasl-enc: EPJN90EKxYNK1Ebb+WfMzG90LXk073swGlM4ueXNtLNZ 1402356460 Received: from killi.site (unknown [24.17.179.185]) by mail.messagingengine.com (Postfix) with ESMTPA id DE424680119; Mon, 9 Jun 2014 19:27:39 -0400 (EDT) Message-ID: <539642EB.1030600@aklaver.com> Date: Mon, 09 Jun 2014 16:27:39 -0700 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Walter Couto , "pgsql-odbc@postgresql.org" Subject: Re: Inconsistency between JDBC and ODBC drivers when dealing with TIMESTAMP WITH TIME ZONE References: <7FA4F9E5512F214C801E596ECD8790E066A82A9A@ETNAMAIL01.embarcadero.com> In-Reply-To: <7FA4F9E5512F214C801E596ECD8790E066A82A9A@ETNAMAIL01.embarcadero.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org On 06/09/2014 12:15 PM, Walter Couto wrote: > CREATE TABLE DATE_TEST > ( > test integer NOT NULL, > TIMESTAMPOFFSET_COL TIMESTAMP WITH TIME ZONE, > PRIMARY KEY(TEST) > ) > ; > INSERT INTO DATE_TEST VALUES ( 2, timestamp WITH TIME ZONE '2002-04-11 01:33:08.12345+02' ); > ; > > NOTE: My client machines time zone offset is currently -4. The server's times zone offset is +3. > > Execute: > > select TIMESTAMPOFFSET_COL from DATE_TEST where test = 2. > > Results: > If you bind to that column as a timestamp, I get the following: > > JDBC: 2002-04-11 19:33:08.12345 > ODBC: 2002-04-11 02:33:08.12345 > > If I bind as a string I get: > > JDBC: 2002-04-10 19:33:08.12345-04 > ODBC: 2002-04-11 02:33:08.12345 I am not following the above. Are you talking about binding when you do the INSERT? If so can you show the code for each case? How and where are you doing the selects? > > The fact the two drivers return completely different results is a concern as they both should behave the same for this data type for consistency, but I can work around that via the string binding if the time zone is returned....but ODBC can never give me the time zone! I think this is a serious bug. I can work around this by assuming the same time zone as the server, but I would then have to keep checking what that time zone offset is just in case the session time zone changed, but I think this is a waste of a query round trip since that info should have been available to me via binding as a string. Looks to me like the JDBC driver is trying to convert to local time. Just to be clear what JDBC driver are you using? > > Regards, > Walter > > > CONFIDENTIALITY NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. > > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc