New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"could not determine data type of parameter" when setting null parameters with specific type #3151
Comments
Just to be clear, adding an explicit cast like |
This is the most relevant explanation: see
|
Thanks for the specific reference, sorry I missed that - it's a long and detailed thread. |
seems broken to me as well, does work fine in simple query mode, but that has it's own issues. |
If we can't fix this (I do not know if we can), we might try improving the error message for the specific case |
Describe the issue
Hi, I am trying to send in a timestamp to PG that may or may not be null and drive some conditional logic by it. To my surprise, the parameter type can not be determined even when I specifically set it via
setNull(1, Types.TIMESTAMP)
orsetObject(1, null, Types.TIMESTAMP)
.I see there is some previous discussion around this at https://www.postgresql.org/message-id/CAG2M1febgZbhBwm0DQK4Y5ekDrTbzTyAa1syKcdXw%2B6Y8caK4g%40mail.gmail.com but it looks like what I am doing should work...
I apologize in advance if I missed some trivial detail that makes this my fault :)
Driver Version?
42.7.2
Java Version?
21.0.2
OS Version?
Mac 14.2.1
PostgreSQL Version?
15.3
To Reproduce
This code fails:
This doesn't change anything:
I also tried
Types.TIMESTAMP_WITH_TIME_ZONE
with no change in behavior.Expected behavior
I expected that specifying
Types.TIMESTAMP
would allow the backend to know the parameter typeLogs
The text was updated successfully, but these errors were encountered: