You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Very interesting project. I like it very much. I hope it becomes mature enough to be used in production settings soon.
I found this library the other after playing a bit with the Spring Reactive Playground project.
So I decided to write a small reactive application today. I wrote a very simple program that was intended to read a row from a table in my database. I have a field last_modified which is a timestamp. When I try to read the field doing a row.getTimestamp() I get an SqlException:
com.github.pgasync.SqlException: Invalid time: 2016-07-01 09:00:05-06
at com.github.pgasync.impl.conversion.TemporalConversions.toTimestamp(TemporalConversions.java:90)
at com.github.pgasync.impl.conversion.DataConverter.toTimestamp(DataConverter.java:63)
at com.github.pgasync.impl.PgRow.getTimestamp(PgRow.java:174)
...
The problem seems to be located in the TemporalConversions.toTimstamp() method as you can see. It appears that the default configuration for timestamp is not working for me out of the box.
My date format seems to be yyyy-MM-dd HH:mm:ssX but the one given in the toTimestamp() is yyyy-MM-dd HH:mm:ss.SSS and this breaks my code.
Not sure why the driver chooses that particular date time format, but I suppose it does not apply to all PostgreSQL configurations.
I wonder if the format can be configured somehow without I having to write my own Timestamp converter, but otherwise you may want to look into this issue or perhaps offer a way to configure the format either globally or in the toTimestamp() function.
To make things worse I cannot retrieve the value neither as a string or as a long without getting an "unsupported conversion exception", so basically I cannot retrieve the record from the database simply because my timestamp format is different.
The text was updated successfully, but these errors were encountered:
Very interesting project. I like it very much. I hope it becomes mature enough to be used in production settings soon.
I found this library the other after playing a bit with the Spring Reactive Playground project.
So I decided to write a small reactive application today. I wrote a very simple program that was intended to read a row from a table in my database. I have a field
last_modified
which is a timestamp. When I try to read the field doing arow.getTimestamp()
I get an SqlException:The problem seems to be located in the
TemporalConversions.toTimstamp()
method as you can see. It appears that the default configuration for timestamp is not working for me out of the box.My date format seems to be
yyyy-MM-dd HH:mm:ssX
but the one given in thetoTimestamp()
isyyyy-MM-dd HH:mm:ss.SSS
and this breaks my code.Not sure why the driver chooses that particular date time format, but I suppose it does not apply to all PostgreSQL configurations.
I wonder if the format can be configured somehow without I having to write my own Timestamp converter, but otherwise you may want to look into this issue or perhaps offer a way to configure the format either globally or in the
toTimestamp()
function.To make things worse I cannot retrieve the value neither as a string or as a long without getting an "unsupported conversion exception", so basically I cannot retrieve the record from the database simply because my timestamp format is different.
The text was updated successfully, but these errors were encountered: