Re: Postgres12 - Confusion with pg_restore

From: Laura Smith <n5d9xq3ti233xiyif2vp(at)protonmail(dot)ch>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Christophe Pettus <xof(at)thebuild(dot)com>, postgre <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Postgres12 - Confusion with pg_restore
Date: 2020-06-06 08:58:42
Message-ID: egzaXsylaym1oO3-sXNZ3BRbUMWopcTQRN7MFkX6JYMZYPCchBgiFbmNufntm0QBKIaRxGlG56-Da5kU1u4-d9fjC8hdnXY22KVRLemH7m4=@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:35, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Laura Smith n5d9xq3ti233xiyif2vp(at)protonmail(dot)ch writes:
>
> > 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 ?
>
> There are two ways you can do this:
>
> 1. Create the new database by hand (with CREATE DATABASE) and tell
> pg_restore to restore into it. In this case you don't say -C
> to pg_restore, and your -d switch points at the DB to restore into.
>
> 2. Have pg_restore issue CREATE DATABASE. In this case you do use
> the -C switch, and your -d switch has to point at some pre-existing
> database that pg_restore can connect to for long enough to issue the
> CREATE DATABASE.
>
> You can't mix-and-match these approaches.
>
> regards, tom lane
>

Thanks for the clarificaiton Tom. All working now !

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michel Pelletier 2020-06-06 16:13:25 Re: When to use PARTITION BY HASH?
Previous Message Tim Dawborn 2020-06-06 08:53:00 Re: Potential optimisation for the creation of a partial index condition over a newly created nullable, non-default-valued column?