Part of Managed PostgresPostgres · Backups

pg_dump, WAL archiving or snapshots: which Postgres backup protects against what.

A nightly pg_dump gets back yesterday’s data, one table or all of it, on any version. WAL archiving gets back any moment inside its window, for the whole server. Snapshots are fast but live beside the disk they copy. A replica is not a backup: it replays your mistakes. Most teams need dumps plus a copy kept somewhere else.

Facts checked

What protects against what

Start from what can go wrong, not from the tools. Each row is a real way to lose data; each column is a kind of copy. “Yes” assumes the copy is stored off the database server, which is the part most setups get wrong.

What goes wrongNightly pg_dumpWAL archiving (PITR)Volume snapshotReplica
A bad migration or DELETE at 14:05 †Back to last night; the day’s writes are lostBack to 14:04Back to the last snapshotNo: it replays the delete within seconds
A mistake nobody notices for 10 days †If you keep 10+ days of dumpsOnly if the window is 10+ daysIf snapshots are kept that longNo
You need one table back, not the whole database † † †Yes: pg_restore -tRestore the whole server elsewhere, then copy the tableSame: whole server onlyNo
The disk or the server dies †Yes, if stored elsewhereYes, if the archive is elsewhereOnly if the snapshot is stored off that diskYes, and fastest to get back online
The whole data centre is goneOnly a copy in another placeOnly an archive in another placeUsually noOnly a replica in another place
An app bug writes bad data for daysYes, with enough retention, plus work to mergeWithin the windowWith enough retentionNo
Someone with your admin credentials deletes the database and its backupsOnly a copy they can’t reachOnly an archive they can’t reachOnly if they can’t delete snapshotsNo
Moving to another host or major version † †Yes: dumps restore across versionsNo: same major version onlyNo: same major version onlyLogical replication only

† Competitor details come from each vendor’s own published pages on the dates shown; prices and plans change, so check the vendor before you decide. A bad migration or `DELETE` at 14:05 (2026-10-29) · A mistake nobody notices for 10 days (2026-10-29) · You need one table back, not the whole database (2026-10-29) · You need one table back, not the whole database (2026-10-29) · You need one table back, not the whole database (2026-10-29) · The disk or the server dies (2026-10-29) · Moving to another host or major version (2026-10-29) · Moving to another host or major version (2026-10-29)

The four kinds of copy

# A logical backup of one database, compressed, restorable with pg_restore
pg_dump -Fc -f app-$(date +%F).dump "$DATABASE_URL"

# Roles and grants live outside the database: dump them separately
pg_dumpall --globals-only -f globals.sql

# Restore one table from it, into a scratch database
pg_restore -d scratch -t orders app-2026-10-28.dump
KindWhat it isWorth knowing
pg_dump †A logical export of one database: SQL, or a compressed archive for pg_restoreConsistent even while the app writes, and doesn’t block it. One database at a time; roles need pg_dumpall --globals-only. Restoring rebuilds every index, so large databases restore slowly.
WAL archiving + base backups † †A physical copy of the data directory, plus every write-ahead log segment sinceRecovers to any moment after the base backup, but only the whole cluster, and needs an unbroken run of WAL. Tools like pgBackRest manage the base backups, retention and object-storage repositories.
Volume snapshot †A frozen, point-in-time copy of the disk the data directory sits onWorks while Postgres runs only if the snapshot is atomic across the data and the WAL. Whole cluster only. Often stored on the same storage system as the original.
ReplicaA second server applying the same changes, streaming or logicalProtects against losing the primary, not against anything that is written to it. Not a backup on its own.

† Competitor details come from each vendor’s own published pages on the dates shown; prices and plans change, so check the vendor before you decide. `pg_dump` (2026-10-29) · WAL archiving + base backups (2026-10-29) · WAL archiving + base backups (2026-10-29) · Volume snapshot (2026-10-29)

Two numbers to decide first

How much data can you lose? (the recovery point objective). With nightly dumps, up to a day. With WAL archiving, minutes or less. Be honest about what a lost afternoon of orders or bookings costs you.

How long can you be down while restoring? (the recovery time objective). A dump of a few gigabytes restores in minutes; tens of gigabytes can take an hour or more, because every index is rebuilt. Time a real restore. A backup you have never restored is a guess.

For most small apps the answer is “a few hours of writes at most, back within an hour”. That is covered by frequent dumps kept off the server. Add point-in-time recovery when losing even an hour of writes is a problem, or when mistakes are likely to be noticed mid-day.

What Canner does for each row

Here is how the table maps to Canner’s database features, including where a gap remains and what to do about it.

# Scheduled backups: every 24 h, keep 7 days, copy each one to your own bucket
canner db backup-policy primary --enable --every 24 --keep 7
canner db offsite add ...
canner db backup-policy primary --offsite my-b2

# Point-in-time recovery on the dedicated instance, archive copied off-site too
canner db pitr --offsite my-b2
canner db pitr-restore primary --to 2026-10-28T14:04:00Z

# An independent copy, pulled from CI with a token, kept where Canner can't delete it
CANNER_TOKEN=... canner db export --out app-$(date +%F).dump
ProtectionOn CannerPlans
Scheduled backupsA backup policy per database: how often (as often as hourly) and how long to keep each backup (at least a day). Each backup is encrypted with its own key; deleting it destroys the key. Restores go to a new database, or in place after a snapshot of what was there.Every plan. Starter: once a day, restore in place or inspect first.
Proof the backup restoresEvery night Canner restores the newest backup into a scratch database, reads every table back and marks it Verified. A failed test raises an alert.Every plan
Point-in-time recoveryEvery change archived, a window of 1 to 35 days (7 by default), recovery in place after a snapshot or into a new database. The archive is AES-256 encrypted with a key unique to your instance.Dedicated instance, $9/month per project
Copies off the serverUp to five S3-compatible buckets you own. Backups are copied minutes after they finish; the recovery archive can be shipped too. The bucket alone can’t be read: the key stays with Canner.Every plan for backups; PITR archive with the dedicated instance
A replicaLogical replication to a Postgres server you run elsewhere.Dedicated instance
A copy nobody at Canner can deleteNot built in: deleting a backup on Canner also deletes its off-site copy. Pull your own with canner db export.Every plan

A default plan for a small team

  • Daily dumps, kept 7 to 30 days, copied off the server. On Canner: a backup policy with an off-site destination.
  • Point-in-time recovery if a lost afternoon matters. A window longer than the time it takes you to notice a mistake, plus a margin. On Canner, the dedicated instance.
  • One copy under different credentials. A weekly pg_dump (or canner db export) pulled by CI into a bucket with write-once retention, if your provider offers it, under an account the app and its host can’t touch.
  • A restore you have actually run, timed, at least once a quarter. Restore into a scratch database and compare row counts.
  • Secrets backed up separately, so a restored database can be used.

When this is not enough

Canner runs in one region, Montréal, without automatic failover or a standby. Backups and off-site copies get your data back after losing the server, but getting back online means restoring, which takes as long as the restore takes. If you need a standby in a second region that takes over in seconds, Canner does not offer that today, and you would run that replica yourself or choose a provider built for it.

Questions

Is pg_dump enough for production backups?

For many small databases, yes, if the dumps run often enough for the data you can afford to lose, are kept off the server, and have been test-restored. It falls short when losing hours of writes is unacceptable or the database is so large that a restore takes too long.

What is the difference between pg_dump and pg_basebackup?

pg_dump exports one database logically, restorable on any newer version and one table at a time. pg_basebackup copies the whole cluster’s data files; combined with archived WAL it allows point-in-time recovery, but only on the same major version and only for the whole cluster.

Is a read replica a backup?

No. A replica applies every change from the primary, including a DROP TABLE or a bad UPDATE, within seconds. It protects against losing the primary server, not against mistakes.

How long should I keep Postgres backups?

At least as long as it might take to notice a problem, which is often longer than people expect: a week is a common minimum, 30 days is safer. Retention rules from your industry or contracts may set it for you.

Does Canner back up my database automatically?

You turn on a backup policy per database, on every plan: how often, and how long to keep each backup. Canner then test-restores the newest backup every night and alerts you if a backup fails.

Backups that are tested every night.

Scheduled, encrypted, restored overnight to prove they work, and copied to your own buckets. See the Postgres plans.