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 1iKmzm-0008MB-BB for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Oct 2019 17:21:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iKmzk-000759-Uk for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Oct 2019 17:21:56 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1iKmzk-00074w-L7 for pgsql-hackers@lists.postgresql.org; Wed, 16 Oct 2019 17:21:56 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iKmzg-0002s9-Aw for pgsql-hackers@lists.postgresql.org; Wed, 16 Oct 2019 17:21:56 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 098815F79F; Wed, 16 Oct 2019 13:21:48 -0400 (EDT) Date: Wed, 16 Oct 2019 13:21:48 -0400 From: Stephen Frost To: "imai.yoshikazu@fujitsu.com" Cc: Euler Taveira , Tom Lane , Andrew Gierth , Justin Pryzby , PostgreSQL Hackers Subject: Re: v12 and pg_restore -f- Message-ID: <20191016172148.GH6962@tamriel.snowman.net> References: <20191006190839.GE18030@telsasoft.com> <28770.1570394593@sss.pgh.pa.us> <875zl11tla.fsf@news-spur.riddles.org.uk> <30069.1570396524@sss.pgh.pa.us> <20191008180840.GQ6962@tamriel.snowman.net> <20191009124505.GT6962@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SqgzdnOl3iuYcFfV" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --SqgzdnOl3iuYcFfV Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * imai.yoshikazu@fujitsu.com (imai.yoshikazu@fujitsu.com) wrote: > On Sun, Oct 6, 2019 at 7:09 PM, Justin Pryzby wrote: > > 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, = but that was deemed to be unfriendly. > >=20 > > What I didn't realize at first is that -f- has no special meaning in v1= 1 - it > > just writes a file called ./- And it's considered untennable to change > > behavior of v11. >=20 > Ahh... I totally missed thinking about the behavior of "-f -" in v11 when= I reviewed this patch. Clearly you weren't the only one. > On Wed, Oct 9, 2019 at 0:45 PM, Stephen Frost wrote: > > * Euler Taveira (euler@timbira.com.br) wrote: > > > Em ter, 8 de out de 2019 =E0s 15:08, Stephen Frost escreveu: > > > > * Tom Lane (tgl@sss.pgh.pa.us) wrote: > > > > > Andrew Gierth writes: > > > > > > "Tom" =3D=3D Tom Lane writes: > > > > > > Tom> Perhaps we could change the back branches so that they > > > > > > interpret Tom> "-f -" as "write to stdout", but without > > > > > > enforcing that you use Tom> that syntax. > > > > > > > > > > > We should definitely do that. > > > > > > > > I agree that this would be a reasonable course of action. Really, > > > > it should have always meant that... > > > > > > > Indeed, it was a broken behavior and the idea was to fix it. However, > > > changing pg_restore in back-branches is worse than do nothing because > > > it could break existent scripts. > >=20 > > I can certainly respect that argument, in general, but in this specific= case, I've got a really hard time believeing > > that people wrote scripts which use '-f -' with the expectation that a = './-' file was to be created. >=20 > +1. >=20 > If we only think of the problem that we can't use "-f -" with the meaning= "dump to the stdout" in v11 and before ones, it seems a bug and we should = fix it. > Of course, if we fix it, some people would go into the trouble, but such = people are who wrote scripts which use '-f -' with the expectation that a '= =2E/-' file. > I don't think there are such people a lot. This topic, unfortunately, seems a bit stuck right now. Maybe there's a way we can pry it loose and get to a resolution. On the one hand, we have Yoshikazu Imai, Andrew, and I pushing to change back-branches, Eurler argueing that we shouldn't do anything, and Tom argueing to make all versions accept '-f -'. First, I'd like to clarify what I believe Tom's suggestion is, and then talk through that, as his vote sways this topic pretty heavily. Tom, I take it your suggestion is to have '-f -' be accepted to mean 'goes to stdout' in all branches? That goes against the argument that we don't want to break existing scripts, as it's possible that there are existing scripts that depend on '-f -' actually going to a './-' file. Is your argument here that, with the above, existing scripts could be updated to use '-f -' explicitly and work with multiple versions, and that scripts which aren't changed would work as-is? If so, then I don't agree with it- if we really don't want to break existing scripts when moving from pre-v12 to v12, then this patch never should have been accepted at all as that's the only way to avoid breaking anything, but then, we shouldn't be making a lot of other changes between major versions either because there's often a good chance that we'll break things. Instead, the patch was accepted, as a good and forward-moving change, with the understanding that it would require some users to update their scripts when they move to v12, so, for my part at least, that question was answered when we committed the change and released with it. Now, if we wish to adjust back-branches to make it easier for users to have scripts that work with both versions, that seems like a worthwhile change and is very unlikely to to cause breakage- and it's certainly more likely to have users actually change their scripts to use '-f -' explicitly when they start working with v12, instead of depending on stdout being the default, which is ultimately the goal and why the change was made in the first place. If the concern is that we can expect folks to install v12 and then refuse or be unable to upgrade back-branches, then I just don't have any sympathy for that either- minor updates are extremely important, and new major versions are certainly no cake walk to get installed, so that argument just doesn't hold water with me- if they can upgrade to v12, then they can update to the latest minor versions, if they actually need to work with both concurrently (which strikes me as already at least relatively uncommon...). If you meant for all branches to accept '-f -' and have it go to a './-' file then that's just a revert of this entire change, which I can't agree with either- really, folks who are depending on that are depending on buggy behavior in the first place. Thanks, Stephen --SqgzdnOl3iuYcFfV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJdp1GsAAoJEO1sijiDR2RVQmgP/jP0MKAmKEvVdfW6EeJ1W9Es eQ/0nPkC1I/ccb7QfPsuAsenixATJJ7J1jwzDnSZHix1Di8Dv8Re0E0K8CyRtrY4 1mfox5DTW+8eE/llErQ9h156Y/SAAyhVgWva475SvYtwg2KKtbnsp0PVJMW8rrn+ 2Jkkwz771ageHRQJY2eSab6hv74ttA+MEev/Gnlt0SheoDzCizVSsG4Sa8kj9uKx iv0EV+BmNiKMHyC+IR8KnsUnc1IdczMfNqiPA+sVx70rgE/hCxcAY/kxB0W4HXn1 eU5clXe4UOMeptr7FCdXvJFiJSeZ+QQVoX3Nu7R1Ld4cJoMACn+lsOIjzi18tWno FHJR5uHHO8SW+NguUJ0P0HLuy+Q49+XPVtPCUYpPecwRL0YEu1pcQhqDE5pDuR7d cxD4rytMHPnNQ1d2npioX9DF7XOOaOaQI4tr8+xYmQGeZwH3rnKCxAlvJqdwm2lr m0Y9OZM+ritNwkslCnuGg+2e4nCzqeJeIWszOrIB5VHVPZYuR30Pw05ZAzmlnMQP TTxluvo+hLtuWa+IkIHCsTcmwgOl/nB9/4MrGf86rILMEGAiFTWeRS94mI0xN7Rs kzwuPwsYRzAZH4JzDhocDMbur6wvjC7yZkeZz7rqyy17zcFQFm0qvGT0oITLHOcW 9TIG4ooavpzfjb2bk1YW =L2v5 -----END PGP SIGNATURE----- --SqgzdnOl3iuYcFfV--