Message-ID: From: "geekbeast (@geekbeast)" To: "pgjdbc/pgjdbc" Date: Fri, 27 Jul 2018 11:10:45 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #1225: Java 8 Time Support for Postgres Arrays In-Reply-To: References: List-Id: X-GitHub-Author-Login: geekbeast X-GitHub-Comment-Id: 408388169 X-GitHub-Comment-Type: issue_comment X-GitHub-Edited-At: 2018-07-27T11:11:10Z X-GitHub-Issue: 1225 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/1225#issuecomment-408388169 Content-Type: text/plain; charset=utf-8 Mostly for read as I get an array due to an ```array_agg(...)``` on the read. I worked around it for now with: ``` case Date: objects = Stream .of( (Date[]) arr.getArray() ) .map( Date::toLocalDate ) .collect( Collectors.toList() ); break; case TimeOfDay: objects = Stream .of( (Time[]) arr.getArray() ) .map( Time::toLocalTime ) .collect( Collectors.toList() ); break; case DateTimeOffset: objects = Stream .of( (Timestamp[]) arr.getArray() ) .map( ts -> OffsetDateTime .ofInstant( Instant.ofEpochMilli( ts.getTime() ), ZoneId.of( "UTC" ) ) ) .collect( Collectors.toList() ); ```