Backup and Restore

Download postgresql eBook

Remarks

Backing up the filesystem instead of using pg_dumpall and pg_dump

It's very important that if you use this, you call the pg_start_backup() function before and pg_stop_backup() function after. Doing filesystem backups is not safe otherwise; even a ZFS or FreeBSD snapshot of the filesystem backed up without those function calls will place the database in recovery mode and may lose transactions.

I would avoid doing filesystem backups instead of regular Postgres backups, both for this reason, and because Postgres backup files (especially in the custom format) are extremely versatile in supporting alternate restores. Since they're single files, they're also less hassle to manage.

Related Examples

Stats

131 Contributors: 5
Wednesday, January 18, 2017
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook