[GENERAL] review db dump script and difference between pg_dump & pg_dumpall

2008-10-08 Thread Chris Henderson
I have written the following script to backup _all_ databases on various servers that are running postgresql. I don't want anything fancy - just be able to backup the database and restore when bad times come. Just posting it here to be reviewed to see if I have made any mistake: #!/bin/bash DIR=/b

[GENERAL] Restoring a database

2008-10-15 Thread Chris Henderson
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 di

Re: [GENERAL] Restoring a database

2008-10-15 Thread Chris Henderson
> pg_dumpall archive. If you look at the backup file, you'll find that > it's just straight SQL. If you want to restore a particular database > out of it and not all of them, then you will need to edit the sql file > to include only what you want to restore. Then you simply pass it > through psq