have pg_restore create a new database?

From: "Thomas H(dot)" <me(at)alternize(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: have pg_restore create a new database?
Date: 2006-11-26 13:18:32
Message-ID: 08ec01c7115d$5fb8dd50$0201a8c0@iwing
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

i'm trying to have pg_restore create a new db and load the data.

unfortunately, pg_restore always uses the database name specified in the dump. "--create" and "--dbname=newdb" does not seem to have any effect (pg_restore yells about database being non-existant).

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.

regards,
thomas

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-11-26 16:57:54 Re: have pg_restore create a new database?
Previous Message Ragnar 2006-11-26 11:13:26 Re: PGDATA