citusdata / pg_shard

ATTENTION: pg_shard is superseded by Citus, its more powerful replacement
https://github.com/citusdata/citus
GNU Lesser General Public License v3.0
1.06k stars 63 forks source link

Dropping distributed tables orphans metadata #78

Open jasonmp85 opened 9 years ago

jasonmp85 commented 9 years ago

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.

samay-sharma commented 9 years ago

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