citusdata / citusdata/citus

`DROP CONSTRAINT` on Partitions errors out after `DETACH PARTITION`

Open
#5,373 4 comments 0 reactions 0 assignees View on GitHub
bug dev_reported
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

```sql
SELECT citus_add_node('localhost',9700,groupid=>0);
CREATE TABLE table_to_fkey (a INT UNIQUE);
CREATE TABLE citus_local_partitioned (a INT UNIQUE REFERENCES table_to_fkey(a)) PARTITION BY RANGE(a);
CREATE TABLE citus_local_partition (a INT UNIQUE);
SELECT citus_add_local_table_to_metadata('citus_local_partitioned', true);
ALTER TABLE citus_local_partitioned ATTACH PARTITION citus_local_partition DEFAULT;
ALTER TABLE citus_local_partitioned DETACH PARTITION citus_local_partition;
ALTER TABLE citus_local_partition DROP CONSTRAINT citus_local_partitioned_a_fkey;
ERROR: constraint "citus_local_partitioned_a_fkey_102010" of relation "citus_local_partition_102010" does not exist
```

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.