On Thu, May 13, 2010 at 8:16 PM, Scott Marlowe
<scott.marlowe@gmail.com> wrote:
That will work. So will pg_dumpall | gzip > filename.gz if you want
compression.
My preference is to use
pg_dumpall -g > globals.bak
pg_dump -Fc database > database.bak
pg_dump -Fc database1 > database1.bak
etc..
The major reason for this is because this allows selective restores. If something goes wrong with my 'users' table in 'database1' :
Using the pg_dumpall strategy
- uncompress large text file
- manually cut 'users' table from large text file
- restore
With the pg_dump -Fc strategy
- pg_restore -t users -d database1 < database1.bak
The pg_dump -Fc strategy also allows you to leverage the new, parallel restore feature (-j option to pg_restore) in 8.4.
--Scott
What's more important is that you first prove your backups are working
by restoring them elsewhere, then check every month or so to make sure
they're still happening.