On Wed, Nov 26, 2025 at 03:09:25PM +0530, Amul Sul wrote: > 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.
Thanks for continuing this work.
> 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.
Hmm. Following the previous example you have quoted, I am wondering
if we'd tweak the names a bit differently. Rather than the
popo_overflow_safe() pattern from your patch, I would choose a simpler
popo_safe() as naming convention. That would be also more consistent
with the names applied to the refactored routines of 4246a977bad6.
- result = date2timestamp_opt_overflow(val, &overflow);
+ result = date2timestamp_overflow_safe(val, (Node *) &escontext);
/* We can ignore the overflow result, since result is useful as-is */
In these cases, why don't you just pass NULL to the routines for the
error context? (Sorry, I don't have my eyes on the code now, but I
recall that NULL should work as well, meaning the same as "ignore
me".)
--
Michael
signature.asc
Description: PGP signature
