This only applies to Postgres versions < 11. See https://blog.2ndquadrant.com/add-new-table-column-default-va... which was released after this article was written.
It made me curious, since the solution is so simple and fairly obvious, and it covers a common use case. How come it’s taken so long to be implemented? Similarly, it wasn’t added in oracle until version 11, so I must be missing something
do a normal update, concurrently add a conditional `where ... is null` index, repeat in a loop (begin transaction, normal update, add constraint, commit) until it stops failing.
This will still take a lock, but thanks to most rows already updated and because of the conditional index, the lock will only last a very short amount of time.