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

Warn when distributing unenforceable constraints #222

Closed
citus-github-bot opened this issue Feb 4, 2016 · 2 comments
Closed

Warn when distributing unenforceable constraints #222

citus-github-bot opened this issue Feb 4, 2016 · 2 comments
Assignees
Labels

Comments

@citus-github-bot
Copy link

Issue by jasonmp85
Saturday Dec 27, 2014 at 08:15 GMT
Originally opened as citusdata/pg_shard#48


Certain constraints are unenforceable in a distributed setting: UNIQUE indexes foremost among them. pg_shard will happily propagate a UNIQUE index with nary a peep.

The extension should either warn when propagating these constraints or refuse to distribute tables altogether which contain such constraints.

@ozgune
Copy link
Contributor

ozgune commented Feb 8, 2016

@onderkalaci -- did we change this behavior for UPSERT changes? If so, could you document the email thread on this and close this item?

@onderkalaci
Copy link
Member

Yes, we had to change the behaviour for UPSERTs.
The new behaviour is as follows:

  • Allow unique indexes which include partition column for hash and range partitioned tables.
  • Allow unique indexes which include partition column for append partitioned tables with a warning that CitusDB cannot enforce this.
  • Do not allow unique indexes/constraints if the constraint does not include the partition column. Without this check, it would be very likely that UPSERTs lead to wrong results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants