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

Request: Multi-column constraints #40

Open
wnortje opened this issue Oct 7, 2015 · 3 comments
Open

Request: Multi-column constraints #40

wnortje opened this issue Oct 7, 2015 · 3 comments
Assignees
Milestone

Comments

@wnortje
Copy link
Contributor

wnortje commented Oct 7, 2015

Please add support for multi-column constraints such as

CONSTRAINT "constraint_name" UNIQUE ("col1" , "col2", "col3")
@eudoxia0
Copy link
Owner

eudoxia0 commented Nov 1, 2015

What is the advantage of this over the present system, aside from terseness?

@wnortje
Copy link
Contributor Author

wnortje commented Nov 2, 2015

The constraint means the combination of the named columns must be unique. I.e. in each of the named columns there may be non-unique entries as long as the combination remains unique.

With the present system you can only specify the unique constraint on a single column at a time, which will not allow any duplicates in any of the named columns.

@eudoxia0 eudoxia0 self-assigned this Jan 7, 2016
@eudoxia0 eudoxia0 added this to the Crane v1.0 milestone Jan 7, 2016
@eudoxia0
Copy link
Owner

eudoxia0 commented Jan 7, 2016

I've thought about this.

I think the deftable form should have an extra section :constraints for specifying multi-column UNIQUE constraints and possibly other extensions.

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

No branches or pull requests

2 participants