Tighten unit parsing in internal values
commit617f9b7d4b10fec00a86802eeb34d7295c52d747
authorMichael Paquier <michael@paquier.xyz>
Mon, 28 Aug 2023 05:27:17 +0000 (28 14:27 +0900)
committerMichael Paquier <michael@paquier.xyz>
Mon, 28 Aug 2023 05:27:17 +0000 (28 14:27 +0900)
tree8b2fd69b379df49ec705940c4d1a41cc7299e727
parent165d581f146b09543b832513ee00fead132ba6b1
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
src/backend/utils/adt/datetime.c
src/test/regress/expected/interval.out
src/test/regress/sql/interval.sql