4 ms·
Postgres has been able to safely add a not-null column with a default since version 11 (2018). https://www.postgresql.org/about/news/postgresql-11-released-189
by bpicolo 4y ago
Postgres has been able to safely add a not-null column with a default since version 11 (2018).
https://www.postgresql.org/about/news/postgresql-11-released-1894/ https://www.postgresql.org/about/news/postgresql-11-released...
- true_religion 4y agoIsn't that painfully slow in production? Or is that a mistake on my part?
- scrollaway 4y agoYou might be thinking of older postgres. See this SO: https://dba.stackexchange.com/a/211222 https://dba.stackexchange.com/a/211222
- latch 4y agoSome migrations are non-trivial and might take hours or days (e.g. they could involve hitting external services, or might require manual work). Sure you can default these, but `null` is probably semantically correct in most cases