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
PostgreSQL version (PostgreSQL 15.6 (Ubuntu 15.6-1.pgdg22.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit
TimescaleDB Toolkit version 1.18.0
Installation method: docker
Describe the bug
The query involving time_bucket_gapfill and interpolated_average fails when using a two (or more)-day bucket interval during the daylight saving period with the PostgreSQL session's timezone set to Europe/Berlin. It functions correctly when the timezone is set to UTC or CET, and interestingly, it also works without issue when using a one-day bucket interval under the same conditions.
To Reproduce
Steps to reproduce the behavior:
Set the PostgreSQL session timezone to Europe/Berlin.
Execute the following SQL query:
SET TIMEZONE ='EUROPE/BERLIN';
WITH generated_series AS (SELECT generate_series(
TIMESTAMP WITH TIME ZONE'2024-03-27 00:00:00',
TIMESTAMP WITH TIME ZONE'2024-04-08 23:59:59',
INTERVAL '30 second'
) AStime,
random() *1000AS raw_value),
timeweighted_cte AS (SELECT time_bucket_gapfill(INTERVAL '2 days', time) AStimestamp,
time_weight('locf', time, raw_value) AS time_weight_summary,
locf(last(raw_value, time)::NUMERIC) AS value
FROM generated_series
WHEREtime BETWEEN TIMESTAMP WITH TIME ZONE'2024-04-01 08:36:00+00:00'ANDTIMESTAMP WITH TIME ZONE'2024-04-04 22:00:00+00:00'GROUP BYtimestamp)
SELECT time_bucket_gapfill(INTERVAL '2 days', timestamp) AStimestamp,
interpolated_average(
tws := time_weight_summary,
start :=timestamp,
duration := INTERVAL '2 days') AS value
FROM timeweighted_cte
ORDER BYtimestamp;
Observe the error message: ERROR: Interval end (765327600000000) must be after last timestamp (765331170000000).
Expected behavior
The query should execute without errors, regardless of the bucket interval or the timezone setting, including during periods that observe daylight saving time.
Actual behavior
The query fails with an error message when a two-day bucket interval is used during the daylight saving period in the Europe/Berlin timezone. The issue does not occur when using a one-day bucket interval.
The text was updated successfully, but these errors were encountered:
Relevant system information:
Describe the bug
The query involving time_bucket_gapfill and interpolated_average fails when using a two (or more)-day bucket interval during the daylight saving period with the PostgreSQL session's timezone set to Europe/Berlin. It functions correctly when the timezone is set to UTC or CET, and interestingly, it also works without issue when using a one-day bucket interval under the same conditions.
To Reproduce
Steps to reproduce the behavior:
Europe/Berlin
.Expected behavior
The query should execute without errors, regardless of the bucket interval or the timezone setting, including during periods that observe daylight saving time.
Actual behavior
The query fails with an error message when a two-day bucket interval is used during the daylight saving period in the Europe/Berlin timezone. The issue does not occur when using a one-day bucket interval.
The text was updated successfully, but these errors were encountered: