SQLSTATE 53100 ERROR Class 53: Insufficient Resources

disk_full Disk Full — SQLSTATE 53100

The server could not write because the disk or tablespace is full.

PG 12, 13, 14, 15, 16, 17, 18 Official docs
Last reviewed May 2025 Grounded in source

Symptoms

The server could not write because the disk or tablespace is full.

  • The error is written to the server log and returned to the client carrying SQLSTATE 53100.
  • Any driver (libpq, JDBC, psycopg, npgsql, pgx) surfaces this code in its error object so you can branch on it programmatically.
  • PL/pgSQL can trap it by name: EXCEPTION WHEN disk_full THEN.

Environment

Severity: ERROR  |  PostgreSQL versions: 12, 13, 14, 15, 16, 17

Most often seen under load or on under-provisioned servers; correlate it with system metrics (CPU, memory, disk, connection count) at the time of the error.

Root Cause

A write failed for lack of free space on the data, WAL, or temp directory.

Common causes:

  • Ordinary data growth.
  • WAL piling up because archiving is failing or a replication slot is stale.
  • Large temp files from big sorts or joins.
  • Log files filling the volume.

Diagnostic Queries

Recovery

Steps to resolve 53100:

  1. Free space immediately: remove old logs/temp files or expand the volume.
  2. Check WAL bloat — a failing archive_command or an inactive replication slot prevents cleanup; fix archiving or drop the unused slot with pg_drop_replication_slot.
  3. Reduce temp usage by tuning queries and work_mem, or set temp_file_limit.
  4. Alert on disk usage well before the volume fills.

Reference: PostgreSQL error codes — Class 53 (Insufficient Resources).

Was this helpful?