Wednesday, July 13, 2011

postgres backup and restore command

You can backup a postgres database backup using the following command:


pg_dump -U postgres -Fc -f /backupdir/test.pgsql.gz test
<--- test being the database name ---->

Similarly the backup file can be restored using the following command:

pg_restore -U postgres -Fc -d test /backupdir/test.pgsql.gz

0 comments:

Post a Comment