FAQ
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.

Thanks
Paramjeet Kaur
Professional Services and Motorola Broadband Solutions Group

Search Discussions

  • Robert Treat at Apr 12, 2007 at 1:12 am

    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-admin @
categoriespostgresql
postedApr 5, '07 at 9:42p
activeApr 12, '07 at 1:12a
posts2
users2
websitepostgresql.org
irc#postgresql

2 users in discussion

Bhella, Paramjeet: 1 post Robert Treat: 1 post

People

Translate

site design / logo © 2021 Grokbase