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 08:24:24 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

Hi,

It feels like the jdbc driver is not properly propagating the type of the parameters, for example if I do:
```java
        var date = java.sql.Date.valueOf(LocalDate.of(2013, 03, 21));
        var timestamp = java.sql.Timestamp.valueOf(LocalDateTime.of(2013, 03, 21, 13, 14));
        var preparedStatement = conn.prepareStatement("SELECT pg_typeof(?), pg_typeof(?)");
        preparedStatement.setDate(1, date);
        preparedStatement.setTimestamp(2, timestamp);
```

I get the error: ERROR: could not determine data type of parameter $1

This means that the problem is not only with timestamp, but also with date.

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