sql: Mistakenly disallow UNIQUE WITHOUT INDEX NOT VALID in CREATE TABLE stmt #115352
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
db-cy-23
docs-known-limitation
O-schema-testing
Originated from SQL Schema testing strategies
T-sql-queries
SQL Queries Team
We can add a not valid unique-without-index constraint to a table via
ADD UNIQUE WITHOUT INDEX (cols) NOT VALID
, but we disallow creating a table with a not valid unique-without-index constraint.This is because commit 8dd20ad disallowed add not valid primary and unique constraint (with the intention of index-backed-unique constraint). Unique-without-index is not backed by any index and we should allow it. Just like any other not valid constraint (e.g. check, FK) in create table in that same commit, the NOT VALID part will be dropped and is treated as a normal unique-without-index.
Jira issue: CRDB-33992
Epic CRDB-30346
The text was updated successfully, but these errors were encountered: