cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

sql: support ADD CONSTRAINT ... NOT VALID

Open thoszhang opened this issue 7 years ago • 2 comments

Currently, when a constraint is added, the constraint is not validated for existing rows (see #33550). Postgres's behavior (https://www.postgresql.org/docs/11/sql-altertable.html) is to validate newly added constraints for existing rows by default, unless NOT VALID is specified.

We should first address #33550 to bring ADD CONSTRAINT in line with the default behavior of Postgres, and then add NOT VALID as an option.

thoszhang avatar Jan 07 '19 20:01 thoszhang

This is done for check constraints, in #38382

thoszhang avatar Jun 25 '19 19:06 thoszhang

The FK constraint issue is covered by #38663

tyler314 avatar Jul 11 '19 20:07 tyler314