snapshot too old

SQLSTATE 72000 condition snapshot_too_old class 72 — Snapshot Too Old severity ERROR
Reproduced & verified on PostgreSQL 14.23, 15.18, 16.14, 17.10 and 18.4 — identical message on every version.
Last reviewed 11 Jun 2026 · Reproduced live with the SQL on this page.

Symptoms

A long-running query tried to read data that has since been removed because the snapshot exceeded old_snapshot_threshold. PostgreSQL raises SQLSTATE 72000 (snapshot_too_old).

What the server log shows

ERROR:  snapshot too old

Why PostgreSQL raises this — what the manual says

As Section 19.4 Resource Consumption (historical old_snapshot_threshold) explains:

This error originated from the old_snapshot_threshold mechanism, which bounded how long a snapshot could be used before the pages it relied on could be reclaimed; a long-running query that then tried to read already-removed data was aborted as “snapshot too old”. (The old_snapshot_threshold feature was removed in PostgreSQL 17.)

When old_snapshot_threshold is set, VACUUM may remove old tuple versions that an aged snapshot still needs. If that snapshot then reads the affected data, the rows are gone, so PostgreSQL reports 72000 rather than returning wrong results.

Common causes

Relevant GUC parameters

Parameter Default Effect
old_snapshot_threshold -1 (disabled) Max age a snapshot may be before its reads can fail with snapshot too old

How to fix it

  1. Shorten or batch long-running queries/transactions.
  2. Avoid idle-in-transaction sessions; commit/rollback promptly.
  3. Increase old_snapshot_threshold (or set -1 to disable) if long snapshots are required — at the cost of more bloat.

Related & next steps

Reference: PostgreSQL 18 — Resource Consumption configuration.