Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRPrl-0007et-Oy for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Jan 2017 20:51:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cRPrl-000451-4b for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Jan 2017 20:51:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cRPqM-0002Sd-6N for pgsql-hackers@postgresql.org; Wed, 11 Jan 2017 20:50:02 +0000 Received: from tamriel.snowman.net ([72.66.115.51]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRPqD-0007ny-TP for pgsql-hackers@postgresql.org; Wed, 11 Jan 2017 20:50:01 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 3047B5F794; Wed, 11 Jan 2017 15:48:53 -0500 (EST) Date: Wed, 11 Jan 2017 15:48:53 -0500 From: Stephen Frost To: Ashutosh Bapat Cc: pgsql-hackers Subject: Re: pg_restore accepts -j -1 Message-ID: <20170111204853.GR18360@tamriel.snowman.net> References: <20170110044815.GC18360@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="/GLpYSe53BI9iu8K" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-91-generic (x86_64) X-Uptime: 15:48:32 up 186 days, 22:12, 37 users, load average: 0.31, 0.16, 0.11 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -5.1 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --/GLpYSe53BI9iu8K Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Ashutosh, * Ashutosh Bapat (ashutosh.bapat@enterprisedb.com) wrote: > On Tue, Jan 10, 2017 at 10:18 AM, Stephen Frost wrot= e: > > For reasons which seem likely to be entirely unintentional, pg_restore > > will accept a '-1' for -j: > > > > pg_restore -j -1 > > > > This seems to result in the parallel state being NULL and so things > > don't outright break, but it hardly seems likely to be what the user was > > asking for- my guess is that they actually wanted "parallel, single > > transaction", which we don't actually support: > > > > -> pg_restore -j 2 -1 > > pg_restore: cannot specify both --single-transaction and multiple jobs > > > > We also don't accept -1 for pg_dump: > > > > -> pg_dump -j -1 > > pg_dump: invalid number of parallel jobs > > > > If I'm missing something, please let me know, otherwise I'll plan to put > > the same check into pg_restore which exists in pg_dump. >=20 > Both the code blocks were added by 9e257a18, but I don't see any > description of why they are different in pg_dump.c and pg_restore.c. > In fact per comments in pg_restore.c, that condition should be same as > pg_dump.c. I am not sure whether it's just for windows specific > condition or the whole block. But I don't see any reason not to > replicate the same conditions in pg_restore.c Ok, I've pushed the change. Thanks! Stephen --/GLpYSe53BI9iu8K Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJYdpo0AAoJEO1sijiDR2RVeJkQAIkSWO7+MpfRpi1ftWSqhPIG 1OzoHGBMziGZQ4GyVi6VAYSgIulxn8ZDBxEWoeugGjryDyXn7hZVXxr2V9LgwPlr kYnanxqz2y+DsDkajMDfhza/YQ6edhXuQpeyt0TjhY6odcr5VMrTBzSv/d8t7MhK 5I+p/YFx0aKoYTPY/z40qEdAnmINRfl6/3O5WNw08PhBkjQGc8CAc1s5VpyEtAer IWI69wgu2y8EzKxRno+yh04HecYNvu1NwGd9KM/AY0rAi5armr1brwRIsEP6FW1H L8TEA+cdWqUraXCC5F7kjMLIpLpynV1IBB6s3LgU6FDDlLHjBIvYPCEumE7Mq4mT H519pUFFIoe+6vxGY6KSzMhnXPay7X8P512pM/sa1xOCAXvtqvQaY1dL0Cu1DWMk Y9/kn+stb2oNIsh9fSxA95LZYqFGwh7Y/sHsS+MCVOPywCMKOzJhJzPl+Bsjj5Dk 1yvs26WJ/HrAiDywDrS15Z2NDxA4M5XHLdwYx6AVOaxaQ0/jNosKdUAhuvXJg4y7 VG2xRrYYNgUTj5N8JBT6sIBqiqks6szg6y5MG1NIjD/KF7bNEVI2ozEb5/Wy3ZD/ eNEayFkCxKQtdBFdBdybKN5jTE6/pJsEUlq86guJibUQipx269itiHPur8TDE2F6 TduxV39F6uA7dxPuRSOL =09iz -----END PGP SIGNATURE----- --/GLpYSe53BI9iu8K--