This is useful when one wants to bind a timestamp parameter to an Instant, which might fail on PostgreSQL, because right now, we use InstantAsTimestampWithTimeZoneJdbcType for that dialect, which binds OffsetDateTime through the JDBC driver. It has yet to be confirmed if this is a bug or not, but pgjdbc shifts OffsetDateTime to the JVM TZ when binding to a timestamp column. If this is correct JDBC behavior, we might as well drop the InstantAsTimestampWithTimeZoneJdbcType and use InstantAsTimestampJdbcType instead for PostgreSQL. NB: InstantAsTimestampJdbcType uses a shared calendar for passing UTC as time zone. 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. |