sql: ADD CONSTRAINT...NOT VALID can be specified for unique constraints even though it is ignored. #59706
Labels
A-sql-pgcompat
Semantic compatibility with PostgreSQL
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
E-easy
Easy issue to tackle, requires little or no CockroachDB experience
E-starter
Might be suitable for a starter project for new employees or team members.
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Actual behavior
In CRDB,
Specifying
NOT VALID
should not enforce the constraint for existing rows untilVALIDATE CONSTRAINT
is called. Here, theNOT VALID
appears to be ignoredExpected behavior
PG only allows specifying
NOT VALID
for check and foreign key constraints. CRDB should either error whenNOT VALID
is used with a unique constraint or defer enforcing the constraint for existing rows.Jira issue: CRDB-3249
The text was updated successfully, but these errors were encountered: