From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: pg_restore dumps all data to the terminal
Date: Thu, 26 Apr 2018 22:31:37 -0500
Message-ID: <294a1dab-5b5c-9cfb-330d-5e8c2dc05156@gmail.com> (raw)
In-Reply-To: <CAKFQuwbDvoF1wCqoCWKVZmK=Ec67meFVJg-LvKiW3XxKrtZ9fg@mail.gmail.com>
References: <64dded41-6355-683c-a9f6-9253cbefd4c7@gmail.com>
<CAKFQuwbDvoF1wCqoCWKVZmK=Ec67meFVJg-LvKiW3XxKrtZ9fg@mail.gmail.com>
On 04/26/2018 10:15 PM, David G. Johnston wrote:
> On Thursday, April 26, 2018, Ron <ronljohnsonjr@gmail.com
> <mailto:ronljohnsonjr@gmail.com>> wrote:
>
> Hi,
>
> v9.6.8, restoring from 8.4.17
>
> This command dumps not just the schema to the terminal (technically,
> nohup.out) but the actual data. How do I stop that? There's no
> --quiet, and that's not what I want anyway...
>
> pg_restore -cC --if-exists -e -Fd -j4 ${SOURCE}/${DB}
>
>
> "pg_restore can operate in two modes. If a database name is specified,
> pg_restore connects to that database and restores archive contents
> directly into the database. Otherwise, a script containing the SQL
> commands necessary to rebuild the database is created and written to a
> file or standard output."
>
> You haven't specified a database so you get the second mode.
But the database doesn't exist. If I have to explicitly create the DB
beforehand, what's the purpose of the "--create" option?
But... looking more carefully at the examples, I see that one must attach to
the postgres db when you want pg_restore to create the database. (That
should be made clear in the --create section of the manual.)
Thanks
--
Angular momentum makes the world go 'round.
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-admin@postgresql.org
Cc: ronljohnsonjr@gmail.com
Subject: Re: pg_restore dumps all data to the terminal
In-Reply-To: <294a1dab-5b5c-9cfb-330d-5e8c2dc05156@gmail.com>
* 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