Re: PreparedStatement.setDate() behavior with OVERLAPS

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PreparedStatement.setDate() behavior with OVERLAPS
Дата
Msg-id 20415.1439305209@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: PreparedStatement.setDate() behavior with OVERLAPS  (Dave Cramer <pg@fastcrypt.com>)
Ответы Re: PreparedStatement.setDate() behavior with OVERLAPS
Список pgsql-jdbc
Dave Cramer <pg@fastcrypt.com> writes:
> Here are the comments in the code.
>   // We must use UNSPECIFIED here, or inserting a Date-with-timezone into a
>   // timestamptz field does an unexpected rotation by the server's TimeZone:

Ugh.  But why not send it as a timestamptz?

(I suspect that the law of conservation of astonishment applies, such that
some other corner cases would act oddly if you do that.  But it might be
a net improvement anyway.)

> Apparently while dates don't store timezone information we do accept
> timezone info in date literals ?

Sure.  Times, too.  The same input parser is used for date, timestamp,
timestamptz, time, and timetz, and then we just throw away irrelevant
fields.

regression=# select '2015-08-11 10:55:04.509393-04'::date;
    date
------------
 2015-08-11
(1 row)

            regards, tom lane


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

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: PreparedStatement.setDate() behavior with OVERLAPS
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: PreparedStatement.setDate() behavior with OVERLAPS