Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YSQL] Support for Foreign Keys on partitioned tables #15424

Open
mrajcevic01 opened this issue Dec 22, 2022 · 0 comments
Open

[YSQL] Support for Foreign Keys on partitioned tables #15424

mrajcevic01 opened this issue Dec 22, 2022 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue

Comments

@mrajcevic01
Copy link
Contributor

mrajcevic01 commented Dec 22, 2022

Jira Link: DB-4542

Description

YugabyteDB is based off of PostgreSQL 11.2 where there is no support for foreign keys on partitioned tables. As a result this functionality has not yet been added to YugabyteDB. I have had numerous asks for this feature from users of row-level geo-partitioning. All requests so far have been from users migrating existing applications. As such there is no way to develop around the limitation. We currently have two avenues around this lack of support:

  1. We have created a function, using triggers, that accomplishes FK like behavior, however it is not recommended for production. It also cannot work with third party tools as they will not be referencing the function, and users have not access to the tools to change that. This function has not been performance tested at scale.
  2. If you are referencing a partitioned table from another partitioned table you can set up the FK relation on a partition by partition level. Meaning instead of a single FK from referencing table to referenced table, you will have separate FKs from each referencing partition to referenced partition.

Neither option above is ideal as it requires additional action/changes by the user.

@mrajcevic01 mrajcevic01 added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels Dec 22, 2022
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Dec 22, 2022
@yugabyte-ci yugabyte-ci added kind/enhancement This is an enhancement of an existing feature and removed status/awaiting-triage Issue awaiting triage kind/bug This issue is a bug labels Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

3 participants