Re: have pg_restore create a new database? - Mailing list pgsql-general

From Tom Lane
Subject Re: have pg_restore create a new database?
Date
Msg-id 19169.1164560274@sss.pgh.pa.us
Whole thread Raw
In response to have pg_restore create a new database?  ("Thomas H." <me@alternize.com>)
List pgsql-general
"Thomas H." <me@alternize.com> writes:
> what is the proper method to restore data from a previous named database =
> "olddb" into a fresh database named "newdb"? the old database still =
> exists and i don't want to overwrite the data.

Create newdb by hand and then specify it as the connection target for
pg_restore.  *Don't* use --create, as that tells pg_restore to create
and (re)connect to the database named in the dump.

            regards, tom lane

pgsql-general by date:

Previous
From: "Thomas H."
Date:
Subject: have pg_restore create a new database?
Next
From: "Thomas H."
Date:
Subject: Re: have pg_restore create a new database?