Re: pg_stop_backup() v2 incorrectly marked as proretset - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: pg_stop_backup() v2 incorrectly marked as proretset
Date
Msg-id YiFmv6TDsw9ZXe7b@paquier.xyz
Whole thread Raw
In response to Re: pg_stop_backup() v2 incorrectly marked as proretset  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_stop_backup() v2 incorrectly marked as proretset
List pgsql-hackers
On Thu, Mar 03, 2022 at 04:40:42PM -0500, Tom Lane wrote:
> The point is to make it clear that the macro isn't intended to affect
> code outside the function.  Since C lacks block-scoped macros,
> there's no other way to do that.
>
> I concede that a lot of our code is pretty sloppy about this, but
> that doesn't make it a good practice.

Well, if we change that, better to do that in all the places where
this would be affected, but I am not sure to see a style appealing
enough on this thread.

From what I can see, history shows that the style of using a #define
for the number of columns originates from da2c1b8, aka 9.0.  Its use
inside a function originates from a755ea3 as of 9.1 and then it has
just spread around without any undefs, so it looks like people like
that way of doing things.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: Make mesage at end-of-recovery less scary.
Next
From: Masahiko Sawada
Date:
Subject: Re: Add the replication origin name and commit-LSN to logical replication worker errcontext