Press "Enter" to skip to content

Removing a 4TB Table in PostgreSQL

Radim Marek drops a table:

GitLab has a public story about deleting the wrong thing. In January 2017 an engineer who was trying to restore replication wiped a data directory they believed was on the secondary. It was on the primary. The postmortem they published afterwards is still one of the better things written about a database outage.

At PGConf.EU in Valencia last week a few people from GitLab came to me with the inverse problem. They have one table, 4 TB, on a primary with ten replicas, and they want it gone, on purpose, with as little impact as they can manage. It’s an archival table: nothing writes to it, and nothing is supposed to read it.

Read on for a variety of thoughts around different ways to get to the same end state at differing levels of user impact.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.