You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add ability to skip validation on postgres FK creation (#244)
Validation on FK constraints in postgres can cause large tables to stay locked for a relatively long time because it has to check all rows for valid data, while also preventing new entries.
Postgres implemented a way to not validate the constraint immediately so the FK can be immediately inserted, improving concurrency, with the intention that a `VALIDATE CONSTRAINT` query will be following.
The validation query uses a less expensive lock, because it only needs to check rows that existed before the constraint. This allows safer migrations, and also allows for users to clean up known violations while still enforcing the constraint for new entries.
This commit implements the ability to skip validation, but it does not implement the validation query.
0 commit comments