pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: v12 and pg_restore -f-
Date: Sun, 06 Oct 2019 16:43:13 -0400
Message-ID: <28770.1570394593@sss.pgh.pa.us> (raw)
In-Reply-To: <20191006190839.GE18030@telsasoft.com>
References: <20191006190839.GE18030@telsasoft.com>

[ 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





view thread (38+ messages)  latest in thread

Message-ID: <28770.1570394593@sss.pgh.pa.us>
Permalink:  ../28770.1570394593@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28770.1570394593@sss.pgh.pa.us

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pryzby@telsasoft.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: v12 and pg_restore -f-
  In-Reply-To: <28770.1570394593@sss.pgh.pa.us>

* 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