↓ Skip to main content

“That’s because Postgres doesn’t bother actually deleting the data, it just marks the data as deleted.”

Drew Silcockdrew.silcock.dev ↗

Postgres keeps a table as an unordered heap of 8 KB pages inside 1 GiB segment files. A deleted row stays on disk as a dead tuple until vacuum reclaims the space. DELETE is a flag, not an erasure. Anyone who can read the data directory can read what you thought you removed.