Re: Mapping of timestamptz to TIMESTAMP vs. TIMESTAMP_WITH_TIMEZONE

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: Mapping of timestamptz to TIMESTAMP vs. TIMESTAMP_WITH_TIMEZONE
Дата
Msg-id CADK3HHKbd=V3+DMvMfvPB4zuTb87mjmc4+GWqQANO7S1LyNY_A@mail.gmail.com
обсуждение исходный текст
Ответ на Mapping of timestamptz to TIMESTAMP vs. TIMESTAMP_WITH_TIMEZONE  (Ben Horowitz <bhorowit@gmail.com>)
Список pgsql-jdbc
Probably should be. Care to provide a Pull Request ?
Dave Cramer
www.postgres.rocks


On Fri, 17 Nov 2023 at 20:19, Ben Horowitz <bhorowit@gmail.com> wrote:
Hi,

Apologies if this is a duplicate of an answered question. I searched in the mailing list archives, Stack Overflow, etc., and didn't find anything.

At the line linked below in TypeInfoCache, it appears that type timestamptz is getting mapped to the type java.sql.Types.TIMESTAMP [1] . It seems like it should be mapped to java.sql.Types.TIMESTAMP_WITH_TIMEZONE.

TIMESTAMP_WITH_TIMEZONE was introduced in Java 8 (2014). Is the mapping of timestamptz to TIMESTAMP intentional for reasons of backwards compatibility?

I found the behavior surprising, and also found a question on Stack Overflow where someone else was surprised [2].

Thanks very much,
Ben


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Ben Horowitz
Дата:
Сообщение: Mapping of timestamptz to TIMESTAMP vs. TIMESTAMP_WITH_TIMEZONE
Следующее
От: Nikolay Prokofiev
Дата:
Сообщение: Pg jdbc DNS failover