forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite72059f
committed
pg_restore: Don't allow non-positive number of jobs
pg_restore will currently accept invalid values for the number ofparallel jobs to run (eg: -1), unlike pg_dump which does check that thevalue provided is reasonable.Worse, '-1' is actually a valid, independent, parameter (as an alias for--single-transaction), leading to potentially completely unexpectedresults from a command line such as: -> pg_restore -j -1Where a user would get neither parallel jobs nor a single-transaction.Add in validity checking of the parallel jobs option, as we already havein pg_dump, before we try to open up the archive. Also move the checkthat we haven't been asked to run more parallel jobs than possible onWindows to the same place, so we do all the option validity checkingbefore opening the archive.Back-patch all the way, though for 9.2 we're adding the Windows-specificcheck against MAXIMUM_WAIT_OBJECTS as that check wasn't back-patchedoriginally.Discussion:https://www.postgresql.org/message-id/20170110044815.GC18360%40tamriel.snowman.net1 parent268f9e3 commite72059f
1 file changed
+16
-10
lines changedLines changed: 16 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
330 | 330 |
| |
331 | 331 |
| |
332 | 332 |
| |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
333 | 349 |
| |
334 | 350 |
| |
335 | 351 |
| |
| |||
402 | 418 |
| |
403 | 419 |
| |
404 | 420 |
| |
405 |
| - | |
406 |
| - | |
407 |
| - | |
408 |
| - | |
409 |
| - | |
410 |
| - | |
411 |
| - | |
412 |
| - | |
413 |
| - | |
414 |
| - | |
415 | 421 |
| |
416 | 422 |
| |
417 | 423 |
| |
|
0 commit comments
Comments
(0)