It is not easy, but at least it is very viable to add not null constraints to Postgres 12+ with minimal locking: - First you add a not null check NOT VALIDATED - Then you add a not null constraint (it will require a full table scan, but with minimal locking) - Afterwards you can remove the unnecessary not null check