forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita33e17f
committed
Rework internal command generation of pg_rewind
pg_rewind generates and executes internally up to two commands to workon 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 clusterin a clean shutdown state.Both commands have been applying incorrect quoting rules, which couldlead to failures when for example using a target data directory withunexpected characters like CRLFs. Those commands are now generated withPQExpBuffer, making use of string_utils.h to quote those commands asthey should. We may extend those commands in the future with moreoptions, so this makes any upcoming additions easier.This is arguably a bug fix, but nobody has complained about the existingcode being a problem either, so no backpatch is done.Extracted from a larger patch by the same author.Author: Gunnar "Nick" BluthDiscussion:https://postgr.es/m/7c59265d-ac50-b0aa-ca1e-65e8bd27642a@pro-open.de1 parent7a85073 commita33e17f
1 file changed
+33
-10
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
| 26 | + | |
26 | 27 |
| |
27 | 28 |
| |
28 | 29 |
| |
| |||
1016 | 1017 |
| |
1017 | 1018 |
| |
1018 | 1019 |
| |
1019 |
| - | |
1020 | 1020 |
| |
| 1021 | + | |
1021 | 1022 |
| |
1022 | 1023 |
| |
1023 | 1024 |
| |
| |||
1051 | 1052 |
| |
1052 | 1053 |
| |
1053 | 1054 |
| |
1054 |
| - | |
1055 |
| - | |
1056 |
| - | |
| 1055 | + | |
1057 | 1056 |
| |
1058 |
| - | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
1059 | 1068 |
| |
1060 | 1069 |
| |
1061 | 1070 |
| |
| |||
1067 | 1076 |
| |
1068 | 1077 |
| |
1069 | 1078 |
| |
| 1079 | + | |
| 1080 | + | |
1070 | 1081 |
| |
1071 | 1082 |
| |
1072 | 1083 |
| |
| |||
1080 | 1091 |
| |
1081 | 1092 |
| |
1082 | 1093 |
| |
1083 |
| - | |
| 1094 | + | |
1084 | 1095 |
| |
1085 | 1096 |
| |
1086 | 1097 |
| |
| |||
1119 | 1130 |
| |
1120 | 1131 |
| |
1121 | 1132 |
| |
1122 |
| - | |
1123 |
| - | |
| 1133 | + | |
1124 | 1134 |
| |
1125 |
| - | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
1126 | 1147 |
| |
1127 | 1148 |
| |
1128 |
| - | |
| 1149 | + | |
1129 | 1150 |
| |
| 1151 | + | |
| 1152 | + | |
1130 | 1153 |
| |
1131 | 1154 |
| |
1132 | 1155 |
| |
|
0 commit comments
Comments
(0)