pgjdbc/pgjdbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feedFrom: davecramer (@davecramer) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] issue #2311: Why is client time zone not configurable?
Date: Thu, 05 Jun 2025 18:23:45 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
> > How would we know the correct TZ ?
>
> For that option, the JDBC driver would have to hard-code time zones with known name changes, and try one after the other. (Yes, quite ugly.)
Very ugly
>
> > Well changing the TZ will change the result of getTimestamp. The server changes the time based on the session TZ. It does not store TZ in the data.
>
> The java.sql.Timestamp instance is created by the JDBC driver, no? So if the JDBC driver connects to the server with connection parameter TimeZone=GMT, I'd imagine the JDBC driver would receive the timestamp at GMT/UTC, but then convert it to the local JDK time zone for the purposes of creating the java.sql.Timestamp object (when working with `timestamptz` values). That way, the change to TimeZone=GMT can be regarded as a JDBC driver implementation detail that does not change the semantics of getTimestamp(). (But as [@vlsi](https://github.com/vlsi) pointed out it would still change the string representation of `timestamptz` when casted to `text`.)
What happens to data that the driver did not create ?
Dave
view thread (57+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: github://pgjdbc/pgjdbc
Cc: [email protected], [email protected]
Subject: Re: [pgjdbc/pgjdbc] issue #2311: Why is client time zone not configurable?
In-Reply-To: <<[email protected]>>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox