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: support expressions in unique constraints
Postgres does not allow expressions in unique constraints, but it does allow expressions in unique indexes. For now we allow expressions in unique constraints, because we cannot differentiate between a unique constraint and a unique index table definition: they are both parsed into the same struct, `tree.UniqueConstraintTableDef`. In the long term we may want to disallow expression in unique constraints to be consistent with Postgres. We could do this by changing the parser so that `UNIQUE ((a + b))` does not parse successfully. See cockroachdb#65825. Release note: None
- Loading branch information
Showing
2 changed files
with
43 additions
and
10 deletions.
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