PostgreSQL 9.2 – EBS Snapshot on AWS Guide

awspostgresql-9.2snapshot

I found this post here back from 2011, and wanted to verify that it's still valid and good advice to take a hot snapshot of an ebs volume (PostgreSQL still running) so long as you're snapping all of the data.

The PostgreSQL documentation indicates that a low level snapshot is fine so long as the whole data directory (WAL and all tables, different tablespaces could cause an issue) are taken in the same snapshot.

I'm currently using PostgreSQL v9.2.

Best Answer

Yes, that advice remains valid.

A low level snapshot of a volume that does atomic snapshots is much like a plug-pull or server crash. When restored from the snapshot, PostgreSQL just does normal recovery where it replays the transaction logs.

It's a perfectly sensible way to take a backup, though I recommend also taking periodic dumps. Snapshot backups won't help you in the face of undetected filesystem corruption etc.