Sent with ProtonMail Secure Email.
‐‐‐ Original Message ‐‐‐
On Friday, 5 June 2020 19:35, Tom Lane wrote:
> Laura Smith n5d9xq3ti233xiyif...@protonmail.ch writes:
>
> > But doesn't the second half of my original post demonstrate that I tried
> > that very thing ? I did try creating
Laura Smith 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)
Sent with ProtonMail Secure Email.
‐‐‐ Original Message ‐‐‐
On Friday, 5 June 2020 19:23, Christophe Pettus wrote:
> > On Jun 5, 2020, at 11:20, Laura Smith n5d9xq3ti233xiyif...@protonmail.ch
> > wrote:
> > sudo -u postgres pg_restore -v -C -d foobar 4_foobar_pgdump_Fc
>
> You need
> On Jun 5, 2020, at 11:20, Laura Smith
> 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:
According to the all-mighty manual
(https://www.postgresql.org/docs/current/app-pgrestore.html), life is supposed
to be as simple as:
"To drop the database and recreate it from the dump:
$ dropdb mydb
$ pg_restore -C -d postgres db.dump"
The reality seems to be somewhat different ?
sudo -u pos