Snapshot Too Old — SQLSTATE 72000
Symptoms
A long-running query tried to read data that had already been removed by vacuum under the (now-removed) old_snapshot_threshold feature.
- Message:
snapshot too old. - PL/pgSQL:
EXCEPTION WHEN snapshot_too_old THEN.
What the server log shows
ERROR: snapshot too old
Why PostgreSQL raises this — what the manual says
As Appendix A PostgreSQL Error Codes explains:
SQLSTATE 72000 (snapshot_too_old) is a legacy code: the old_snapshot_threshold feature that produced it was removed in PostgreSQL 14, so it no longer appears in the error-code list and is not raised by current servers.
72000 was raised by the old_snapshot_threshold mechanism: a snapshot older than the threshold reading a page whose old row versions had been vacuumed away got this error instead of silently wrong results. old_snapshot_threshold was removed in PostgreSQL 17, so on PG17+ this code is effectively never raised.
Common causes
- (PG ≤16) A very long transaction exceeding
old_snapshot_threshold. - Vacuum reclaiming row versions the old snapshot still needed.
How to fix it
- On PG17+ the feature is gone — this error no longer occurs.
- On older versions, keep transactions short or raise/disable
old_snapshot_threshold. - Avoid leaving idle-in-transaction sessions open.
Related & next steps
Reference: PostgreSQL 18 Appendix A — Class 72 (Snapshot Failure).