Re: pg_restore a dump in -Fd format? - Mailing list pgsql-admin

From David G. Johnston
Subject Re: pg_restore a dump in -Fd format?
Date
Msg-id CAKFQuwYvnfmHR0DoD9whYA=-XhALE9=88HvX--RHC6OxADtiRQ@mail.gmail.com
Whole thread Raw
In response to Re: pg_restore a dump in -Fd format?  (Ron <ronljohnsonjr@gmail.com>)
List pgsql-admin
On Thu, May 3, 2018 at 9:36 AM, Ron <ronljohnsonjr@gmail.com> wrote:
Since "pg_dump -Fd" needs a "--file" option to say where to put the dump directory, it seemed reasonable that "pg_restore -Fd" would need a --file to know where the dump directory is.

​It is a reasonable assumption - but when it failed the definition for --file in the pg_restore docs explains that is doesn't work that way.

Its too late to change it now even if its not particularly intuitive.  And the complaint is not directory specific either - though for pg_dump you don't have the option of redirecting stdout like you do with a file output.

I could see a patch for pg_dump --file option (and maybe pg_restore) covering this non-symmetry being accepted, should one be put forth, but it doesn't come up particularly often and it errors out quickly.

On the code front I could see pg_restore being a bit more helpful if it sees "--file", and stdin is empty, that the resultant error hints to the user that maybe they mis-used the --file option.

David J.

pgsql-admin by date:

Previous
From: Don Seiler
Date:
Subject: Re: pg_restore a dump in -Fd format?
Next
From: Ron
Date:
Subject: Re: pg_restore a dump in -Fd format?