Re: Refactoring: Use soft error reporting for *_opt_error functions - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: Refactoring: Use soft error reporting for *_opt_error functions
Date
Msg-id CAEZATCVeHvmd-bWZmrhPUUDXbmwrNP3FB=fXwtDkXQjQthvxew@mail.gmail.com
Whole thread Raw
In response to Re: Refactoring: Use soft error reporting for *_opt_error functions  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Refactoring: Use soft error reporting for *_opt_error functions
List pgsql-hackers
On Thu, 4 Sept 2025 at 01:18, Michael Paquier <michael@paquier.xyz> wrote:
>
> I'd be pretty much OK with this version of the patch, plus a few
> tweaks.

Agreed.

In numeric_div_safe():

+div_error:
+    ereturn(escontext, NULL,
+            errcode(ERRCODE_DIVISION_BY_ZERO),
+            errmsg("division by zero"));

I would make that label something more specific like "division_by_zero".

> Dean, you have commented on this patch before me and the numeric code
> is something you have touched more than me lately (the LSN part is
> tainted with my fingerprints, but it's minimal here).  Would you
> prefer handle this patch yourself?  I'm OK to perform a final lookup
> of it for commit, just won't get in your way if you have been looking
> at it seriously.

I don't mind. I haven't looked at it too closely, but I'm broadly
happy with it. I think any issues are probably now minor cosmetic
things, so if you've been looking in more detail and are happy to
commit it, then go ahead. Otherwise, I can take it if you prefer.

Regards,
Dean



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Cannot find a working 64-bit integer type on Illumos
Next
From: Andrei Lepikhov
Date:
Subject: Re: MergeAppend could consider sorting cheapest child path