Re: Common function for percent placeholder replacement

Peter Eisentraut <peter.eisentraut@enterprisedb.com>

From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Justin Pryzby <pryzby@telsasoft.com>, pgsql-hackers@postgresql.org
Date: 2022-12-20T05:30:40Z
Lists: pgsql-hackers

Attachments

On 19.12.22 10:51, Alvaro Herrera wrote:
> I think the new one is not great.  I wish we could do something more
> straightforward, maybe like
> 
>    replace_percent_placeholders(base_command,
>                                 PERCENT_OPT("f", filename),
>                                 PERCENT_OPT("d", target_detail));
> 
> Is there a performance disadvantage to a variadic implementation?
> Alternatively, have all these macro calls form an array.

How about this new one with variable arguments?

(Still need to think about Robert's comment about lack of error context.)

Commits

  1. Code cleanup

  2. Common function for percent placeholder replacement