Disallow infinite endpoints in generate_series() for timestamps.
authorTom Lane <[email protected]>
Wed, 20 Apr 2022 22:08:15 +0000 (18:08 -0400)
committerTom Lane <[email protected]>
Wed, 20 Apr 2022 22:08:15 +0000 (18:08 -0400)
commita1e4782a0bca3f19f05042c6f05675dbf4fcacc7
tree3eabddbe49150e395245471678aae801d04f047d
parent409bcfda6bd62479f4f7e745c4a536757dbe9637
Disallow infinite endpoints in generate_series() for timestamps.

Such cases will lead to infinite loops, so they're of no practical
value.  The numeric variant of generate_series() already threw error
for this, so borrow its message wording.

Per report from Richard Wesley.  Back-patch to all supported branches.

Discussion: https://postgr.es/m/91B44E7B-68D5-448F-95C8-B4B3B0F5DEAF@duckdblabs.com
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