Message-ID: From: "guyco33 (@guyco33)" To: "pgjdbc/pgjdbc" Date: Tue, 30 Jul 2019 08:06:25 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #1225: Java 8 Time Support for Postgres Arrays In-Reply-To: References: List-Id: X-GitHub-Author-Login: guyco33 X-GitHub-Comment-Id: 516312324 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 1225 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/1225#issuecomment-516312324 Content-Type: text/plain; charset=utf-8 I've also encountered similar issue with `timestamp[]`: ``` create table test_ts(ts_col timestamp, ts_arr_col timestamp[]); insert into test_ts values ( '1970-01-01 00:12:34.567'::timestamp, array['1970-01-01 00:12:34.567'::timestamp]); select * from public.test_ts; ts_col | ts_arr_col -------------------------+----------------------------- 1970-01-01 00:12:34.567 | {"1970-01-01 00:12:34.567"} (1 row) ``` `rs.getTimestamp("ts_col"));` --> 1970-01-01 01:12:34.567 (wrong value) `rs.getObject("ts_col", LocalDateTime.class);` --> 1970-01-01T00:12:34.567 `Array.get(rs.getArray("ts_arr_col").getArray(),0));` --> 1970-01-01 01:12:34.567 (wrong value) `Array.get(rs.getArray("ts_arr_col").getArray(),0).getClass()` --> class `java.sql.Timestamp` As you can see, it's not possible to retrieve the correct value from `timestamp[]`, since there is no way to use `java.time.LocalDateTime`