Re: Refactoring: Use soft error reporting for *_opt_overflow functions of date/timestamp - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Refactoring: Use soft error reporting for *_opt_overflow functions of date/timestamp
Date
Msg-id aSepGeepU8sey1nM@paquier.xyz
Whole thread Raw
In response to Re: Refactoring: Use soft error reporting for *_opt_overflow functions of date/timestamp  (Amit Langote <amitlangote09@gmail.com>)
Responses Re: Refactoring: Use soft error reporting for *_opt_overflow functions of date/timestamp
List pgsql-hackers
On Thu, Nov 27, 2025 at 10:18:38AM +0900, Amit Langote wrote:
> I’m fine with updating all core callers to use the new *_safe(... Node
> *escontext) APIs all in one patch. However, we could consider keeping
> the existing *_opt_overflow() functions as thin wrappers over the new
> ones, to avoid breaking third-party extensions immediately for what is
> primarily a refactoring change.

Like 4246a977bad6, one point is to be able to make the internals of
these functions leaner, by relying on the fact that the econtext node
includes an error to let the callers of the functions decide what to
do.  If we keep some function wrappers as the ones we have now, this
partially defeats the purpose of the change, which is to simplify
in-core code at the end.  This move also encourages users to switch to
the new facility to be fed error reports generated by the in-core
routines, meaning less duplication with error strings outside of the
core code, hence less maintenance for out-of-core code.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Refactoring: Use soft error reporting for *_opt_overflow functions of date/timestamp
Next
From: Mihail Nikalayeu
Date:
Subject: Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY