pgsql: Improve behavior of date_bin with origin in the future

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Improve behavior of date_bin with origin in the future
Date: 2021-04-10 17:45:15
Message-ID: E1lVHfX-0002sR-TP@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)naylor(at)enterprisedb(dot)com>
Discussion: https://www.postgresql.org/message-id/CAFBsxsGjLDxQofRfH+d4KSAXxPf3MMevUG7s6EDfdBOvHLDLjw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/496e58bb0e5e939e6ed5839c92b05e3ab11b54bb

Modified Files
--------------
src/backend/utils/adt/timestamp.c | 14 +++++++++
src/test/regress/expected/timestamp.out | 54 +++++++++++++++++++++++++++++++++
src/test/regress/sql/timestamp.sql | 34 +++++++++++++++++++++
3 files changed, 102 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2021-04-10 19:03:42 pgsql: Standardize pg_authid oid_symbol values.
Previous Message Tom Lane 2021-04-10 17:16:16 pgsql: Fix failure of xlogprefetch.h to include all prerequisite header