---
title: "Discussion on \"PostgreSQL Point-in-Time Recovery: A Production Architecture Guide\" | Hashnode"
description: "Discussion on \"PostgreSQL Point-in-Time Recovery: A Production Architecture Guide\". A nightly pg_dump can only take you back to last night. If someone runs a bad migration at 14:31, you want the database as it was at 14:30. That is what PostgreSQL point-in-time recovery (PITR) does."
url: "https://hashnode.com/posts/postgresql-point-in-time-recovery-a-production-architecture-guide/6af893c14aebfdfe7ae319f6"
---

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

Discussion

# [PostgreSQL Point-in-Time Recovery: A Production Architecture Guide](https://disruptivestudio.hashnode.dev/postgresql-point-in-time-recovery-a-production-architecture-guide?utm_source=hashnode&utm_medium=feed)

A nightly pg\_dump can only take you back to last night. If someone runs a bad migration at 14:31, you want the database as it was at 14:30. That is what PostgreSQL point-in-time recovery (PITR) does.

1d ago · 10 min read · disruptivestudio.hashnode.dev  
Read the article

-   [#postgres](https://hashnode.com/tag/postgres)
-   [#database](https://hashnode.com/tag/database)
-   [#devops](https://hashnode.com/tag/devops)
-   [#backup](https://hashnode.com/tag/backup)

## Written by

[Daniel Cruz](https://hashnode.com/@danielcruznet)

@danielcruznet

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

Entrepreneur for 20+ years and UX designer with a psychology background. Founder of Disruptive Studio, building custom software and Ariani,

In a world driven by digital transformation, I've etched an indelible mark as a pioneering entrepreneur, graphic maestro, and innovative inventor. From stirring the cryptographic sphere with groundbreaking inventions to transforming a startup into a multi-million-dollar software giant, my journey is a testament to an unstoppable pursuit of excellence. A seasoned UX expert with deep roots in psychology, I shape digital landscapes that resonate with users, blend aesthetics with functionality, and evoke emotions. With a robust history in sales and professional networking, I build meaningful relationships that create synergies. My mantra, "wealth is inevitable to the right mindset", mirrors my belief in the transformative power of a proactive outlook. With over two decades of entrepreneurship, my path is dotted with innovation, value creation, and leadership. Eager to know more? Let's connect.

## Responses 2

Markdown supported · ⌘↵ to post

[Mario Fang](https://hashnode.com/@mariosfong)

[23h ago](https://hashnode.com/posts/postgresql-point-in-time-recovery-a-production-architecture-guide/6af893c14aebfdfe7ae319f6/comment/6af92c5dc9fd5126502acebd)

The "archive command that returns 0 when the upload fails" is the one that got me — a pipeline without pipefail reported success for weeks while nothing was actually landing in the archive. I found out during a restore test, not during an incident, and that is the only reason it became a funny story instead of a bad one. Your point about restoring to a new instance instead of overwriting the damaged primary is the other half of the same habit: the restore you practice is the restore you get.

[Daniel Cruz](https://hashnode.com/@danielcruznet)

[6h ago](https://hashnode.com/posts/postgresql-point-in-time-recovery-a-production-architecture-guide/6af893c14aebfdfe7ae319f6/comment/6af92c5dc9fd5126502acebd#reply-6afa1eb7708ea76c568882c7)

That’s exactly the failure the archive section is meant to catch: everything reports green while nothing is actually landing. Finding it in a restore test instead of an incident is the best possible version of that story. It’s also why the post doesn’t treat a zero exit code as proof. It alerts when pg\_stat\_archiver shows last\_failed\_time newer than last\_archived\_time, and the scheduled restore test checks real data, not just that the server starts. And yes, the restore you practice is the restore you get. Thanks for sharing it.
