Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: have pg_restore create a new database?


  • From: "Thomas H." <me(at)alternize(dot)com>
  • To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
  • Cc: <pgsql-general(at)postgresql(dot)org>
  • Subject: Re: have pg_restore create a new database?
  • Date: Sun, 26 Nov 2006 18:02:07 +0100
  • Message-id: <0a0c01c7117c$9b62f880$0201a8c0(at)iwing>

"Thomas H." <me(at)alternize(dot)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.

i see.

but then failures will pop up: when creating a new db, it already contains the system languages, functions and tables (for example tsearch2). as the dump contains these as well, i'm getting lots of errors and more important, tsearch2 custom config won't be restored.

how can i create an *empty* database?

- thomas






Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group