Disallow negative strides in date_bin()
authorJohn Naylor <john.naylor@postgresql.org>
Wed, 28 Jul 2021 15:22:58 +0000 (11:22 -0400)
committerJohn Naylor <john.naylor@postgresql.org>
Wed, 28 Jul 2021 16:10:12 +0000 (12:10 -0400)
commit3ba70d4e152372fd8ab90ed0887ee08d505ef306
tree0a9f052ccd6bf9a23b55442e512c4c5b19e0699c
parented1884a2fedeffd2e6902451a9d41f4b3f6e859f
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
doc/src/sgml/func.sgml
src/backend/utils/adt/timestamp.c
src/test/regress/expected/timestamp.out
src/test/regress/expected/timestamptz.out
src/test/regress/sql/timestamp.sql
src/test/regress/sql/timestamptz.sql