Free audit

View Audit Scope
PostgreSQLBackups, point-in-time recovery, restore drills

PostgreSQL Backup and Recovery

JusDB reviews, builds, and tests PostgreSQL backup and recovery for PostgreSQL 13 to 18 on your own servers, Kubernetes, Amazon RDS, Aurora, Cloud SQL, and Azure. Our engineers set up pgBackRest, Barman, or WAL-G with continuous WAL archiving for point-in-time recovery, and run restore drills that time a real restore.

The first 30-minute call covers your databases, current ownership, and required coverage. No production access is needed.

  • NDA before access
  • Read-only by default
  • Written scope before work starts
Tools we work with
pgBackRest, Barman, WAL-G, pg_basebackup and pg_combinebackup, pg_dump and pg_restore
Recovery paths
Full cluster restore, point-in-time recovery from archived WAL, single database or table restore
Response SLA
15 mins for a critical (P1) incident, 24/7, under a support agreement.

The short answer

What PostgreSQL backup and recovery covers

PostgreSQL backup and recovery is the set of base backups, archived write-ahead log (WAL), and procedures that let you rebuild a cluster after hardware failure, a bad migration, an accidental DROP TABLE, corruption, or ransomware. A physical base backup plus every WAL segment written since it is what makes point-in-time recovery possible.

Streaming replicas are not backups. A standby replays the bad UPDATE as faithfully as the good ones, usually within a second. Patroni and other failover tools protect against losing a server; undoing a logical mistake still needs a base backup taken before it and archived WAL to roll forward to just before it.

Our work starts with a read-only review: the backup tool and its configuration, archive_command or archive_library, WAL retention and replication slots, repository location and delete rights, encryption keys, and the date of the last successful restore. The written report ranks the gaps, then our engineers fix the ones you approve and run a restore drill to prove the fix.

Backup methods

Physical and logical backups for PostgreSQL

Physical backups restore a whole cluster and support point-in-time recovery. Logical dumps restore single databases or tables and move data between versions. Most production setups need both.

PostgreSQL backup methods, what each one captures, how it restores, and when it fits
MethodWhat it capturesHow it restoresWhere it fits
pgBackRestPhysical full, differential, and incremental backups with parallel compression, plus WAL archiving through archive-push. One or more repositories on local disk, S3, GCS, or Azure.pgbackrest restore with --type=time or another target; --delta rewrites only changed files on an existing data directory.Large clusters where backup and restore speed matter, backups taken from a standby, and teams that want built-in verification.
BarmanBase backups through pg_basebackup or rsync, and WAL by archive_command or streaming with pg_receivewal, managed from a central backup server.barman recover to a target time, transaction ID, or restore point, locally or over SSH to the restore host.Several clusters backed up from one server; barman-cloud tools write to object storage, and CloudNativePG builds on them.
WAL-GBase backups (including delta backups) and WAL pushed straight to object storage, compressed and optionally encrypted.wal-g backup-fetch for the base backup and wal-g wal-fetch as restore_command.Object-storage-first setups and Kubernetes operators that ship with it, such as the Zalando operator.
pg_basebackupBuilt-in physical copy of the cluster with a backup manifest. PostgreSQL 17 adds incremental backups (summarize_wal on) merged with pg_combinebackup.Copy into place, add WAL, start; pg_verifybackup checks the files against the manifest first.Simple setups and seeding replicas; retention, archiving, and expiry need tooling around it.
pg_dump and pg_restoreLogical snapshot of one database. Directory format (-Fd) dumps and restores in parallel with -j.pg_restore of a whole database or selected tables; no roll-forward to a later point.Table-level restores, major version moves, and copies outside a managed service. Add pg_dumpall --globals-only for roles.

Archived WAL is what turns a base backup into point-in-time recovery. Without a complete WAL archive, the best you can restore to is the moment the base backup finished.

Point-in-time recovery

How PostgreSQL point-in-time recovery works

Point-in-time recovery (PITR) restores a base backup and replays archived WAL up to a chosen time, LSN, transaction ID, or named restore point, then stops.

  1. Step 1

    Archive every WAL segment off the server

    wal_level replica or higher, archive_mode on, and archive_command or archive_library pointing at pgBackRest, Barman, or WAL-G. The archive must keep running after a failover, so it is set on every node that can become primary.

  2. Step 2

    Pick the recovery target

    A timestamp works for most cases. For precision, find the LSN or transaction ID from logs or pg_waldump, or use a restore point created with pg_create_restore_point() before risky changes.

  3. Step 3

    Restore the base backup to a separate host

    Restore the latest base backup taken before the target onto an isolated server, with restore_command able to fetch WAL from the archive.

  4. Step 4

    Recover, pause, and check before promoting

    Set recovery_target_action to pause, start PostgreSQL, and check the data with you. Then promote and repoint the application, or copy back only the damaged rows with pg_dump.

pgBackRest: restore to a point in time

