Re: [JDBC] Timestamp parameter gets sent as date

Поиск
Список
Период
Сортировка
От Vladimir Sitnikov
Тема Re: [JDBC] Timestamp parameter gets sent as date
Дата
Msg-id CAB=Je-EHbENUQm0C9BFX3cCmT1bEMaw0+UxVAT-pzA7=D1tdcg@mail.gmail.com
обсуждение исходный текст
Ответ на [JDBC] Timestamp parameter gets sent as date  (Genya <genyap@online.ua>)
Список pgsql-jdbc
>Debugger always has shown date parameter set as 2017-01-10 16:45:00+02 so time zone was present (though I don't use it)
>Still don't understand why it's happening SOMETIMES (not always), seems like a bug ?

Suppose the statement is "select function(?)".
In this case pgjdbc has no clue if backend wants "with time zone" or "without time zone".
This is why pgjdbc passes the timestamp as string with timezone info like "2017-01-10 16:45:00+02".
In case backend wants "with time zone" it uses the timezone from the string, and in case backend wants "without time zone" it just silently ignores the timezone.

Regarding "sometimes", I've no idea (yet).

>it does not log anything when the application is up. Is it Spring related ?

I've no idea. A reproducer would probably help to analyze the issue.

Vladimir

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

Предыдущее
От: Tom Dunstan
Дата:
Сообщение: Re: [JDBC] Reading and writing off-heap data
Следующее
От: Vladimir Sitnikov
Дата:
Сообщение: Re: [JDBC] Reading and writing off-heap data