forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8e5793a
committed
Fix connection string handling in src/bin/scripts/ programs.
When told to process all databases, clusterdb, reindexdb, and vacuumdbwould reconnect by replacing their --maintenance-db parameter with thename of the target database. If that parameter is a connstring (whichhas been allowed for a long time, though we failed to document thatbefore this patch), we'd lose any other options it might specify, forexample SSL or GSS parameters, possibly resulting in failure to connect.Thus, this is the same bug as commita45bc8a fixed in pg_dump andpg_restore. We can fix it in the same way, by using libpq's rules forhandling multiple "dbname" parameters to add the target database nameseparately. I chose to apply the same refactoring approach as in thatpatch, with a struct to handle the command line parameters that need tobe passed through to connectDatabase. (Maybe someday we can unify thevery similar functions here and in pg_dump/pg_restore.)Per Peter Eisentraut's comments on bug #16604. Back-patch to allsupported branches.Discussion:https://postgr.es/m/16604-933f4b8791227b15@postgresql.org1 parentc8ab970 commit8e5793a
File tree
16 files changed
+260
-206
lines changed- doc/src/sgml/ref
- src/bin/scripts
16 files changed
+260
-206
lines changedLines changed: 13 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
90 | 90 |
| |
91 | 91 |
| |
92 | 92 |
| |
93 |
| - | |
94 |
| - | |
95 |
| - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
96 | 96 |
| |
97 | 97 |
| |
98 | 98 |
| |
| |||
249 | 249 |
| |
250 | 250 |
| |
251 | 251 |
| |
252 |
| - | |
253 |
| - | |
254 |
| - | |
255 |
| - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
256 | 262 |
| |
257 | 263 |
| |
258 | 264 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
284 | 284 |
| |
285 | 285 |
| |
286 | 286 |
| |
| 287 | + | |
| 288 | + | |
| 289 | + | |
287 | 290 |
| |
288 | 291 |
| |
289 | 292 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
217 | 217 |
| |
218 | 218 |
| |
219 | 219 |
| |
| 220 | + | |
| 221 | + | |
| 222 | + | |
220 | 223 |
| |
221 | 224 |
| |
222 | 225 |
| |
|
Lines changed: 13 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
134 | 134 |
| |
135 | 135 |
| |
136 | 136 |
| |
137 |
| - | |
138 |
| - | |
139 |
| - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
140 | 140 |
| |
141 | 141 |
| |
142 | 142 |
| |
| |||
351 | 351 |
| |
352 | 352 |
| |
353 | 353 |
| |
354 |
| - | |
355 |
| - | |
356 |
| - | |
357 |
| - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
358 | 364 |
| |
359 | 365 |
| |
360 | 366 |
| |
|
Lines changed: 13 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
92 | 92 |
| |
93 | 93 |
| |
94 | 94 |
| |
95 |
| - | |
96 |
| - | |
97 |
| - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
| |||
474 | 474 |
| |
475 | 475 |
| |
476 | 476 |
| |
477 |
| - | |
478 |
| - | |
479 |
| - | |
480 |
| - | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
481 | 487 |
| |
482 | 488 |
| |
483 | 489 |
| |
|
Lines changed: 29 additions & 38 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
20 |
| - | |
21 |
| - | |
22 |
| - | |
23 |
| - | |
24 |
| - | |
25 |
| - | |
26 |
| - | |
27 |
| - | |
28 |
| - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
29 | 24 |
| |
30 | 25 |
| |
31 | 26 |
| |
| |||
58 | 53 |
| |
59 | 54 |
| |
60 | 55 |
| |
| 56 | + | |
61 | 57 |
| |
62 | 58 |
| |
63 | 59 |
| |
| |||
134 | 130 |
| |
135 | 131 |
| |
136 | 132 |
| |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
137 | 140 |
| |
138 | 141 |
| |
139 | 142 |
| |
| |||
150 | 153 |
| |
151 | 154 |
| |
152 | 155 |
| |
153 |
| - | |
154 |
| - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
155 | 159 |
| |
156 | 160 |
| |
157 | 161 |
| |
| |||
165 | 169 |
| |
166 | 170 |
| |
167 | 171 |
| |
| 172 | + | |
| 173 | + | |
168 | 174 |
| |
169 | 175 |
| |
170 | 176 |
| |
171 | 177 |
| |
172 | 178 |
| |
173 | 179 |
| |
174 |
| - | |
175 |
| - | |
176 |
| - | |
| 180 | + | |
| 181 | + | |
177 | 182 |
| |
178 | 183 |
| |
179 | 184 |
| |
180 |
| - | |
181 |
| - | |
182 |
| - | |
| 185 | + | |
| 186 | + | |
183 | 187 |
| |
184 | 188 |
| |
185 | 189 |
| |
186 | 190 |
| |
187 | 191 |
| |
188 | 192 |
| |
189 | 193 |
| |
190 |
| - | |
191 |
| - | |
192 |
| - | |
193 |
| - | |
| 194 | + | |
| 195 | + | |
194 | 196 |
| |
195 | 197 |
| |
196 | 198 |
| |
197 | 199 |
| |
198 | 200 |
| |
199 |
| - | |
200 |
| - | |
| 201 | + | |
201 | 202 |
| |
202 | 203 |
| |
203 | 204 |
| |
| |||
228 | 229 |
| |
229 | 230 |
| |
230 | 231 |
| |
231 |
| - | |
232 |
| - | |
233 |
| - | |
234 |
| - | |
| 232 | + | |
| 233 | + | |
235 | 234 |
| |
236 | 235 |
| |
237 | 236 |
| |
238 |
| - | |
239 | 237 |
| |
240 | 238 |
| |
241 |
| - | |
242 |
| - | |
| 239 | + | |
243 | 240 |
| |
244 | 241 |
| |
245 | 242 |
| |
246 |
| - | |
247 | 243 |
| |
248 | 244 |
| |
249 | 245 |
| |
| |||
254 | 250 |
| |
255 | 251 |
| |
256 | 252 |
| |
257 |
| - | |
258 |
| - | |
259 |
| - | |
| 253 | + | |
260 | 254 |
| |
261 |
| - | |
262 |
| - | |
263 |
| - | |
| 255 | + | |
264 | 256 |
| |
265 |
| - | |
266 | 257 |
| |
267 | 258 |
| |
268 | 259 |
| |
|
0 commit comments
Comments
(0)