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

sql: add support for IF NOT EXISTS for ALTER TABLE ADD CONSTRAINT #53095

Closed

Conversation

ekalinin
Copy link
Contributor

Fixes #53007

This commit adds the option IF NOT EXISTS to the ALTER TABLE ADD CONSTRAINT. With this option pgcode.DuplicateObject will not be raised.

Release note (sql change): Add support for IF NOT EXISTS option for
ALTER TABLE ADD CONSTRAINT command.

This commit adds the option `IF NOT EXISTS` to the `ALTER TABLE ADD
CONSTRAINT`. With this option pgcode.DuplicateObject will not be raised.

Release note (sql change): Add support for `IF NOT EXISTS` option for
`ALTER TABLE ADD CONSTRAINT` command.
@blathers-crl
Copy link

blathers-crl bot commented Aug 19, 2020

Thank you for contributing to CockroachDB. Please ensure you have followed the guidelines for creating a PR.

My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI.

I have added a few people who may be able to assist in reviewing:

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@blathers-crl blathers-crl bot added O-community Originated from the community X-blathers-triaged blathers was able to find an owner labels Aug 19, 2020
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@rohany
Copy link
Contributor

rohany commented Aug 20, 2020

I'm hesitant to accept this because of my concern on the issue. I'll review it once we come to a conclusion there

@tbg tbg added the X-noremind Bots won't notify about PRs with X-noremind label May 6, 2021
@ajwerner
Copy link
Contributor

And 12 months later, I think we're up for this. Let's get @vy-ton to sign off. Any reason not to? The accepted workaround in postgres is to drop in plpgsql which isn't something we can do at this point. @ekalinin are you up for rebasing this?

@vy-ton
Copy link
Contributor

vy-ton commented Sep 28, 2021

+1 to adding this, thanks for the contribution!

@ekalinin
Copy link
Contributor Author

ekalinin commented Oct 1, 2021

And 12 months later, I think we're up for this. Let's get @vy-ton to sign off. Any reason not to? The accepted workaround in postgres is to drop in plpgsql which isn't something we can do at this point. @ekalinin are you up for rebasing this?

Sure, will do it!

@blathers-crl
Copy link

blathers-crl bot commented Oct 8, 2021

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • We notice you have more than one commit in your PR. We try break logical changes into separate commits, but commits such as "fix typo" or "address review commits" should be squashed into one commit and pushed with --force
  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

2 similar comments
@blathers-crl
Copy link

blathers-crl bot commented Oct 8, 2021

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • We notice you have more than one commit in your PR. We try break logical changes into separate commits, but commits such as "fix typo" or "address review commits" should be squashed into one commit and pushed with --force
  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@blathers-crl
Copy link

blathers-crl bot commented Oct 8, 2021

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • We notice you have more than one commit in your PR. We try break logical changes into separate commits, but commits such as "fix typo" or "address review commits" should be squashed into one commit and pushed with --force
  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@ekalinin ekalinin force-pushed the add-alter-table-not-exists branch from bf916c9 to 23b824a Compare October 8, 2021 14:11
@blathers-crl
Copy link

blathers-crl bot commented Oct 8, 2021

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • We notice you have more than one commit in your PR. We try break logical changes into separate commits, but commits such as "fix typo" or "address review commits" should be squashed into one commit and pushed with --force
  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@ekalinin ekalinin force-pushed the add-alter-table-not-exists branch from 23b824a to fbf5cfc Compare October 8, 2021 14:20
@blathers-crl
Copy link

blathers-crl bot commented Oct 8, 2021

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • We notice you have more than one commit in your PR. We try break logical changes into separate commits, but commits such as "fix typo" or "address review commits" should be squashed into one commit and pushed with --force
  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@ekalinin
Copy link
Contributor Author

ekalinin commented Oct 9, 2021

There's a better PR (#71257) for the original issue.
I think it would be better to continue work in there.

@ekalinin ekalinin closed this Oct 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-community Originated from the community X-blathers-triaged blathers was able to find an owner X-noremind Bots won't notify about PRs with X-noremind
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add syntax for to use "IF NOT EXISTS" modifier to "ALTER TABLE add CONSTRAINT"
6 participants