pgjdbc/pgjdbc GitHub issues and pull requests (mirror)help / color / mirror / Atom feed
[pgjdbc/pgjdbc] issue #3642: Calcutta/Kolkata time zone name mismatch prevents connection 4+ messages / 3 participants [nested] [flat]
* [pgjdbc/pgjdbc] issue #3642: Calcutta/Kolkata time zone name mismatch prevents connection @ 2025-05-28 19:45 "eirikbakke (@eirikbakke)" <[email protected]> 0 siblings, 0 replies; 4+ messages in thread From: eirikbakke (@eirikbakke) @ 2025-05-28 19:45 UTC (permalink / raw) To: pgjdbc/pgjdbc <[email protected]> **Describe the issue** If a user with a Java client version that runs with the time zone "Asia/Calcutta" connects to a PostgreSQL server that uses the newer equivalent name "Asia/Kolkata" for the same time zone, the following exception is seen: ``` org.postgresql.util.PSQLException: FATAL: invalid value for parameter "TimeZone": "Asia/Calcutta" at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2725) at org.postgresql.core.v3.QueryExecutorImpl.readStartupMessages(QueryExecutorImpl.java:2837) at org.postgresql.core.v3.QueryExecutorImpl.<init>(QueryExecutorImpl.java:175) at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:317) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:54) at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:273) at org.postgresql.Driver.makeConnection(Driver.java:446) at org.postgresql.Driver.connect(Driver.java:298) ``` I suspect the same can happen with mismatches between "Europe/Kiev" and "Europe/Kyiv" as well (another recent name change I have seen in time zone databases). The relevant JDBC driver code is in `org.postgresql.core.v3.ConnectionFactoryImpl.createPostgresTimeZone()`. For the time zones "Asia/Calcutta", "Asia/Kolkata", "Europe/Kiev", and "Europe/Kyiv", it would probably be better to generate an offset-based time zone name that works regardless of server version and distribution. Or if it's not possible to pass offset-based time zone names for the TimeZone connection parameter, perhaps pass "GMT" instead and automatically call "SET SESSION TIME ZONE INTERVAL" to set the offset instead. **Driver Version?** 42.7.3 **Java Version?** 21.0.4 **OS Version?** Windows **PostgreSQL Version?** Unknown (bug was reported by a user of my database UI product, [Ultorg](https://www.ultorg.com/)). **To Reproduce** Use a PostgreSQL server that uses the newer "Asia/Kolkata" time zone name. For the client, use OpenJDK 21.0.4 for Windows which uses the older "Asia/Calcutta". Then set the machine time zone to India time and attempt to connect. **Expected behaviour** The connection should succeed, but does not. **Logs** See the earlier-pasted stack trace. ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [pgjdbc/pgjdbc] issue #3642: Calcutta/Kolkata time zone name mismatch prevents connection @ 2025-05-28 20:19 ` "davecramer (@davecramer)" <[email protected]> 2 siblings, 0 replies; 4+ messages in thread From: davecramer (@davecramer) @ 2025-05-28 20:19 UTC (permalink / raw) To: pgjdbc/pgjdbc <[email protected]> Yes, we have seen this before with some new TZ's where servers are not updated to the latest timezone database. In this case it seems it is the JDK <sigh> ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [pgjdbc/pgjdbc] issue #3642: Calcutta/Kolkata time zone name mismatch prevents connection @ 2025-05-28 21:02 ` "eirikbakke (@eirikbakke)" <[email protected]> 2 siblings, 0 replies; 4+ messages in thread From: eirikbakke (@eirikbakke) @ 2025-05-28 21:02 UTC (permalink / raw) To: pgjdbc/pgjdbc <[email protected]> Yes, the incompatibility can probably happen in both directions. So for client apps that are supposed to be able to connect to any PostgreSQL version, it's not enough to merely upgrade the JDK version, as this would cause problems when connecting to older servers. ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [pgjdbc/pgjdbc] issue #3642: Calcutta/Kolkata time zone name mismatch prevents connection @ 2025-06-01 14:27 ` "vlsi (@vlsi)" <[email protected]> 2 siblings, 0 replies; 4+ messages in thread From: vlsi (@vlsi) @ 2025-06-01 14:27 UTC (permalink / raw) To: pgjdbc/pgjdbc <[email protected]> This issue duplicates https://github.com/pgjdbc/pgjdbc/issues/2311, so I'm closing this as duplicate. ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2025-06-01 14:27 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2025-05-28 19:45 [pgjdbc/pgjdbc] issue #3642: Calcutta/Kolkata time zone name mismatch prevents connection "eirikbakke (@eirikbakke)" <[email protected]> 2025-05-28 20:19 ` "davecramer (@davecramer)" <[email protected]> 2025-05-28 21:02 ` "eirikbakke (@eirikbakke)" <[email protected]> 2025-06-01 14:27 ` "vlsi (@vlsi)" <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox