1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

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
This commit is contained in:
John Naylor
2021-07-28 11:22:58 -04:00
parent 5a8a9be083
commit fc0d9b8c22
6 changed files with 20 additions and 12 deletions

View File

@ -10008,12 +10008,8 @@ SELECT date_bin('15 minutes', TIMESTAMP '2020-02-11 15:44:17', TIMESTAMP '2001-0
</para>
<para>
Negative intervals are allowed and are treated the same as positive intervals.
</para>
<para>
The <parameter>stride</parameter> interval cannot contain units of month
or larger.
The <parameter>stride</parameter> interval must be greater than zero and
cannot contain units of month or larger.
</para>
</sect2>