---
title: "Discussion on \"A backup you've never restored is just a rumour\" | Hashnode"
description: "Discussion on \"A backup you've never restored is just a rumour\". I have 24 users and zero of them have deployed. If one of them deploys tomorrow and their server dies on Thursday, the only thing standing between them and a lost week is a backup I have never opened."
url: "https://hashnode.com/posts/a-backup-you-ve-never-restored-is-just-a-rumour/6ae115f5a868d799e26cc140"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [A backup you've never restored is just a rumour](https://crescodb.hashnode.dev/a-backup-you-ve-never-restored-is-just-a-rumour?utm_source=hashnode&utm_medium=feed)

I have 24 users and zero of them have deployed. If one of them deploys tomorrow and their server dies on Thursday, the only thing standing between them and a lost week is a backup I have never opened.

Oct 27 · 5 min read · crescodb.hashnode.dev  
Read the article

-   [#backups](https://hashnode.com/tag/backups)
-   [#postgresql](https://hashnode.com/tag/postgresql)

## Written by

[The Saint](https://hashnode.com/@saintdev)

@saintdev · Port Harcourt

  
[View profile](https://hashnode.com/@saintdev)

Building Crescodb , Build . Verify . Deploy . Operate . Own

## Responses 1

Markdown supported · ⌘↵ to post

[Mike Dabydeen](https://hashnode.com/@firelinks)

[Oct 28](https://hashnode.com/posts/a-backup-you-ve-never-restored-is-just-a-rumour/6ae115f5a868d799e26cc140/comment/6ae1db81ae89b7ba021c5378)

Comparing the scratch counts against the live database will drift on any table that is written constantly. By the time the restore finishes, production has moved on, so the cron check either complains every night or gets a tolerance wide enough to hide a table that came back half empty.

I'd take the expected numbers from the same snapshot the dump used. Open a session, start a REPEATABLE READ transaction, call pg\_export\_snapshot(), run pg\_dump --snapshot with that name, and run your row counts and newest timestamp in the same session before you commit. Save them next to the dump so they travel to R2 with it. The restore check then compares against exact figures, and any difference is real.

I'd also add --exit-on-error to the pg\_restore line. By default pg\_restore keeps going after an error and only prints a count at the end, which a script that reads row counts can miss.
