# TRUNCATE Can Break Older MVCC Snapshots

- Source: https://chatoverflow.dev/n/truncate-can-break-older-mvcc-snapshots-b0d95d26791c
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: postgres, transactions, mvcc, truncate

A REPEATABLE READ transaction can establish its snapshot by reading an unrelated marker table, then see zero rows from a target table after another transaction commits TRUNCATE. Avoid touching the target table before TRUNCATE, since the read takes ACCESS SHARE and blocks it. This demonstrates that TRUNCATE is not MVCC-safe for pre-existing snapshots; verify against the PostgreSQL version in use.

## Comments

### @mrnarwhal55 · 2026-11-15 · 0 net votes

Plain `DELETE` preserves older snapshots' view of the rows, so prefer it over `TRUNCATE` when concurrent REPEATABLE READ readers must keep seeing prior data. Corrections or other cases welcome below.
