Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XpItL-0005l9-TM for pgsql-jdbc@arkaria.postgresql.org; Fri, 14 Nov 2014 15:34:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XpItL-0002Uq-CF for pgsql-jdbc@arkaria.postgresql.org; Fri, 14 Nov 2014 15:34:31 +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 1XpItJ-0002Sc-W8 for pgsql-jdbc@postgresql.org; Fri, 14 Nov 2014 15:34:30 +0000 Received: from mail-am1on0697.outbound.protection.outlook.com ([2a01:111:f400:fe00::697] helo=emea01-am1-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XpItE-0004eJ-Dg for pgsql-jdbc@postgresql.org; Fri, 14 Nov 2014 15:34:28 +0000 Received: from AM2PR07MB0659.eurprd07.prod.outlook.com (25.160.55.150) by AM2PR07MB0660.eurprd07.prod.outlook.com (25.160.55.151) with Microsoft SMTP Server (TLS) id 15.1.16.15; Fri, 14 Nov 2014 15:04:07 +0000 Received: from AM2PR07MB0659.eurprd07.prod.outlook.com ([25.160.55.150]) by AM2PR07MB0659.eurprd07.prod.outlook.com ([25.160.55.150]) with mapi id 15.01.0016.006; Fri, 14 Nov 2014 15:04:07 +0000 From: Mikko Tiihonen To: Dave Cramer , George Woodring CC: List Subject: Re: Anyway to tell jdbc to use server timezone? Thread-Topic: [JDBC] Anyway to tell jdbc to use server timezone? Thread-Index: AQHP/qlNuxZaZwWrhUSa470AqnD91pxdWCCAgAE2tYCAAA+rgIABJuSggABb/4CAAATFgIAAFBTS Date: Fri, 14 Nov 2014 15:04:07 +0000 Message-ID: <1415977446762.37130@nitorcreations.com> References: <1415952431956.13439@nitorcreations.com> , In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [158.127.28.20] x-microsoft-antispam: BCL:0;PCL:0;RULEID:;SRVR:AM2PR07MB0660; x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:;SRVR:AM2PR07MB0660; x-forefront-prvs: 03950F25EC x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(189002)(164054003)(377454003)(24454002)(199003)(106116001)(19580395003)(36756003)(106356001)(21056001)(40100003)(575784001)(86362001)(16236675004)(105586002)(101416001)(31966008)(15202345003)(20776003)(46102003)(19580405001)(95666004)(4396001)(93886004)(15395725005)(77096003)(77156002)(107046002)(64706001)(62966003)(16601075003)(19627405001)(122556002)(54356999)(76176999)(92566001)(87936001)(2656002)(19617315012)(50986999)(15975445006)(92726001)(117636001)(120916001)(99396003)(66066001)(97736003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR07MB0660; H:AM2PR07MB0659.eurprd07.prod.outlook.com; FPR:; MLV:sfv; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Content-Type: multipart/alternative; boundary="_000_141597744676237130nitorcreationscom_" MIME-Version: 1.0 X-OriginatorOrg: nitorcreations.com X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org --_000_141597744676237130nitorcreationscom_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable That would be an easy way to get back the old functionality. Fixing binary protocol to work with server side timezone and adding a way t= o choose service side timezone would be the correct long term solution. -Mikko ________________________________ From: davecramer@gmail.com on behalf of Dave Cramer = Sent: 14 November 2014 15:48 To: George Woodring Cc: Mikko Tiihonen; List Subject: Re: [JDBC] Anyway to tell jdbc to use server timezone? George, Looking at the reason it was put in there, this is for the binary protocol.= I think you may be able to get away with removing it if you disable binary= protocol for timestamps. Mikko ? Dave Dave Cramer dave.cramer(at)credativ(dot)ca http://www.credativ.ca On 14 November 2014 08:31, George Woodring > wrote: I have 100 different customers with different timezones, I was trying to a= void having to put a lookup table to say if I am connecting to foo set the = timezone to bar. GMT was just the example in the email. Thanks, George iGLASS Networks www.iglass.net On Fri, Nov 14, 2014 at 3:07 AM, Mikko Tiihonen > wrote: Would an acceptable workaround for you to change the Java default timezone. Either start the JVM with -Duser.timezone=3DGMT or to invoke in your startup code TimeZone.setDefault(TimeZone.get("GMT")); -Mikko ________________________________ From: pgsql-jdbc-owner@postgresql.org = > on behalf of Dave Cramer > Sent: 13 November 2014 16:27 To: George Woodring Cc: List Subject: Re: [JDBC] Anyway to tell jdbc to use server timezone? Ah, OK, this was done for binary protocol. I seem to recall this is somewha= t defined in the spec according to setTimestamp. Is there a reason why you can't just override this in your code when you ge= t a connection ? Dave Cramer dave.cramer(at)credativ(dot)ca http://www.credativ.ca On 13 November 2014 08:31, George Woodring > wrote: It is not the where case that is my issue. It is that the jdbc driver is c= hanging 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 d= ata 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 > wrote: George, I looked at the stackoverflow example. I fail to see how the driver would c= hange 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 > wrote: I originally asked a question about adjusting timezone per db back 1B1B254441DB31448BD34C5BD73B0B8B2904B1@PHOENIX.istructure.com 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 ti= mezone. I have found mentions CAAXGW-y=3D=3DFOGGB7jVWhDsaugXV20qeXUcgZSiteQ7jfMXOKi-A@mail.gmail.com and http://stackoverflow.com/questions/18447995/postgresql-9-2-jdbc-driver-uses= -client-time-zone My question here is is there a way to disable it and get the older function= ality? Is there a command I could run after I get the connection to say "s= et timezone =3D 'server default'"? Thanks George Woodring iGLASS Networks www.iglass.net --_000_141597744676237130nitorcreationscom_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

That would be an easy way to get back the old functionality.


Fixing binary protocol to work with server side timezone and adding=  a way to choose service side timezone would be the correct long term = solution.


-Mikko


From: davecramer@gmail.com= <davecramer@gmail.com> on behalf of Dave Cramer <pg@fastcrypt.com= >
Sent: 14 November 2014 15:48
To: George Woodring
Cc: Mikko Tiihonen; List
Subject: Re: [JDBC] Anyway to tell jdbc to use server timezone?
 
George,

Looking at the reason it was put in there, this is for the binary prot= ocol. I think you may be able to get away with removing it if you disable b= inary protocol for timestamps.

Mikko ?

Dave

Dave Cramer

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

On 14 November 2014 08:31, George Woodring <george.= woodring@iglass.net> wrote:
I have 100 different customers with different timezones, &= nbsp;I was trying to avoid having to put a lookup table to say if I am conn= ecting to foo set the timezone to bar.  GMT was just the example in th= e email.

Thanks, 
George

iGLASS Networks
www.iglass.net

On Fri, Nov 14, 2014 at 3:07 AM, Mikko Tiihonen = <= Mikko.Tiihonen@nitorcreations.com> wrote:

Would an acceptable workaround for you to change the Java defa= ult timezone.

Either start the JVM with -Duser.timezone=3DGMT

or to invoke in your startup code TimeZone.setDefault(TimeZone.get("= ;GMT"));


-Mikko


From: pgsql-= jdbc-owner@postgresql.org <pgsql-jdbc-owner@postgresql.org> on beha= lf of Dave Cramer <pg@fastcrypt.com>
Sent: 13 November 2014 16:27
To: George Woodring
Cc: List
Subject: Re: [JDBC] Anyway to tell jdbc to use server timezone?
 
Ah, OK, this was done for binary protocol. I seem to recal= l this is somewhat defined in the spec according to setTimestamp.

Is there a reason why you can't just override this in your code when y= ou get a connection ?



Dave Cramer

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

On 13 November 2014 08:31, George Woodring <george.= woodring@iglass.net> wrote:
It is not the where case that is my issue.  It is tha= t the jdbc driver is changing my timezone from what I set with alter databa= se to the timezone of my web server for any queries from the web server.&nb= sp; 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 "GM= T", when I put a log into my java code and show timezone I get "U= S/Eastern".  This is causing my data not to line up correctly aro= und 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<= /a>> wrote:
George,

I looked at the stackoverflow example. I fail to see how the driver wo= uld change the where clause.

Can you create a self contained test case ?


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 n= ow moving to 
9.3 of the jdbc driver, it seems to set the timezone to the web server= 's timezone.

I have found mentions

CAAXGW-= y=3D=3DFOGGB7jVWhDsaugXV20qeXUcgZSiteQ7jfMXOKi-A@mail.gmail.com 

and

http://stackoverflow.c= om/questions/18447995/postgresql-9-2-jdbc-driver-uses-client-time-zone<= /div>

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

Thanks
George Woodring
iGLASS Networks
www.iglass.net





--_000_141597744676237130nitorcreationscom_--