-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Relevant system information:
- OS: macOS 15.4.1
- PostgreSQL version (output of
SELECT version();): 17.4 - TimescaleDB Toolkit version (output of
\dx timescaledb_toolkitinpsql): 1.21.0 - Installation method: docker
Describe the bug
When stats_agg is run on large bigint values like 5223372036854775805 and 5223372036854775806 that approach the limit of bigint, hyperfunctions like average return the wrong value.
To Reproduce
Steps to reproduce the behavior:
Run this SQL:
SELECT average(stats_agg(data)) FROM generate_series(5223372036854775805::bigint, 5223372036854775806) data;
Expected behavior
Either an overflow error if not supported, or a workaround using decimal or numeric value types.
Actual behavior
For the stated reproduction the result is '5223372036854775800'. The actual result should be '5223372036854775805.5'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working

