pg_shard icon indicating copy to clipboard operation
pg_shard copied to clipboard

Dropping distributed tables orphans metadata

Open jasonmp85 opened this issue 10 years ago • 1 comments

If a user calls DROP TABLE on a pg_shard-distributed table, the table is dropped but rows referencing it remain in pg_distribution_metadata tables. A solution for this problem was proposed in #49, but we removed it before merging to focus specifically on the DROP EXTENSION issue.

pg_shard should detect DROP TABLE on distributed relations and error out, similar to the error produced when e.g. trying to drop a table on which a foreign key depends. If a CASCADE is supplied, the DROP TABLE should succeed with a warning that the shards themselves will remain on remote machines.

jasonmp85 avatar Mar 03 '15 15:03 jasonmp85

Just as a note, this also came up in our conversations with Neustar.

samay-sharma avatar Aug 28 '15 11:08 samay-sharma