Re: Postgres12 - Confusion with pg_restore

From: Laura Smith <n5d9xq3ti233xiyif2vp(at)protonmail(dot)ch>
To: Christophe Pettus <xof(at)thebuild(dot)com>
Cc: postgre <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Postgres12 - Confusion with pg_restore
Date: 2020-06-05 18:27:11
Message-ID: hFqAaHJzjLuVOICQpkqZg85tNRMME-i2UsGK-5SVst7NNstNPco9oRFhxztD2xnc8M0AVWh111b4F0P5zDgzazENq-L5Br_LSJkM7Uc2lCQ=@protonmail.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, 5 June 2020 19:23, Christophe Pettus <xof(at)thebuild(dot)com> wrote:

> > On Jun 5, 2020, at 11:20, Laura Smith n5d9xq3ti233xiyif2vp(at)protonmail(dot)ch wrote:
> > sudo -u postgres pg_restore -v -C -d foobar 4_foobar_pgdump_Fc
>
> You need to connect to a database that already exists (such as "postgres"); it then creates the database you are restoring and switches to it. The relevant manual line is:
>
> "When (-C / --create) 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."
>
>

But doesn't the second half of my original post demonstrate that I tried that very thing ? I did try creating the database first, but pg_restore just complained even more ?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2020-06-05 18:35:26 Re: Postgres12 - Confusion with pg_restore
Previous Message Christophe Pettus 2020-06-05 18:23:39 Re: Postgres12 - Confusion with pg_restore