Open richturner opened 7 months ago
Will try to investigate this, and identify the issue with the from/to timestamps.
A bit unrelated, but still interesting to note, is that the lttb
function from Timescale uses timezones in their parameters;
https://docs.timescale.com/api/latest/hyperfunctions/downsampling#lttb
lttb(
ts TIMESTAMPTZ,
value DOUBLE PRECISION,
resolution INT
) RETURNS Timevector
(for context; haven't done any investigation on the issue yet)
The
Test lttb datapoint query
in AssetDatapointQueryTest is broken and it seems to be time zone related.On upsert timestamps seem to be correctly set to UTC time.
But on query the requested from/to time is wrong, here is value of PreparedStatement generated and you can see zoned time strings which are then cast to timestamp (which is the column type) but by doing this the timezone is truncated so the query executes using the wrong time:
See this pgjdbc issue which gives some context, looks like they may have made a change which has broken things for us once the pgjdbc driver was updated:
https://github.com/pgjdbc/pgjdbc/issues/2850
Using a timestamp without time zone column in postgres is fine as long as we make sure we always insert/query data in UTC time, as described above this is not happening.