tembo-io / pg_timeseries

Simple and focused time-series tables for PostgreSQL, from Tembo
PostgreSQL License
324 stars 5 forks source link

Honor open ranges in date_bin_table #24

Closed jasonmp85 closed 4 months ago

jasonmp85 commented 4 months ago

Because I was unpacking the endpoints of the range into a naive BETWEEN check, ranges with open ends (i.e. non-inclusive) were not honored in the final output.

Adding a range inclusion check on the JOIN fixes the issue. Added a new test query to verify the correct behavior.

Fixes #19.