Refactoring: Use soft error reporting for *_opt_overflow functions of date/timestamp

From: Amul Sul <sulamul(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Refactoring: Use soft error reporting for *_opt_overflow functions of date/timestamp
Date: 2025-11-26 09:39:25
Message-ID: CAAJ_b95HEmFyzHZfsdPquSHeswcopk8MCG1Q_vn4tVkZ+xxofw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

The attached patch proposes to use soft error reporting infrastructure
for the date/timestamp conversion function, which currently depends on
integer variables to control error throwing.

This continues the previous refactoring commit [1] where we adopted
soft error reporting for some numeric functions. This patch applies
the same pattern to the date/timestamp function. The change ensures
consistency by utilizing the existing soft error reporting
infrastructure.

Note that in the patch, I renamed the function by replacing the
"no_overflow" extension in the function name with "overflow_safe".
Alternatively, we could just use "safe" alone. Suggestions are
welcome.

1] https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=4246a977bad6e76c4276a0d52def8a3dced154bb

--
Regards,
Amul Sul
EDB: http://www.enterprisedb.com

Attachment Content-Type Size
0001-Switch-some-date-related-functions-to-use-soft-error.patch application/x-patch 14.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Soumya S Murali 2025-11-26 09:50:48 Re: [PATCH] Expose checkpoint timestamp and duration in pg_stat_checkpointer
Previous Message Corey Huinker 2025-11-26 09:21:46 Re: Extended Statistics set/restore/clear functions.