postgresql/src
Stephen Frost c59a1a8903 pg_restore: Don't allow non-positive number of jobs
pg_restore will currently accept invalid values for the number of
parallel jobs to run (eg: -1), unlike pg_dump which does check that the
value provided is reasonable.

Worse, '-1' is actually a valid, independent, parameter (as an alias for
--single-transaction), leading to potentially completely unexpected
results from a command line such as:

  -> pg_restore -j -1

Where a user would get neither parallel jobs nor a single-transaction.

Add in validity checking of the parallel jobs option, as we already have
in pg_dump, before we try to open up the archive.  Also move the check
that we haven't been asked to run more parallel jobs than possible on
Windows to the same place, so we do all the option validity checking
before opening the archive.

Back-patch all the way, though for 9.2 we're adding the Windows-specific
check against MAXIMUM_WAIT_OBJECTS as that check wasn't back-patched
originally.

Discussion: https://www.postgresql.org/message-id/20170110044815.GC18360%40tamriel.snowman.net
2017-01-11 15:46:16 -05:00
..
backend Fix handling of empty arrays in array_fill(). 2017-01-05 11:33:51 -05:00
bin pg_restore: Don't allow non-positive number of jobs 2017-01-11 15:46:16 -05:00
include Stamp 9.2.19. 2016-10-24 16:17:41 -04:00
interfaces Fix buffer overflow on particularly named files and clarify documentation about 2016-12-22 08:34:07 +01:00
makefiles Don't use deprecated dllwrap on Cygwin. 2014-02-01 16:13:46 -05:00
pl Be more careful about Python refcounts while creating exception objects. 2016-12-09 15:27:23 -05:00
port Make pgwin32_putenv() visit debug CRTs. 2016-12-03 15:47:52 -05:00
template AIX: Test the -qlonglong option before use. 2015-07-17 03:02:18 -04:00
test Fix handling of empty arrays in array_fill(). 2017-01-05 11:33:51 -05:00
timezone Sync our copy of the timezone library with IANA release tzcode2016j. 2016-12-15 14:33:19 -05:00
tools Remove vestigial references to "zic" in favor of "IANA database". 2016-09-04 19:42:47 -04:00
tutorial Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in Make numeric form of PG version number readily available in Makefiles. 2015-07-05 12:01:01 -04:00
Makefile.shlib Make the AIX case of Makefile.shlib safe for parallel make. 2016-07-23 20:30:55 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00