ERROR: could not extend file "base/…": No space left on device

The disk holding the PostgreSQL data directory (or WAL) is full.

Seen on: PostgreSQL

Meaning

Writes fail immediately; if WAL can’t be written PostgreSQL may shut down. Old WAL from inactive replication slots and bloated tables are common culprits.

Common causes

  • Data volume full
  • WAL retained by an inactive replication slot
  • Large temp files from sorts
  • Logs on the same disk

⚡ Quick fix

  1. Free space/extend the volume
  2. Drop unused replication slots
  3. VACUUM FULL/pg_repack bloated tables (needs space)
  4. Move logs elsewhere

Detailed fix by platform

PostgreSQL

  1. SELECT slot_name, active, pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)) FROM pg_replication_slots;

How to diagnose

  1. Disk — df -h on data/WAL volume
  2. WAL — Retained by slots?

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.