Re: pg_restore dumps all data to the terminal - Mailing list pgsql-admin

From David G. Johnston
Subject Re: pg_restore dumps all data to the terminal
Date
Msg-id CAKFQuwap6TC_79diygXy1qOZP+=7XC4Mk_w8p=P7CORa6R=pGg@mail.gmail.com
Whole thread Raw
In response to Re: pg_restore dumps all data to the terminal  (Ron <ronljohnsonjr@gmail.com>)
List pgsql-admin
On Thursday, April 26, 2018, Ron <ronljohnsonjr@gmail.com> wrote:

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.)

" --create
 When this option is used, the database named with -d is used only to issue the initial DROP DATABASE and CREATE DATABASE commands. All data is restored into the database name that appears in the archive. "

You have to connect to a database in order to perform work in the cluster as a whole - which includes creating new databases.  The postgres database, being created by default, usually suffices but isn't mandatory.

For me the manual is clear but you can propose wording or even submit a patch if you feel it can be improved.

David J.

pgsql-admin by date:

Previous
From: Ron
Date:
Subject: Re: pg_restore dumps all data to the terminal
Next
From: Laurenz Albe
Date:
Subject: Re: vacuumdb causes memory drain.