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

Re: Restoring single database from an export dump of a cluster

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: pgsql-admin(at)postgresql(dot)org
Cc: "Bhella, Paramjeet" <PBhella(at)motorola(dot)com>
Subject: Re: Restoring single database from an export dump of a cluster
Date: 2007-04-12 01:12:02
Message-ID: 200704112112.03167.xzilla@users.sourceforge.net (view raw or flat)
Thread:
Lists: pgsql-admin
On Thursday 05 April 2007 17:13, Bhella, Paramjeet wrote:
> Hi
>
> In our production environment we use pg_dumpall to backup all the
> databases of a cluster as there are 200+ databases in a cluster. Some
> times there is a situation where we have to restore a single database
> from a cluster. According to the postgres docs there is a pg_restore
> utiltity which can be used to restore individual tables, schemas,
> databases etc. But pg_restore requires the pg_dump to be in archive
> format. With pg_dump we can use option -Fc to make the dump in non-plain
> text format but I cannot use -Fc option with pg_dumpall. Is there a way
> to import a single database from an export dump of a cluster? Your help
> or guidance will be highly appreciated.
>

Currently there is no way to restore a single database from a pg_dumpall short 
of heavy parsing of the dumpall script.  What I usually recommend to folks 
(and do with our servers @ omniti) is to have a script that does a 
pg_dumpall -g for the global objects and then individual pg_dump -Fc's for 
each database in the cluster. 

-- 
Robert Treat
Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL

In response to

pgsql-admin by date

Next:From: Robert TreatDate: 2007-04-12 01:20:42
Subject: Re: Advice on migration without down-time
Previous:From: Robert TreatDate: 2007-04-12 01:04:55
Subject: Re: Where are aliases stored?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group