# Check the stanza and the WAL archive before relying on it
pgbackrest --stanza=main check
pgbackrest --stanza=main info

# Restore to just before the bad change, then pause for checks
pgbackrest --stanza=main --delta \
  --type=time "--target=2026-11-20 14:31:59+05:30" \
  --target-action=pause restore

Native settings (PostgreSQL 12 and later)

# postgresql.conf on the restore host
restore_command = 'pgbackrest --stanza=main archive-get %f "%p"'
recovery_target_time = '2026-11-20 14:31:59+05:30'
recovery_target_action = 'pause'

# Tell PostgreSQL to start in targeted recovery
touch $PGDATA/recovery.signal

Illustrative commands with placeholder names and times. Real runbooks are written against your hosts, paths, and retention settings.

Restore testing

A PostgreSQL backup counts once it has been restored

A backup job reports success when files land in the repository. A restore drill rebuilds the cluster on separate infrastructure and checks it, so a broken WAL chain or missing key is found on a quiet day instead of during an incident.

  • The repository is consistent

    pgbackrest verify or pg_verifybackup checks backup files against their manifests, and the archive is checked for missing WAL segments.

  • WAL replays to a target

    The restore reaches a chosen recovery target with no missing segment, which proves the archive is complete across the backup window.

  • Data and indexes are sound

    pg_amcheck (PostgreSQL 14 and later) or the amcheck functions check heap and B-tree indexes on the restored copy, row counts on key tables are compared, and the application's smoke queries run against it.

  • Roles, extensions, and keys come back

    Roles, grants, extensions, and tablespaces restore with the data, and the repository encryption passphrase or KMS access is available away from the database host.

  • Restore time is measured

    Each stage (fetch, restore, WAL replay, checks) is timed, so the restore time you plan around comes from a real run against your agreed RTO.

  • The runbook is updated

    Any step that was missing, wrong, or slow goes back into the written restore runbook your team keeps.

What each restore drill leaves in writing

  • Which base backup and WAL range were restored, and the recovery target
  • Time taken for each restore stage, compared with the agreed RTO
  • Checks run on the restored cluster and their results
  • Problems found, fixes made, and runbook changes

What backup reviews find

PostgreSQL backup gaps we find most often

These come up repeatedly in backup reviews. Most of them leave the backup job green, which is why they survive until someone tries a restore.

  • An archive_command that does not really archive

    A plain cp that returns success before the file is durable, or a script that swallows errors, leaves silent holes in the WAL archive that only a restore exposes.

  • Archiving stops after a failover

    If archive_mode or the backup tool is set only on the old primary, a Patroni or manual failover quietly ends WAL archiving on the new timeline.

  • Failed archiving or stale slots fill the disk

    When archive_command keeps failing, or an abandoned replication slot holds WAL, pg_wal grows until the volume fills and the primary stops accepting writes.

  • Keys and passphrases stored only on the host

    A pgBackRest repo-cipher-pass or WAL-G key that lives only in the database server's config is lost with the server, and the encrypted repository cannot be read.

  • Backups in the same account as production

    Repositories that production credentials can delete do not survive ransomware or a compromised account. Object lock or a separate account with restricted delete rights closes that gap.

  • Corruption copied into every backup

    Without data checksums or periodic amcheck runs, a corrupted page is backed up faithfully for weeks. Restore drills are a good place to run those checks.

Managed cloud and self-managed

PostgreSQL backups on managed cloud and your own servers

Managed services archive WAL for you, but retention, copies outside the provider, and the restore procedure stay your team's decisions.

What each PostgreSQL platform handles for backups and what stays with your team
PlatformWhat the platform handlesWhat stays with your team
Amazon RDS for PostgreSQLAutomated snapshots and archived WAL for point-in-time restore within the retention period you set; restores create a new instance.Retention, cross-region and cross-account copies, KMS key access, pg_dump copies for table-level restores, and repointing steps.
Amazon Aurora PostgreSQLContinuous, incremental backups with point-in-time restore to a new cluster.Snapshot copies outside the account, logical exports, and drills that include the application cutover.
Cloud SQL and Azure Flexible ServerAutomated backups and point-in-time restore to a new instance or server.Retention settings, exports to storage you control, and timing a restore for your data size.
Self-managed, VMs, and KubernetesNothing by default. Operators bring tooling: CloudNativePG uses Barman Cloud, Crunchy PGO uses pgBackRest, and the Zalando operator uses WAL-G.Everything: tool choice, schedules, WAL archiving, storage, encryption, monitoring, and restore drills.

Your team keeps control

  • Set business priorities, application requirements, and release plans
  • Approve production changes, except routine actions you have pre-approved
  • Own your cloud accounts, access policies, and vendor relationships
  • Decide when maintenance can happen and how quickly service must recover
  • Move the work in-house or to another provider after your agreement's notice period, with your data returned or deleted and the transition help your agreement sets out (see Terms, section 8)

JusDB handles the agreed work

  • Monitor database health, investigate alerts, and involve the right people
  • Review query performance, replication, capacity, and backup health
  • Carry out approved changes and update the operating instructions they affect
  • Report completed work, open risks, and recommended next steps

Ways to work

Where PostgreSQL backup and recovery work sits

A backup review is a scoped project with a written report. Running backups, restore drills, and incident restores week to week sits inside a remote DBA or support agreement.

When a restore is part of an incident

24/7 support. SLA response times: P1 – 15 mins | P2 – 30 mins | P3 – 60 mins. Our engineering team is in India (IST, UTC+5:30) and provides 24/7 support.

Response means an on-call engineer is working the incident, not an automated reply.

For procurement and security

NDA first, read-only by default, and written scope

Backup files hold a full copy of your data, so access to them is agreed as carefully as access to production. Your team approves every change and keeps every runbook, script, and drill report.
  • Mutual NDA
  • Written statement of work
  • Named engineers
  • Least-privilege access
  • NDA before access

    Signed before any diagnostic access. The scoping call needs no credentials.

  • Written scope

    Covered databases, backup tooling, drill cadence, and recovery targets agreed in writing.

  • Least-privilege accounts

    Named accounts with only the backup and restore privileges the work needs, through your bastion or VPN.

  • Runbooks you keep

    Restore procedures, scripts, and drill records stay with your team.

JusDB's security practices are aligned with ISO 27001 and SOC 2 Type II, and JusDB is pursuing both certifications (see Terms, section 12). Read the stated status.

Further reading

PostgreSQL backup and restore guides

Longer write-ups from our engineering blog, plus the cross-engine backup and disaster recovery service.

FAQ

PostgreSQL backup and recovery questions

Answers on pgBackRest, Barman, and WAL-G, point-in-time recovery, pg_dump, recovery targets, and managed cloud backups.

Still have a question?

Ask it on a scoping call. No production access needed.

Book a 30-min scoping call (opens Google Calendar in a new tab)

What does PostgreSQL backup and recovery work with JusDB cover?

It covers the backup tool and schedule for each cluster, WAL archiving for point-in-time recovery, where backup repositories live and who can delete them, encryption and key storage, and whether a restore has been tested recently. A first engagement is usually a written backup review; ongoing backup checks and restore drills run under a PostgreSQL remote DBA or support agreement.

Should we use pgBackRest, Barman, or WAL-G?

All three take physical base backups and archive WAL for point-in-time recovery, and all three are used widely in production. pgBackRest has full, differential, and incremental backups, parallel transfer, several repositories, and built-in verification. Barman runs from a central backup server and suits teams that manage many clusters from one place. WAL-G is light and object-storage first, and is common under Kubernetes operators. If one is already working, we usually harden it rather than replace it.

How does PostgreSQL point-in-time recovery work?

You restore a physical base backup taken before the target time, set restore_command so PostgreSQL can fetch archived WAL, set recovery_target_time (or an LSN, transaction ID, or named restore point), and start the server with a recovery.signal file. PostgreSQL replays WAL up to the target and then pauses, promotes, or shuts down according to recovery_target_action. It works only if every WAL segment since that base backup was archived.

Is pg_dump enough as a PostgreSQL backup?

For small databases, sometimes. pg_dump gives a consistent logical copy of one database at one moment, but it cannot roll forward to a later point, it does not include roles or tablespaces (pg_dumpall --globals-only does), and restoring a large database from it takes a long time because indexes are rebuilt. Most production systems use a physical backup tool with WAL archiving, and keep pg_dump for table-level restores and moves.

Do you commit to a fixed RTO or RPO for PostgreSQL?

No. Restore time and the amount of recent data at risk depend on database size, storage and network throughput, how WAL is archived, and the kind of failure. We help you set RTO and RPO targets for each cluster, design backups and WAL archiving to meet them, and measure real restore times in drills so the targets rest on evidence.

Do you work with RDS, Aurora, and Cloud SQL for PostgreSQL backups?

Yes. Managed services keep automated backups and WAL for point-in-time restore within the retention you configure, and the restore creates a new instance or cluster. You cannot run pgBackRest against them, so we review retention, cross-region and cross-account copies, key access, and logical dumps for copies outside the provider, and we time a real restore of your data size.

We need an emergency PostgreSQL restore. What happens now?

For JusDB support clients, an emergency restore is handled as an incident. 24/7 support. SLA response times: P1 – 15 mins | P2 – 30 mins | P3 – 60 mins. If you are not yet a client, send us the incident details. We review enquiries within 2–4 business hours, Mon–Fri 09:00–18:00 IST. Work starts once scope and access are agreed.

Next step

Talk to a PostgreSQL engineer about your backups

Tell us which PostgreSQL versions and platforms you run, how you back them up today, and when you last restored one. The first 30-minute call covers your databases, current ownership, and required coverage. No production access is needed.

NDA before access · read-only by default · written scope first