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

Add support for Alter Table Add/Drop Constraint #1239

Closed
ozgune opened this issue Feb 18, 2017 · 3 comments
Closed

Add support for Alter Table Add/Drop Constraint #1239

ozgune opened this issue Feb 18, 2017 · 3 comments
Assignees

Comments

@ozgune
Copy link
Contributor

ozgune commented Feb 18, 2017

We currently don't propagate Alter Table Add/Drop Constraint commands to related shards. This feature request came up in a customer conversation; and I'm opening this issue to track it.

ALTER TABLE triggers DROP CONSTRAINT IF EXISTS triggers_pkey;
ERROR: alter table command is currently supported
DETAIL: Only ADD|DROP COLUMN, SET|DROP NOT NULL, SET|DROP DEFAULT and TYPE subcommands are supported.
@ozgune ozgune changed the title Add support for Alter Table Add/Drop Constraint commands Add support for Alter Table Add/Drop Constraint Feb 18, 2017
@velioglu
Copy link
Contributor

I have started coding this issue today. I think, it will take 6 days to implement it.

@saicitus
Copy link

saicitus commented Apr 4, 2017

+1, recently came up in a customer conversation.

In their case, the customer wanted to run ALTER TABLE ADD UNIQUE CONSTRAINT. If we currently don't support this particular syntax (due to checks for having the distribution column as part of the primary key), it could be worth opening a separate issue on this.

As a workaround, we created a UNIQUE INDEX.

@velioglu
Copy link
Contributor

velioglu commented Apr 5, 2017

@saicitus. After the PR will be merged, user can add unique constraint with ALTER TABLE table_name ADD CONSTRAINT constraint_name UNIQUE(column_name(s)). Note that column_name(s) must include the distribution column.

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

No branches or pull requests

4 participants