Backup procedure - Mailing list pgsql-admin

From Enio Schutt Junior
Subject Backup procedure
Date
Msg-id 001a01c361bd$f134d2f0$e205000a@compaq
Whole thread Raw
List pgsql-admin
Hi,
 
According to some answers about the consistency of a database in a snapshot of a whole
HD (excluding proc, tmp, and dev, of course) and without stopping the postmaster service,
it is said it should work because it's like if the system has crashed, so restoring files from
the HD and starting the server would be ok.
 
According to postgresql administrator's guide, section 9.2 (File system level backup),
item #1: "The database server *must* be shutdown in order to get a usable backup. Half-way
measures such as disallowing all connections will not work as there is always some buffering
going on. For this reason it is also not advisable to trust file systems that claim to support
"consistent snapshots" ".
 
Assuming the admin's guide is a "little bit more" right, my backup restore procedure would
be as follows:
 
1-Restore data from the backup Hd into a new Hd.
2-Copy some files from /usr/local/pgsql/data like postgresql.conf, pg_hba.conf, pg_ident.conf, 
and some other authentication files whose names appear in pg_hba.conf (I suspect PG_VERSION and
postmaster.opts would not be needed as initdb should create these files) to another directory.
3-Remove the entire /usr/local/pgsql/data directory
4-Run initdb -D "/usr/local/pgsql/data"
5-Copy those files back to /usr/local/pgsql/data
6-Start the server
7-Restore information generated by pg_dump (tables) and pg_dumpall -g (users and groups)
 
Would this work well? I know there are other procedures and I would be pleased to know that
this procedure works fine. 
 
Thanks in advance,
Enio

pgsql-admin by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Two-fase-commit
Next
From: Raymond Chui
Date:
Subject: Why table has drop, but the foreign key still there?