citusdata / citusdata/pg_shard

Dropping distributed tables orphans metadata

Open
#78 1 comment 0 reactions 1 assignee Claimed by @onderkalaci View on GitHub
feature
Dominant language
C
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.