Message-ID: From: "davecramer (@davecramer)" To: "pgjdbc/pgjdbc" Date: Thu, 23 Oct 2025 04:22:03 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #3845: Wrong result on equality between Date and Timestamp given as query parameter In-Reply-To: References: List-Id: X-GitHub-Author-Login: davecramer X-GitHub-Comment-Id: 3435008162 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3845 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3845#issuecomment-3435008162 Content-Type: text/plain; charset=utf-8 > 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/appendixA.html) 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#setTimestamp(int,java.sql.Timestamp,java.util.Calendar)) 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