citusdata / citusdata/citus

Can create a foreign key reference from a local table to a distributed table

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

Description

We prohibit establishing foreign key relationships between local and distributed tables. It can be circumvented as follows.

### Steps
- Create referenced table (r1)
- Create referer table (r2).
- Connection 1 starts transaction
- - adds foreign key to r2
- Connection 2 starts transaction
- - calls create distributed table on r1
- - gets blocked.
- Connection 1 commits.
- Connection 2 commits.

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.