This There is useful when one wants to bind a {{timestamp}} parameter pg-jdbc issue that prevents us from using this type: [https://github.com/pgjdbc/pgjdbc/issues/2862|https://github.com/pgjdbc/pgjdbc/issues/2862|smart-link]
Binding to an {{ Instant timestamptz }}, which might fail on PostgreSQL, because right now, we use {{InstantAsTimestampWithTimeZoneJdbcType}} is our default choice for that dialect, which binds {{ OffsetDateTime Instant }} through the JDBC driver.
It has yet to be confirmed if this is a bug or not , works without problems, but pgjdbc shifts {{OffsetDateTime}} to the JVM TZ when binding to a {{timestamp}} column. If we can’t be sure that this type is correct JDBC behavior, we might as well drop the {{InstantAsTimestampWithTimeZoneJdbcType}} and use {{InstantAsTimestampJdbcType}} instead for PostgreSQL used .
NB: Using the default {{ InstantAsTimestampJdbcType TimestampUtcAsJdbcTimestampJdbcType }} uses a shared calendar for passing UTC on the other hand will work perfectly fine, as that will always pass the time zone as argument . Maybe we need to copy that to be safe, but we could switch between a copying and shared implementation based on what we know about the drivers. |
|