Re:The problem with MySQL foreign key constraints in Online ...
by cwillu on Wednesday February 12, 2025 @10:53PM
(#43032499)
“After that, a VALIDATE CONSTRAINT command can be issued to verify that existing rows satisfy the constraint. The validation step does not need to lock out concurrent updates, since it knows that other transactions will be enforcing the constraint for rows that they insert or update; only pre-existing rows need to be checked. Hence, validation acquires only a SHARE UPDATE EXCLUSIVE lock on the table being altered. (If the constraint is a foreign key then a ROW SHARE lock is also required on the table referenced by the constraint.) ”
--https://www.postgresql.org/docs/current/sql-altertable.html
I am asking out of curiosity, as I have used pt online schema change extensively before, but am right now working mostly with postgres