Re: Anyway to tell jdbc to use server timezone? - Mailing list pgsql-jdbc

From George Woodring
Subject Re: Anyway to tell jdbc to use server timezone?
Date
Msg-id CACi+J=RcsUF7dpkE3+zuHnixb2u8_x92TLWNgexyofqSFBot8Q@mail.gmail.com
Whole thread Raw
In response to Re: Anyway to tell jdbc to use server timezone?  (Dave Cramer <pg@fastcrypt.com>)
Responses Re: Anyway to tell jdbc to use server timezone?  (Dave Cramer <pg@fastcrypt.com>)
List pgsql-jdbc
It is not the where case that is my issue.  It is that the jdbc driver is changing my timezone from what I set with alter database to the timezone of my web server for any queries from the web server.  What I would like is a way to keep the database timezone setting.

When I log into my database with psql and show timezone I get "GMT", when I put a log into my java code and show timezone I get "US/Eastern".  This is causing my data not to line up correctly around DST boundries, since the data was save at 12, 2, 4am GMT and it is trying to find data at 12, 2, 4am Eastern which is 12, 1, 3 am GMT

Thanks
George

iGLASS Networks
www.iglass.net

On Wed, Nov 12, 2014 at 1:59 PM, Dave Cramer <pg@fastcrypt.com> wrote:
George,

I looked at the stackoverflow example. I fail to see how the driver would change the where clause.

Can you create a self contained test case ?

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca

On 12 November 2014 13:48, George Woodring <george.woodring@iglass.net> wrote:
I originally asked a question about adjusting timezone per db back


And it was suggested that I set them per db, which I have.  But now moving to 
9.3 of the jdbc driver, it seems to set the timezone to the web server's timezone.

I have found mentions


and


My question here is is there a way to disable it and get the older functionality?  Is there a command I could run after I get the connection to say "set timezone = 'server default'"?

Thanks
George Woodring
iGLASS Networks
www.iglass.net


pgsql-jdbc by date:

Previous
From: Florent Guillaume
Date:
Subject: Re: New significance of holdable result sets in Java 8
Next
From: Dave Cramer
Date:
Subject: Re: Anyway to tell jdbc to use server timezone?