Add date_bin function
Peter Eisentraut <peter@eisentraut.org>
Add date_bin function Similar to date_trunc, but allows binning by an arbitrary interval rather than just full units. Author: John Naylor <john.naylor@enterprisedb.com> Reviewed-by: David Fetter <david@fetter.org> Reviewed-by: Isaac Morland <isaac.morland@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Artur Zakirov <zaartur@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/CACPNZCt4buQFRgy6DyjuZS-2aPDpccRkrJBmgUfwYc1KiaXYxg@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/func.sgml | modified | +50 −0 |
| src/backend/utils/adt/timestamp.c | modified | +74 −0 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_proc.dat | modified | +11 −0 |
| src/test/regress/expected/timestamp.out | modified | +96 −0 |
| src/test/regress/expected/timestamptz.out | modified | +66 −0 |
| src/test/regress/sql/timestamp.sql | modified | +62 −0 |
| src/test/regress/sql/timestamptz.sql | modified | +42 −0 |
Documentation touched
Discussion
- truncating timestamps on arbitrary intervals 45 messages · 2020-02-26 → 2021-07-28