They give a workaround for that (Setting a PGTimestamp instance instead of Timestamp). I was wondering if it is something that could be implemented inside Spring JDBC to increase portability accross multiple databases. It seems there are already some specific code in StatementCreatorUtil related to similar things.
If you think that it is something that makes sense, I can make a pull request
Since PGTimestamp is a Postgres-specific class that we'd have to instantiate etc, not just a Postgres-specific convertion for how to use the standard JDBC API, I'm not sure we can easily roll this into StatementCreatorUtils itself.
A pull request highlighting the actual impact of such a change would be useful indeed...
Locally creating PGTimestamp instances out of given Timestamp or Date values seems like a quite specific workaround. The Postgres JDBC driver could easily do so itself behind the regular JDBC API methods, and that's exactly what I suggest as a proper way out of this. I'm therefore closing this issue on Spring's end.
Arnaud Mergey opened SPR-16719 and commented
I was facing this "seem to be" famous issue by setting a timestamp binding against postgres.
Following test fails with ERROR: could not determine data type of parameter $1
I found a discution with postgres that explain why: http://www.postgresql-archive.org/quot-could-not-determine-data-type-of-parameter-quot-with-timestamp-td5995489.html
They give a workaround for that (Setting a PGTimestamp instance instead of Timestamp). I was wondering if it is something that could be implemented inside Spring JDBC to increase portability accross multiple databases. It seems there are already some specific code in StatementCreatorUtil related to similar things.
If you think that it is something that makes sense, I can make a pull request
Affects: 5.0.5
Referenced from: pull request #1790
The text was updated successfully, but these errors were encountered: