6 Commits

Author SHA1 Message Date
Aleksander Alekseev
ab71c4a1c1 Mark time_bucket_ng() as IMMUTABLE
This patch marks time_bucket_ng() as IMMUTABLE. Two exceptions are:

- time_bucket_ng(interval, timestamptz) timestamptz
- time_bucket_ng(interval, timestamptz, timestamptz) timestamptz

... due to their implementation, see the comments. These two overloaded
versions were introduced only for backward compatibility with time_bucket()
and are not needed for building continuous aggregates.
2021-09-07 20:00:31 +03:00
Aleksander Alekseev
dc67eb75d6 time_bucket_ng() version with origin argument
This patch adds a version of time_bucket_ng() with 'origin' argument.

It doesn't address any other known issues. E.g. volatility of the function
will be changed in another patch. The error messages are going to be improved
when the feature gets a little more stable.
2021-09-03 17:36:29 +03:00
Aleksander Alekseev
22e77a77ad Support timezones in time_bucket_ng()
This patch adds support of timezones in time_bucket_ng(). The 'origin'
argument can't be used with timezones yet. This will be implemented in
a separate pull request.
2021-09-01 11:23:56 +03:00
Aleksander Alekseev
99f7a2122f Support seconds, minutes, and hours in time_bucket_ng()
As a future replacement for time_bucket(), time_bucket_ng()
should support seconds, minutes, and hours. This patch adds
this support. The implementation is the same as for
time_bucket(). Timezones are not yet supported.
2021-07-20 12:34:57 +03:00
Aleksander Alekseev
e57155fdc0 time_bucket_ng() may be IMMUTABLE depending on arguments.
This function is IMMUTABLE when it doesn't accept timestamptz arguments,
and STABLE otherwise. See the comments in sql/time_bucket_ng.sql for
more details.
2021-06-25 12:36:14 +03:00
Aleksander Alekseev
33dfdcf5ea Introduce experimental time_bucket_ng() function
This patch adds time_bucket_ng() function to the experimental
schema. The "ng" part stands for "next generation". Unlike
current time_bucket() implementation the _ng version will support
months, years and timezones.

Current implementation doesn't claim to be complete. For instance,
it doesn't support timezones yet. The reasons to commit it in it's
current state are 1) to shorten the feedback loop 2) to start
experimenting with monthly buckets are soon as possible,
3) to reduce the unnecessary work of rebasing and resolving
conflicts 4) to make the work easier to the reviewers
2021-06-21 12:00:18 +03:00