forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: disallow partial unique constraints in ALTER TABLE
Previously, a `WHERE` clause in `ALTER TABLE .. ADD CONSTRAINT .. UNIQUE` statements was parsed successfully but ignored so that the resulting unique constraint was not partial. This commit disallows the `WHERE` clause. Postgres allows partial unique indexes, but not partial unique constraints, so we will likely remove support for partial unique constraints in `CREATE TABLE` statements in an upcoming major release. See discussion in cockroachdb#65825. Fixes cockroachdb#67234 Release note (bug fix/sql change): A bug was identified that created non-partial unique constraints when a user attempted to create a partial unique constraint in `ALTER TABLE` statements. Creating partial unique constraints in `ALTER TABLE` is now disallowed. A partial unique index can be created instead with `CREATE UNIQUE INDEX .. WHERE`.
- Loading branch information
Showing
4 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters