Different behaviour between 4.1.8 and 4.2.4 reading timestamp with timezone from postgres

45 views
Skip to first unread message

Jan Fengler

unread,
Feb 11, 2022, 3:16:10 AM2/11/22
to ve...@googlegroups.com
Hi,

we have stumbled upon changed behaviour reading timestamp with timezone from postgres between vert.x versions 4.1.8 an 4.2.x.
After further investigations I found out, that this change is due to the following difference (from JDBCQueryAction in 4.1.8 and JDBCDecoderImpl in 4.2.x (since 4.2.0)):
4.1.8:
    if (value instanceof Timestamp) {
      return ((Timestamp) value).toInstant().atOffset(ZoneOffset.UTC);
    }
4.2.4:
       if (value instanceof Timestamp) {
          return ((Timestamp) value).toLocalDateTime().atOffset(ZoneOffset.UTC);
        }
This difference moves the real point in time of the delivered times from the postgresql db in our implementation by the difference of the timezones between the source zone and the constant zone UTC.
Is this intended and if yes, can someone please give me a hint why?

If more information is needed, please just ask and I will try to provide it (and no, until now I do not have a reproducer/test case for it).

Currently I am just trying to find out, if the changed behaviour is intended (then we will have to change our implementation) or it was implemented by mistake and will be reverted.

Thx
  Jan

Asher Tarnopolski

unread,
Feb 11, 2022, 3:51:57 AM2/11/22
to vert.x
maybe this issue: https://github.com/vert-x3/vertx-jdbc-client/issues/263
is also related to the change you see. just fyi

Reply all
Reply to author
Forward
0 new messages