In brief:
I know for a fact that timescale does not support the creation of materialized continuous aggregates while using the at time zone <timezone>' being the type of the column to be aggregated
timezonetz`
so, I thought on creating a bunch of columns for each timezone to add them as dimensions to the hypertable and use those columns to create materialized views based on each column with the timezone required. But I’m getting an error that the column I’m pointing is not part of the dimension of the hypertable although when i add the dimension I get the error that it is already a dimension of the hypertable. So, once more how could I create materialized views for continuos aggregates to handle timezones?
TimescaleDB version: 2.12.0
PostgreSQL version: PostgreSQL 15.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 13.2.1 20230801, 64-bit
Other software:
OS: Linux
So basically when I do the next query:
select time_bucket(interval '1 hour', bucket at time zone 'Etc/GMT-1') as "hourly_bucket_Etc/GMT-1",
time_bucket(interval '1 hour', bucket at time zone 'Etc/GMT+4') as "hourly_bucket_Etc/GMT+4",
time_bucket(interval '1 hour', bucket at time zone 'Etc/GMT+5') as "hourly_bucket_Etc/GMT+5",
time_bucket(interval '1 hour', bucket at time zone 'Etc/GMT+6') as "hourly_bucket_Etc/GMT+6",
time_bucket(interval '1 hour', bucket at time zone 'Etc/GMT+7') as "hourly_bucket_Etc/GMT+7",
time_bucket(interval '1 hour', bucket at time zone 'Etc/GMT+8') as "hourly_bucket_Etc/GMT+8",
time_bucket(interval '1 hour', bucket at time zone 'Etc/GMT') as "hourly_bucket_Etc/GMT",
I get the result I would like so then I could create a materialized view from the query but timescale giving a error back when trying it
create materialized view "data_hours"
with (timescaledb.continuous) as
select time_bucket(interval '1 hour', bucket at time zone 'Etc/GMT+5') as "hourly_bucket_Etc/GMT+5",) as "hourly_bucket_Etc/GMT+5",
Timescale would say that the bucket at time zone is not part of the hypertable. What I tried then is to add from source the colums with all the timezones needed and add those column to the dimension of that hypertable using the SELECT add_dimension('<nameofthehypertable>', 'bucket_Etc/GMT-1', chunk_time_interval => INTERVAL '1 hour');
It adds the column to the hypertable as a dimension and then I use the create materialized view
but timescale refuse to create the materialized view.
When only using UTC and one column to aggregate it works fine. However the requirement is to have all this timezone handling
Is there a way to create this materialized views? why add_dimension is not letting me create the materialized view, does this command add the column in order to be aggregated by timescale or I totally missunderstood it?
Please help!!!