citusdata / citusdata/citus

Cascade distributed table creation via foreign key graph

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

Description

The following operation fails:
```
create table ref (a int primary key, b int);
create table test (x int, y int references ref (a));
select create_distributed_table('test','x');
ERROR: referenced table "ref" must be a distributed table or a reference table
DETAIL: To enforce foreign keys, the referencing and referenced rows need to be stored on the same node.
HINT: You could use SELECT create_reference_table('ref') to replicate the referenced table to all nodes
```

Given improved support for local-reference table joins and foreign keys, we could consider taking the step suggested in the hint automatically. Optionally, via a cascade flag.

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.