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

From Chapman Flack
Subject Re: pg_stop_backup() v2 incorrectly marked as proretset
Date
Msg-id 62213A77.3040508@anastigmatix.net
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 03/03/22 16:40, 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.

Would the

  Datum values[3];
  bool   nulls[ lengthof(values) ];

pattern be more notationally tidy? No macro to define or undefine,
we already define lengthof() in c.h, and it seems pretty much made
for the purpose, if the objective is to have just one 3 to change
if it someday becomes not-3.

Regards,
-Chap



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: casting operand to proper type in BlockIdGetBlockNumber
Next
From: Tom Lane
Date:
Subject: Re: pg_stop_backup() v2 incorrectly marked as proretset