Re: pg_restore dumps all data to the terminal

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg_restore dumps all data to the terminal
Date: 2018-04-27 03:50:07
Message-ID: CAKFQuwap6TC_79diygXy1qOZP+=7XC4Mk_w8p=P7CORa6R=pGg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thursday, April 26, 2018, Ron <ronljohnsonjr(at)gmail(dot)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.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Laurenz Albe 2018-04-27 06:06:31 Re: vacuumdb causes memory drain.
Previous Message Ron 2018-04-27 03:31:37 Re: pg_restore dumps all data to the terminal