Thread: pgsql: Disallow negative strides in date_bin()

pgsql: Disallow negative strides in date_bin()

From
John Naylor
Date:
Disallow negative strides in date_bin()

It's not clear what the semantics of negative strides would be, so throw
an error instead.

Per report from Bauyrzhan Sakhariyev

Reviewed-by: Tom Lane, Michael Paquier
Discussion:
https://www.postgresql.org/message-id/CAKpL73vZmLuFVuwF26FJ%2BNk11PVHhAnQRoREFcA03x7znRoFvA%40mail.gmail.com
Backpatch to v14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fc0d9b8c224ff6b84113cefdca1ba9dde879d863

Modified Files
--------------
doc/src/sgml/func.sgml                    | 8 ++------
src/backend/utils/adt/timestamp.c         | 8 ++++----
src/test/regress/expected/timestamp.out   | 5 ++++-
src/test/regress/expected/timestamptz.out | 5 ++++-
src/test/regress/sql/timestamp.sql        | 3 +++
src/test/regress/sql/timestamptz.sql      | 3 +++
6 files changed, 20 insertions(+), 12 deletions(-)