# FATAL: the database system is in recovery mode

**Code:** `recovery mode` · **Category:** PostgreSQL · **Seen on:** PostgreSQL

PostgreSQL crashed (often OOM-killed) and is replaying WAL to recover.

## Meaning

When a backend process dies abnormally, the postmaster restarts all sessions and runs recovery. The PostgreSQL log shows which process was killed and why.

## Common causes

- A backend killed by the OOM killer
- Server crash/power loss
- Storage errors

## Quick fix

1. Check the PostgreSQL log and dmesg for OOM kills
2. Reduce work_mem/max_connections or add RAM
3. Let recovery finish

## Detailed fix by platform

### Linux

1. `dmesg -T | grep -i -E 'killed process|out of memory'`

## How to diagnose

1. **Cause** — What terminated the backend?
2. **Recent change** — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/postgresql/database-system-is-in-recovery-mode)
