Zhang Chen

Zhang Chen

PostgreSQL ACE & PostgreSQL Recovery Specialist

Developer of PDU (Prowess Data Unloader) • Writes about database file parsing and recovery

Latest Posts

Database parsing and recovery notes

PostgreSQLKernel InternalsWALFPW
2026-03-0511 min-

Inside the Kernel: The Complete Path to PostgreSQL Delete Recovery — From FPW to Data Resurrection

In PostgreSQL, a DELETE operation does not immediately erase data from disk. The MVCC mechanism retains deleted rows as dead tuples, and reading these dead tuples is one viable approach to data recovery. However, this approach has a clear time limitation: once autovacuum completes its cleanup, the dead tuples are physically removed, and recovery methods based on data files become ineffective. At this point, the WAL (Write-Ahead Log) offers an alternative recovery path. Specifically, the FPW (Full Page Write) mechanism within WAL is the foundation of this approach. PostgreSQL DELETE recovery tools — including PDU (PostgreSQL Data Unloader) — rely on this technique. Its key property: recovery requires a usable full-page image and the necessary WAL records from that image to the deletion. Retaining only the WAL files from the deletion period does not guarantee complete recovery. 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
PostgreSQL 技术博客