pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: victornoel (@victornoel) <[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: Wed, 22 Oct 2025 10:11:30 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

> Oid.DATE, Oid.TIMESTAMP, and Oid.TIMESTAMPTZ differ.
> At the same time, it is hard to tell if .setTimestamp means TIMESTAMP or TIMESTAMPTZ.

So basically, this is a known behaviour of the driver and there is no way to improve it? Thanks for the explanation, it's unfortunate because it's very error-prone, but I guess we have no real choice here.

> Is there anything stopping you from using java.time with Hibernate?

Nothing, the problem is Hibernate itself, it's implementing the use of those types by converting them to `java.sql.Timestamp` before calling `setTimestamp` on the statement :)

But the easy workaround is to use a cast. I may check if the currently supported version of Hibernate still have this problem (we are stuck with v5) and if they do I will report a bug there.

Feel free to close this ticket if you think there is nothing more that can be done on the driver side :)



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