Re: pg_dump'ed file contains "DROP DATABASE" - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_dump'ed file contains "DROP DATABASE"
Date
Msg-id 3630676.1676918157@sss.pgh.pa.us
Whole thread Raw
In response to pg_dump'ed file contains "DROP DATABASE"  (pf@pfortin.com)
List pgsql-general
pf@pfortin.com writes:
> The other day, I restored his first file with:
>   pg_restore --host "localhost" --port "5432" --username "postgres"
>   --no-password --dbname "myname" --create --clean --verbose "dumpfile"

> Was my 134 table[1] myname DB saved because it was open?

Yup.

> If the dump file
> contains the above statements, how can I be absolutely certain I won't
> lose the DB?

Reading the manual is advisable.  --create --clean specifies exactly
that the target database is to be dropped and recreated.

            regards, tom lane



pgsql-general by date:

Previous
From: pf@pfortin.com
Date:
Subject: pg_dump'ed file contains "DROP DATABASE"
Next
From: Adrian Klaver
Date:
Subject: Re: pg_dump'ed file contains "DROP DATABASE"