pgsql: Convert datetime input functions to use "soft" error reporting.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Convert datetime input functions to use "soft" error reporting.
Date: 2022-12-09 21:08:06
Message-ID: E1p3kbF-002ioT-Tg@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Convert datetime input functions to use "soft" error reporting.

This patch converts the input functions for date, time, timetz,
timestamp, timestamptz, and interval to the new soft-error style.
There's some related stuff in formatting.c that remains to be
cleaned up, but that seems like a separable project.

Discussion: https://postgr.es/m/3bbbb0df-7382-bf87-9737-340ba096e034@postgrespro.ru

Branch
------
master

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

Modified Files
--------------
src/backend/utils/adt/date.c | 31 ++++++----
src/backend/utils/adt/datetime.c | 22 +++++---
src/backend/utils/adt/formatting.c | 21 ++++---
src/backend/utils/adt/timestamp.c | 94 ++++++++++++++++---------------
src/include/utils/datetime.h | 12 ++--
src/test/regress/expected/date.out | 31 ++++++++++
src/test/regress/expected/interval.out | 31 ++++++++++
src/test/regress/expected/time.out | 31 ++++++++++
src/test/regress/expected/timestamp.out | 31 ++++++++++
src/test/regress/expected/timestamptz.out | 31 ++++++++++
src/test/regress/expected/timetz.out | 31 ++++++++++
src/test/regress/sql/date.sql | 7 +++
src/test/regress/sql/interval.sql | 7 +++
src/test/regress/sql/time.sql | 7 +++
src/test/regress/sql/timestamp.sql | 7 +++
src/test/regress/sql/timestamptz.sql | 7 +++
src/test/regress/sql/timetz.sql | 7 +++
17 files changed, 328 insertions(+), 80 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2022-12-10 01:16:10 pgsql: Restructure soft-error handling in formatting.c.
Previous Message Tom Lane 2022-12-09 18:30:57 pgsql: Allow DateTimeParseError to handle bad-timezone error messages.