-
Notifications
You must be signed in to change notification settings - Fork 31
Description
I use the sql adapter to write aquired data of our pv-equipment (and others) into a postgres database using the timescaledb extension.
Basicly this setup works great.
But there is a disatvantage for the aggregats with timescaledb coming from the unix epoch time format used for ts by the adapter: when time buckets are defined as integer type, one has to specify periods for buckets in absolute numbers - data base known time periods (day, week,month, year etc.) are not allowed neither the use of conversion functions when setup time buckets.
So if aggregate periods have varying lengths, for example 'month' - they can not be specified by the known database keywords (they would calculate borders correctly), which yields to wrong period borders
So, for use of timescaledb extension it would be helpful to be able to switch the ts format from unix epoch to a date/time format at the adapter setup.
I could not find any workaround for this problem within the database - trying by adding a generated column at the database table with calculated time value does not work, because timescaledb refuses the use of generated column values for that.