Invalid quoting of DateTime and Time values
Closed this issue · 4 comments
Look at this line. As you can see this code convert original value to string and cast to timestamp
datatype.
I see the following problems:
- It is loose information about timezone.
- It is force Vertica to using system timezone. If I pass value in +0300 timezone, but system timezone was set to +0400 Vertica will write value in +0400 timezone to
timestamptz
column.
How about just convert date time values to ISO8601 (which is de facto standard for present date and time) and remove cast to timestamp
datatype?
P.S. I am ready to provide PR if somebody review and approve it.
This makes sense to me.
- I am a bit afraid of breaking backwards compatibility though What happens when you provide a
timestamptz
value to atimestamp
column? How does that compare to the current behavior? - We should probably add some documentation around timestamps and how they are handled. This can be very confusing.
What happens when you provide a
timestamptz
value to atimestamp
column?
... If a time zone is specified in the input it is silently ignored.
- from here
How does that compare to the current behavior?
It is equal to current behavior with timestamp
column because quote
silently ignored specified timezone.
I am a bit afraid of breaking backwards compatibility
Seems like this is doesn't break backward compatibility (as explained above) but fix bug with timestamptz
columns.
👍, feel free to open up a pull requests, with some tests that check the new behavior is working as expected.
Potentially relevant: #35