Re: Retrieve the server's time zone - Mailing list pgsql-jdbc

From David G. Johnston
Subject Re: Retrieve the server's time zone
Date
Msg-id CAKFQuwbPDsRjd09-J3_Me0R8__NJKD5Mu20zdu=SniDONF734w@mail.gmail.com
Whole thread Raw
In response to Retrieve the server's time zone  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-jdbc
On Tue, Nov 21, 2017 at 12:01 AM, Thomas Kellerer <spam_eater@gmx.net> wrote:
Hello,

it seems the JDBC driver (or Java?) makes it impossible to retrieve the server's time zone.

Apparently the driver changes the timezone setting so that it can't be reset to the original from the server.

​Yes, this is the case.  No, in the current code there is no means to prevent it.


psql doesn't provide object instantiation on the results being passed back from the server: all it does is print stuff to the screen.  That JDBC and psql different in their behavior with respect to timestamps/dates is unsurprising in that light.  I don't know how libpq-based C (or other) language programs operate within this area but that would be the proper API to compare JDBC to.

As a work-around have your application require psql on the client machine and shell out to it.  Or hack the driver - though using your timezone-less connection for anything other than finding out the server timezone is probably something you'd want to avoid.

David J.

pgsql-jdbc by date:

Previous
From: Vladimir Sitnikov
Date:
Subject: Re: Retrieve the server's time zone
Next
From: rob stone
Date:
Subject: Re: Retrieve the server's time zone