Message-ID: From: "davecramer (@davecramer)" To: "pgjdbc/pgjdbc" Date: Tue, 30 Jul 2019 14:16:00 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #1225: Java 8 Time Support for Postgres Arrays In-Reply-To: References: List-Id: X-GitHub-Author-Login: davecramer X-GitHub-Comment-Id: 516438497 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-516438497 Content-Type: text/plain; charset=utf-8 > > you'd probably be surprised to know that timestamp with timezone doesn't store the timezone either then. > > In PostgreSQL -- yes, I know. > > Right, I missed the fact the issue is broader than just `timestamp[]`. > I was not as much concerned about `timestamptz[]` being mapped to `java.sql.Timestamp[]` because in `timestamptz` case all I need is point in time. So this mapping at least does not lose information. https://github.com/prestosql/presto/blob/c39358eee752eac13959fd05dc5427502cf03b33/presto-postgresql/src/main/java/io/prestosql/plugin/postgresql/PostgreSqlClient.java#L355-L357 > > (Or course `java.time.Instant` would be more appropriate) > > For `date[]`, mapping to `java.sql.Date[]` loses information in one edge case only (`DATE '2011-12-30'` and `Pacific/Apia` zone). Of course, it's still desirable to get the `date[]` data as `java.time.LocalDate[]`. Can you elaborate on why this one edge case fails > > (Let me explain my point of view. I am concerned mostly about losing information and not about convenience, because in Presto use-cases, not losing information is all we need. Even accessing String would be enough. Others, are probably more interested in getting java.time. classes because in application code there is usually more code that interacts with JDBC in some way.) Sadly the whole date/time/timestamp thing with java and JDBC is beyond repair. We have to chose to be opinionated here. At the moment I'm not sure of the "best" opinion. I'm going to confer with the npgsql guys to see what their driver does to get some level of consistency