pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: davecramer (@davecramer) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] issue #3845: Wrong result on equality between Date and Timestamp given as query parameter
Date: Thu, 23 Oct 2025 04:22:03 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

> I don't make the rules, the JCP does.
> 
> And [JDBC 4.3 (pdf)](https://download.oracle.com/otn-pub/jcp/jdbc-4_3-mrel3-eval-spec/jdbc4.3-fr-spec.pdf) only lists TIMESTAMP_WITH_TIMEZONE associated with java.time.OffsetDateTime when java.sql.Timestamp is only ever associated with TIMESTAMP, and [JDBC 2.1](https://web.archive.org/web/20001018172021/http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/app...) which added "support for time zones" back in the day only added the `setTimestamp()` overloads taking an additional `Calendar` argument, but note that [the javadoc](https://docs.oracle.com/en/java/javase/25/docs/api/java.sql/java/sql/PreparedStatement.html#setTimes...)) says it uses the `Calendar` object to determine the time zone to use to compute the value instead of the local time zone, but still constructs a `TIMESTAMP` SQL value!

Well, Postgres has always had 2 timestamp types and the driver is for Postgres so we support both. I'll also note that timestamp is of questionable value https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don't_use_timestamp_(without_time_zone)

Either way we will continue to support both as we attempt to provide a client that can read and write all postgres types 

view thread (17+ 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 #3845: Wrong result on equality between Date and Timestamp given as query parameter
  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