pgsql: Switch some date/timestamp functions to use the soft error repor

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Switch some date/timestamp functions to use the soft error repor
Date: 2025-12-01 06:22:44
Message-ID: E1vPxJ5-002F0M-2z@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Switch some date/timestamp functions to use the soft error reporting

This commit changes some functions related to the data types date and
timestamp to use the soft error reporting rather than a custom boolean
flag called "overflow", used to let the callers of these functions know
if an overflow happens.

This results in the removal of some boilerplate code, as it is possible
to rely on an error context rather than a custom state, with the
possibility to use the error generated inside the functions updated
here, if necessary.

These functions were suffixed with "_opt_overflow". They are now
renamed to use "_safe" as suffix.

This work is similar to 4246a977bad6.

Author: Amul Sul <sulamul(at)gmail(dot)com>
Reviewed-by: Amit Langote <amitlangote09(at)gmail(dot)com>
Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Discussion: https://postgr.es/m/CAAJ_b95HEmFyzHZfsdPquSHeswcopk8MCG1Q_vn4tVkZ+xxofw@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
contrib/btree_gin/btree_gin.c | 25 ++---
src/backend/utils/adt/date.c | 209 ++++++++++++++++--------------------------
src/include/utils/date.h | 8 +-
3 files changed, 96 insertions(+), 146 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2025-12-01 07:22:34 pgsql: Move WAL sequence code into its own file
Previous Message Thomas Munro 2025-11-30 02:20:35 Re: pgsql: Inline pg_ascii_tolower() and pg_ascii_toupper().