Improve behavior of date_bin with origin in the future
authorPeter Eisentraut <peter@eisentraut.org>
Sat, 10 Apr 2021 17:33:46 +0000 (19:33 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Sat, 10 Apr 2021 17:33:46 +0000 (19:33 +0200)
commit496e58bb0e5e939e6ed5839c92b05e3ab11b54bb
tree7a58b873caea3816bac0579bac291a6629678ab8
parent99964c4ade468c35a3f6e248a2380a1ff67d9cd3
Improve behavior of date_bin with origin in the future

Currently, when the origin is after the input, the result is the
timestamp at the end of the bin, rather than the beginning as
expected.  This puts the result consistently at the beginning of the
bin.

Author: John Naylor <john.naylor@enterprisedb.com>
Discussion: http://www.postgresql.org/message-id/CAFBsxsGjLDxQofRfH+d4KSAXxPf3MMevUG7s6EDfdBOvHLDLjw@mail.gmail.com
src/backend/utils/adt/timestamp.c
src/test/regress/expected/timestamp.out
src/test/regress/sql/timestamp.sql