[pgjdbc/pgjdbc] e8c43f: fix: use 'time with time zone' and 'timestamp with...

From: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: [pgjdbc/pgjdbc] e8c43f: fix: use 'time with time zone' and 'timestamp with...
Date: 2018-01-08 21:09:34
Message-ID: 5a53de0e1baa_25302b0982e1fc10144ba@hookshot-fe-32b5f5b.cp1-iad.github.net.mail
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Branch: refs/heads/master
Home: https://github.com/pgjdbc/pgjdbc
Commit: e8c43f36ab2a6843f37d27e7417a5214f7142084
https://github.com/pgjdbc/pgjdbc/commit/e8c43f36ab2a6843f37d27e7417a5214f7142084
Author: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
Date: 2018-01-09 (Tue, 09 Jan 2018)

Changed paths:
M pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
M pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java
M pgjdbc/src/test/java/org/postgresql/test/jdbc2/TimezoneTest.java

Log Message:
-----------
fix: use 'time with time zone' and 'timestamp with time zone' values as is and avoid computation with user-provided/default Calendars

Previous behavior:
getTime(int), getTime(int, Calendar) kind of methods ensured that the resulting java.sql.Time
would render as 1970-01-01 ... in the given time zone (e.g. given Calendar and/or default TimeZone)
Note: the resulting Time object

New behavior:
for 'time with time zone' and 'timestamp with time zone' the value from the server is assumed to be
"instant" (i.e. absolute point in time), and no further adjustments is made to make the date part to be 1970-01-01

'time' and 'timestamp' work as earlier except "00:00:00" and "24:00:00" times in text format.
Previously, text times "00:00:00" and "24:00:00" were mapped to Time(0) and Time.valueOf("24:00:00"):
1) Time(0) is 1970-01-01 00:00:00 UTC (it does not account neither user-provided nor default Calendar)
2) Time.valueOf("24:00:00") uses system-provided calendar, and it does not account user-provided one

Commit: be06946f8b908536f4d659aaf6fc660bed339f67
https://github.com/pgjdbc/pgjdbc/commit/be06946f8b908536f4d659aaf6fc660bed339f67
Author: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
Date: 2018-01-09 (Tue, 09 Jan 2018)

Changed paths:
M pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java
M pgjdbc/src/test/java/org/postgresql/test/jdbc42/SetObject310Test.java

Log Message:
-----------
test: refactor SetObject310Test to use proper assertion messages and use less statements (make it faster)

Compare: https://github.com/pgjdbc/pgjdbc/compare/684a69920e08...be06946f8b90

Browse pgsql-jdbc by date

  From Date Subject
Next Message Vladimir Sitnikov 2018-01-08 21:10:00 [pgjdbc/pgjdbc] a94cfe: refactor: factor out receiveParameterStatus so all...
Previous Message Vladimir Sitnikov 2018-01-08 19:19:56 [pgjdbc/pgjdbc] 684a69: fix: execute autosave/rollback savepoint via simpl...