Re: Using pg_dump and pg_restore - Mailing list pgsql-general

From Tom Lane
Subject Re: Using pg_dump and pg_restore
Date
Msg-id 13864.1145375694@sss.pgh.pa.us
Whole thread Raw
In response to Using pg_dump and pg_restore  (Mark <mark@lumison.net>)
List pgsql-general
Mark <mark@lumison.net> writes:
> So far we have tried normal switches on the end of pg_dump, including
> -Fc, -c, C, with corresponding switches on the pg_restore command.  When
> the restore actually executes, it does not fully drop the DB prior to
> restoration so any test tables added to the DB after a dump are still
> there after a restore.

I think you want to drop the database explicitly.  Something like

    pg_dump -Fc mydb >mydb.dump
    ...
    dropdb mydb
    pg_restore -C -d template1 mydb.dump

            regards, tom lane

pgsql-general by date:

Previous
From: Mark
Date:
Subject: Using pg_dump and pg_restore
Next
From: Brendan Duddridge
Date:
Subject: Weird error updating table