Re: Use stack-allocated StringInfoData - Mailing list pgsql-hackers

From David Rowley
Subject Re: Use stack-allocated StringInfoData
Date
Msg-id CAApHDvoMsPQS8jsPE2-nOGdp2ABOPWx-WwoRdjN6G4G8nwfqdg@mail.gmail.com
Whole thread Raw
In response to Re: Use stack-allocated StringInfoData  (Álvaro Herrera <alvherre@kurilemu.de>)
List pgsql-hackers
On Fri, 7 Nov 2025 at 00:24, Álvaro Herrera <alvherre@kurilemu.de> 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



pgsql-hackers by date:

Previous
From: Arseniy Mukhin
Date:
Subject: Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue
Next
From: Heikki Linnakangas
Date:
Subject: Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue