From: Stephen Frost <sfrost@snowman.net>
To: pgsql-committers@postgresql.org
Subject: pgsql: pg_restore: Don't allow non-positive number of jobs
Date: Wed, 11 Jan 2017 20:47:41 +0000
Message-ID: <E1cRPo5-0006ok-2N@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
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
Branch
------
REL9_2_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/c59a1a89035674c6efacc596d652528cebba37ec
Modified Files
--------------
src/bin/pg_dump/pg_restore.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: sfrost@snowman.net
Subject: Re: pgsql: pg_restore: Don't allow non-positive number of jobs
In-Reply-To: <E1cRPo5-0006ok-2N@gemulon.postgresql.org>
References: <E1cRPo5-0006ok-2N@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox