-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: run check constraint mutations and validation by schema changer
This change moves check constraint adds and drops through the schema changer when the transaction commits, moving the constraint through the same intermediate states as when index/columns are added or dropped. The only small differences are: - Constraint adds can start in write-only and immediately start being enforced if all used columns are in write-only or public. - Constraint drops can move immediately from public to absent if they have not yet been validated. Therefore, the check constraint is no longer immediately public when it is added, but allows data validation of the constraint to be performed when the constraint is added (and is now the default behaviour). Constraints can now also be added on columns in the process of being added. This change also ensures that there are no data anomalies in either versions of the schema when dropping a validated check constraint, as previously the transition moved the constraint from public -> absent. Writes on the new version were not being checked even though nodes on an older version expect all rows to conform to the constraint. Release note (sql change): Check constraint adds by default will validate table data with the added constraint asynchronously after the transaction commits.
- Loading branch information
Erik Trinh
committed
Dec 19, 2018
1 parent
66c50ae
commit cb6ba5c
Showing
20 changed files
with
1,331 additions
and
581 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
Oops, something went wrong.