Re: Restoring a database - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: Restoring a database
Date
Msg-id 48F66078.1040308@iol.ie
Whole thread Raw
In response to Restoring a database  ("Chris Henderson" <henders254@gmail.com>)
List pgsql-general
On 15/10/2008 22:19, Chris Henderson wrote:
> I backup all my databases by using pg_dumpall - pg_dumpall >
> /tmp/postgres.backup.`hostname`. It should backup four DBs: analyze,
> postgres,  template0 and template1
> I guess this backs up the schemas as well.
>
> Now I want to restore one of the databases and schema from this backup
> dump file onto a different server. The databases is call "analyze".
> Does anyone know how to do that with pg_restore? Thanks.

Off the top of my head, I don't think you can do this with pg_restore.
pg_dumpall produces a plain-text dump, which means that you need to use
it as input to psql to restore from it; pg_restore uses the non-text
formats.

However, if the only other databases in the dump are the built-in ones,
they will add very little time to the restore process.

In any case, there's no need to back up databases postgres, template0
and template1, unless you've added custom stuff to template1 that you
need to keep.

Ray.


------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Restoring a database
Next
From: Jeff Frost
Date:
Subject: Re: Restoring a database