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/[email protected]

Branch
------
master

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

Modified Files
--------------
src/backend/utils/adt/timestamp.c         | 28 ++++++++++++++++++
src/test/regress/expected/timestamp.out   | 49 +++++++++++++++++++++++++++++++
src/test/regress/expected/timestamptz.out | 49 +++++++++++++++++++++++++++++++
src/test/regress/sql/timestamp.sql        | 15 ++++++++++
src/test/regress/sql/timestamptz.sql      | 15 ++++++++++
5 files changed, 156 insertions(+)

Reply via email to