pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@kurilemu.de>
To: Mats Kindahl <mats.kindahl@gmail.com>
Cc: David Rowley <dgrowleyml@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Use stack-allocated StringInfoData
Date: Thu, 6 Nov 2025 11:31:38 +0100
Message-ID: <202511061027.6kun3grytx2d@alvherre.pgsql> (raw)
In-Reply-To: <71b9d87a-aa3f-4d5e-bc40-e9e4e60e1c82@gmail.com>

On 2025-Nov-06, Mats Kindahl wrote:

> On 11/5/25 12:01, David Rowley wrote:

> > It's not your fault, but check_publications_origin_tables() looks like
> > a mess. It seems like excessive use of additional code just to avoid
> > two separate ereport() calls. Might be worth a follow-up patch to
> > clean that up.
> 
> Yeah, I have noted that too, but I wanted to avoid making reviews more
> complicated than necessary. I thought it might be better to do as a separate
> effort.

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.)

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"No necesitamos banderas
 No reconocemos fronteras"                  (Jorge González)





view thread (12+ messages)  latest in thread

Message-ID: <202511061027.6kun3grytx2d@alvherre.pgsql>
Permalink:  ../202511061027.6kun3grytx2d@alvherre.pgsql/
Also on:    postgresql.org/message-id/202511061027.6kun3grytx2d@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@kurilemu.de, mats.kindahl@gmail.com, dgrowleyml@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Use stack-allocated StringInfoData
  In-Reply-To: <202511061027.6kun3grytx2d@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox