Zhang Chen

Zhang Chen

PostgreSQL ACE & PostgreSQL Recovery Specialist

Creator of PDU (PostgreSQL Data Unloader) • Passionate about data recovery solutions and database reliability

Latest Posts

Thoughts, stories, and ideas

PostgreSQLKernel InternalsWALFPW
2026-03-0511 min-

Inside the Kernel: A PostgreSQL DELETE Recovery Path — From FPW to Data Reconstruction

In PostgreSQL, DELETE normally does not erase the tuple body immediately. MVCC first makes the old row version invisible to later transactions; before page cleanup, space reuse, or storage overwrite, those physical bytes may remain useful recovery evidence. That evidence has no fixed lifetime. VACUUM or page pruning can make the space reusable, and later writes can overwrite it. Surviving bytes alone do not guarantee trustworthy reconstruction of typed fields, TOAST values, or complete business rows. At this point, retained WAL may provide another source of physical evidence. In particular, a usable FPW (Full Page Write) can preserve an earlier image of a data page. PostgreSQL DELETE recovery tools — including PDU (PostgreSQL Data Unloader) — can evaluate these images together with relation files and relevant WAL records. WAL from the incident period is necessary for this path but is not sufficient by itself: an ordinary DELETE record does not guarantee a complete old row, and recoverability also depends on full_page_writes, checkpoint timing, page-image coverage, PostgreSQL version, TOAST data, and whether the underlying evidence was overwritten. This article dissects that recovery path function by function, based on PostgreSQL 18 source code.

Read More
Unconventional RecoveryData DictionaryData RecoveryInstant Recovery
2026-01-095 min-

How to Turn PostgreSQL Unconventional Recovery into an Engineering Practice

When the database cannot start and no backup is available, many teams assume recovery is over. In many cases the data is still on disk, but the data dictionary is no longer usable. This article examines core challenges in unconventional recovery: rebuilding table structures from damaged dictionaries, handling dropped columns and TOAST tables, continuing under imperfect conditions, and why recovery speed is itself part of the capability.

Read More
Instant RecoveryBackupDatabase InternalsDisaster Recovery
2026-01-097 min-

Not a Backup Replacement: What PostgreSQL Instant Recovery Actually Solves

When people first hear about instant recovery, they often assume it is a replacement for backup—or worse, a risky shortcut only experts should attempt. But the truth is exactly the opposite. Instant recovery does not challenge any design boundary of PostgreSQL. It simply rejects a premise the kernel never promised - that the database must be in a bootable state. This article explains, from the perspective of PostgreSQL internals, why instant recovery is a capability that was always meant to exist, how it differs fundamentally from backup recovery, and why time itself is often the scarcest resource at an incident scene.

Read More