On Fri, 7 Nov 2025 at 00:24, Álvaro Herrera <[email protected]> wrote:
> Yeah, I came across this a few weeks ago as well.  I was thinking maybe
> we can expand the ereport() macro instead of duplicating things.  It
> looks a bit ugly and I don't think we do it anywhere else ...  I mean
> something like
>
> errstart(WARNING, NULL);
> if (cond)
>         errmsg( ... );
> else
>         errmsg( ... );
> // and so on
> errfinish(__FILE__, __LINE__, __func__);
>
>
> Is this too ugly to live?  (I swear I had this on a branch already, but
> can't find it right this instant.)

I thought it could just become 2 separate ereport calls. The duplicate
string consts for the plural stuff are going to get de-duplicated
anyway. I didn't try it to see how it'd look, however.

David


Reply via email to