pgsql: Tighten unit parsing in internal values

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Tighten unit parsing in internal values
Date: 2023-08-28 05:28:02
Message-ID: E1qaUnB-001ISZ-Ve@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Tighten unit parsing in internal values

Interval values now generate an error when the user has multiple
consecutive units or a unit without a value. Previously, it was
possible to specify multiple units consecutively which is contrary to
what the documentation allows, so it was possible to finish with
confusing interval values.

This is a follow-up of the work done in 165d581f146b.

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/617f9b7d4b10fec00a86802eeb34d7295c52d747

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

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2023-08-28 05:38:28 pgsql: Convert encrypted SSL test keys to PKCS#8 format
Previous Message Michael Paquier 2023-08-28 04:50:33 pgsql: Tighten handling of "ago" in interval values