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

YugabyteDB doesn't support ALTER TABLE .. DROP CONSTRAINT IF EXISTS #15958

Closed
lukaseder opened this issue Dec 19, 2023 · 3 comments
Closed

YugabyteDB doesn't support ALTER TABLE .. DROP CONSTRAINT IF EXISTS #15958

lukaseder opened this issue Dec 19, 2023 · 3 comments

Comments

@lukaseder
Copy link
Member

Our API claims that YugabyteDB supports ALTER TABLE .. DROP CONSTRAINT IF EXISTS but this isn't the case:
https://docs.yugabyte.com/preview/api/ysql/the-sql-language/statements/ddl_alter_table/

@lukaseder
Copy link
Member Author

This seems to work:

do $$
begin
  alter table "t" drop constraint "x";
exception
  when sqlstate '42704' then null;
end $$

@lukaseder
Copy link
Member Author

We cannot rely on the documentation. Other syntax that works isn't documented either, see:

lukaseder added a commit that referenced this issue Dec 19, 2023
lukaseder added a commit that referenced this issue Dec 19, 2023
lukaseder added a commit that referenced this issue Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant