pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Tighten handling of "ago" in interval values
Date: Mon, 28 Aug 2023 04:50:33 +0000
Message-ID: <E1qaUCv-001I6I-49@gemulon.postgresql.org> (raw)

Tighten handling of "ago" in interval values

This commit Restrict the unit "ago" to only appear at the end of the
interval.  According to the documentation, a direction can only be
defined at the end of an interval, but it was possible to define it in
the middle of the string or define it multiple times.

In spirit, this is similar to the error handling improvements done in
5b3c5953553b or bcc704b524904.

Author: Joseph Koshakow
Reviewed-by: Jacob Champion, Gurjeet Singh, Reid Thompson
Discussion: https://postgr.es/m/CAAvxfHd-yNO+XYnUxL=GaNZ1n+eE0V-oE0+-cC1jdjdU0KS3iw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/165d581f146b09543b832513ee00fead132ba6b1

Modified Files
--------------
src/backend/utils/adt/datetime.c       | 7 +++++++
src/test/regress/expected/interval.out | 9 +++++++++
src/test/regress/sql/interval.sql      | 4 ++++
3 files changed, 20 insertions(+)



Message-ID: <E1qaUCv-001I6I-49@gemulon.postgresql.org>
Permalink:  ../E1qaUCv-001I6I-49@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qaUCv-001I6I-49@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Tighten handling of "ago" in interval values
  In-Reply-To: <E1qaUCv-001I6I-49@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