pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedhowto restore from pg_dumpall
2+ messages / 2 participants
[nested] [flat]
* howto restore from pg_dumpall
@ 2008-03-16 19:46 Marc Fromm <Marc.Fromm@wwu.edu>
0 siblings, 1 reply; 2+ messages in thread
From: Marc Fromm @ 2008-03-16 19:46 UTC (permalink / raw)
To: pgsql-admin
When I restore from a pg_dumpall file, I am required to peform the following steps or else all the records in the databses are duplicated. If I only empty the data/base folder I get al sorts of errors. I find in necessary to wipe the entire data folder and rebuild it with initdb. Is there a better way to restore using a pg_dumpall file then doing all these steps:
* stop postmaster service
* delete everything in the data folder (var/lib/pgsql/data)
* as postgres user run initdb
* exit postgres user
* psql -U postgres -f pg_dumpall_file postgres
thansk
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: howto restore from pg_dumpall
@ 2008-03-16 22:05 Peter Eisentraut <peter_e@gmx.net>
parent: Marc Fromm <Marc.Fromm@wwu.edu>
0 siblings, 0 replies; 2+ messages in thread
From: Peter Eisentraut @ 2008-03-16 22:05 UTC (permalink / raw)
To: pgsql-admin; +Cc: Marc Fromm <Marc.Fromm@wwu.edu>
Marc Fromm wrote:
> When I restore from a pg_dumpall file, I am required to peform the
> following steps or else all the records in the databses are duplicated. If
> I only empty the data/base folder I get al sorts of errors.
You may find the pg_dumpall --clean option useful, so the dump file is set up
in a way that cleans out its predecessor objects automatically. Otherwise
you will have to find your own to way clean up before restoring.
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2008-03-16 22:05 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-03-16 19:46 howto restore from pg_dumpall Marc Fromm <Marc.Fromm@wwu.edu>
2008-03-16 22:05 ` Peter Eisentraut <peter_e@gmx.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox