Re: v12 and pg_restore -f-
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2019-10-06T20:43:13Z
Lists: pgsql-hackers, pgsql-general
[ redirecting to -hackers ] Justin Pryzby <pryzby@telsasoft.com> 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, but 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
Commits
-
Change pg_restore -f- to dump to stdout instead of to ./-
- 5ee8f0fe13b4 10.11 landed
- d38635725cad 9.5.20 landed
- 12a51e2ebea7 9.6.16 landed
- 9fb25fda6d56 9.4.25 landed
- 3574c0ac0509 11.6 landed