Re: PATCH: add "--config-file=" option to pg_rewind - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: PATCH: add "--config-file=" option to pg_rewind
Date
Msg-id YhtpY8pLEu/VPlrO@paquier.xyz
Whole thread Raw
In response to Re: PATCH: add "--config-file=" option to pg_rewind  ("Gunnar \"Nick\" Bluth" <gunnar.bluth@pro-open.de>)
Responses Re: PATCH: add "--config-file=" option to pg_rewind  ("Gunnar \"Nick\" Bluth" <gunnar.bluth@pro-open.de>)
List pgsql-hackers
On Sat, Feb 26, 2022 at 09:55:20AM +0100, Gunnar "Nick" Bluth wrote:
> Am 26.02.22 um 06:51 schrieb Michael Paquier:
>> Shouldn't this one use appendShellString() on config_file?
>
> It probably should, yes. I don't fancy this repetitive code myself.
> But then, pg_rewind as a whole could use an overhaul. I don't see any use of
> PQExpBuffer in it, but a lot of char* ...

Having a lot of char* does not necessarily mean that all of them have
to be changed to accomodate with PQExpBuffer.  My guess that this is a
case-by-case, where we should apply that in places where it makes the
code cleaner to follow.  In the case of your patch though, the two
areas changed would make the logic correct, instead, because we have
to apply correct quoting rules to any commands executed.

> GSOC project? ;-)

It does not seem so, though there are surely more areas that could
gain in clarity.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: pg_stat_statements: remove redundant function call in pg_stat_statements_internal
Next
From: Michael Paquier
Date:
Subject: Re: pg_stat_statements: remove redundant function call in pg_stat_statements_internal