RE: v12 and pg_restore -f-

From: "imai(dot)yoshikazu(at)fujitsu(dot)com" <imai(dot)yoshikazu(at)fujitsu(dot)com>
To: 'Stephen Frost' <sfrost(at)snowman(dot)net>, Euler Taveira <euler(at)timbira(dot)com(dot)br>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: v12 and pg_restore -f-
Date: 2019-10-16 06:25:33
Message-ID: OSBPR01MB4616298336E32F8EAEDA0FF394920@OSBPR01MB4616.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Hi,

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.
>
> What I didn't realize at first is that -f- has no special meaning in v11 - it
> just writes a file called ./- And it's considered untennable to change
behavior of v11.

Ahh... I totally missed thinking about the behavior of "-f -" in v11 when I reviewed this patch.

On Wed, Oct 9, 2019 at 0:45 PM, Stephen Frost wrote:
> * Euler Taveira (euler(at)timbira(dot)com(dot)br) wrote:
> > Em ter, 8 de out de 2019 às 15:08, Stephen Frost <sfrost(at)snowman(dot)net> escreveu:
> > > * Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> > > > Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> writes:
> > > > > "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> 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.
>
> 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.

+1.

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 './-' file.
I don't think there are such people a lot.

--
Yoshikazu Imai

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Luca Ferrari 2019-10-16 06:26:41 Re: Securing records using linux grou permissions
Previous Message raylu 2019-10-16 03:34:53 Re: Text search lexer's handling of hyphens and negatives

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2019-10-16 06:48:41 Re: maintenance_work_mem used by Vacuum
Previous Message Michael Paquier 2019-10-16 06:11:32 Re: Non-Active links being referred in our source code