This is such a helpful addition that will help avoid so much downtime. Thank you to the Postgres contributors who made it possible.
Finally, you add the default to the schema which will now be in the millisecond range because all/most rows have a default.
And then you add the not null constraint which will also be in the ms range.
You can do all of this in a transaction too because postgres' Schema modifications are transactional.
This is how I have added countless columns with default values without downtime over the last few years.
create a temporary index covering that column. Then it will be in the range of ms.
With this the re-check for nulls when adding the not null constraint will not take any time at all.
The following query will show dead tuple count for the table: select tuple_count, dead_tuple_count from pgstattuple('table_name');