postgresql/src
Michael Paquier a33e17f210 Rework internal command generation of pg_rewind
pg_rewind generates and executes internally up to two commands to work
on the target cluster, depending on the options given by its caller:
- postgres -C to retrieve the value of restore_command, when using
-c/--restore-target-wal.
- postgres --single to enforce recovery once and get the target cluster
in a clean shutdown state.

Both commands have been applying incorrect quoting rules, which could
lead to failures when for example using a target data directory with
unexpected characters like CRLFs.  Those commands are now generated with
PQExpBuffer, making use of string_utils.h to quote those commands as
they should.  We may extend those commands in the future with more
options, so this makes any upcoming additions easier.

This is arguably a bug fix, but nobody has complained about the existing
code being a problem either, so no backpatch is done.

Extracted from a larger patch by the same author.

Author: Gunnar "Nick" Bluth
Discussion: https://postgr.es/m/7c59265d-ac50-b0aa-ca1e-65e8bd27642a@pro-open.de
2022-03-01 12:52:25 +09:00
..
backend Reconsider pg_stat_subscription_workers view. 2022-03-01 06:17:52 +05:30
bin Rework internal command generation of pg_rewind 2022-03-01 12:52:25 +09:00
common Use bitwise rotate functions in more places 2022-02-20 13:22:08 +07:00
fe_utils Reject trailing junk after numeric literals 2022-02-16 10:37:31 +01:00
include Reconsider pg_stat_subscription_workers view. 2022-03-01 06:17:52 +05:30
interfaces Allow root-owned SSL private keys in libpq, not only the backend. 2022-02-28 14:12:52 -05:00
makefiles Add NO_INSTALL option to pgxs 2021-05-27 13:58:29 +02:00
pl Fix SPI's handling of errors during transaction commit. 2022-02-28 12:45:36 -05:00
port Simplify coding around path_contains_parent_reference(). 2022-01-31 13:53:38 -05:00
template Further tweaking of PG_SYSROOT heuristics for macOS. 2021-01-20 12:07:23 -05:00
test Reconsider pg_stat_subscription_workers view. 2022-03-01 06:17:52 +05:30
timezone Update copyright for 2022 2022-01-07 19:04:57 -05:00
tools Reconsider pg_stat_subscription_workers view. 2022-03-01 06:17:52 +05:30
tutorial Update copyright for 2022 2022-01-07 19:04:57 -05:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Run tap tests in src/interfaces/libpq. 2022-02-26 16:51:47 -08:00
Makefile.shlib AIX: Fix missing libpq symbols by respecting SHLIB_EXPORTS. 2021-09-06 11:27:59 -07:00
nls-global.mk Add errhint_plural() function and make use of it 2021-03-31 09:16:25 +02:00