Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iHDNC-0001eo-5s for pgsql-hackers@arkaria.postgresql.org; Sun, 06 Oct 2019 20:43:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iHDNA-0004Pt-SQ for pgsql-hackers@arkaria.postgresql.org; Sun, 06 Oct 2019 20:43:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iHDNA-0004Of-G4 for pgsql-hackers@lists.postgresql.org; Sun, 06 Oct 2019 20:43:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iHDN7-0004hA-0o for pgsql-hackers@lists.postgresql.org; Sun, 06 Oct 2019 20:43:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x96KhDE1028771; Sun, 6 Oct 2019 16:43:13 -0400 From: Tom Lane To: Justin Pryzby cc: pgsql-hackers@lists.postgresql.org Subject: Re: v12 and pg_restore -f- In-reply-to: <20191006190839.GE18030@telsasoft.com> References: <20191006190839.GE18030@telsasoft.com> Comments: In-reply-to Justin Pryzby message dated "Sun, 06 Oct 2019 14:08:39 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28769.1570394593.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 06 Oct 2019 16:43:13 -0400 Message-ID: <28770.1570394593@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk [ redirecting to -hackers ] Justin Pryzby writes: > I saw this and updated our scripts with pg_restore -f- > https://www.postgresql.org/docs/12/release-12.html > |In pg_restore, require specification of -f - to send the dump contents = to standard output (Euler Taveira) > |Previously, this happened by default if no destination was specified, b= ut that was deemed to be unfriendly. > What I didn't realize at first is that -f- has no special meaning in v11= - it > just writes a file called ./- Ugh. I didn't realize that either, or I would have made a stink about this patch. Reducing the risk of getting a dump spewed at you is completely not worth the cost of making it impossible to have cross-version-compatible scripting of pg_restore. Perhaps we could change the back branches so that they interpret "-f -" as "write to stdout", but without enforcing that you use that syntax. Nobody is going to wish that to mean "write to a file named '-'", so I don't think this would be an unacceptable change. Alternatively, we could revert the v12 behavior change. On the whole that might be the wiser course. I do not think the costs and benefits of this change were all that carefully thought through. regards, tom lane