pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Disallow infinite endpoints in generate_series() for timestamps.
Date: Wed, 20 Apr 2022 22:08:37 +0000
Message-ID: <E1nhIV2-000KSn-V2@gemulon.postgresql.org> (raw)

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

Branch
------
REL_14_STABLE

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

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(+)



view thread (6+ messages)  latest in thread

Message-ID: <E1nhIV2-000KSn-V2@gemulon.postgresql.org>
Permalink:  ../E1nhIV2-000KSn-V2@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nhIV2-000KSn-V2@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Disallow infinite endpoints in generate_series() for timestamps.
  In-Reply-To: <E1nhIV2-000KSn-V2@gemulon.postgresql.org>
  References: <E1nhIV2-000KSn-V2@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox