Re: Use stack-allocated StringInfoData

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: Mats Kindahl <mats(dot)kindahl(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Use stack-allocated StringInfoData
Date: 2025-11-06 11:28:54
Message-ID: CAApHDvoMsPQS8jsPE2-nOGdp2ABOPWx-WwoRdjN6G4G8nwfqdg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 7 Nov 2025 at 00:24, Álvaro Herrera <alvherre(at)kurilemu(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2025-11-06 11:35:28 Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue
Previous Message Arseniy Mukhin 2025-11-06 11:20:37 Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue