Re: [JDBC] Timestamp parameter gets sent as date - Mailing list pgsql-jdbc

From Vladimir Sitnikov
Subject Re: [JDBC] Timestamp parameter gets sent as date
Date
Msg-id CAB=Je-EHbENUQm0C9BFX3cCmT1bEMaw0+UxVAT-pzA7=D1tdcg@mail.gmail.com
Whole thread Raw
In response to [JDBC] Timestamp parameter gets sent as date  (Genya <genyap@online.ua>)
List 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 by date:

Previous
From: Tom Dunstan
Date:
Subject: Re: [JDBC] Reading and writing off-heap data
Next
From: Vladimir Sitnikov
Date:
Subject: Re: [JDBC] Reading and writing off-heap data