3 ms·
The improvements to migrations have been the biggest boon for running even modestly-sized Postgres DBs. It wasn't that long ago that you couldn't add a column
by luhn 1y ago
The improvements to migrations have been the biggest boon for running even modestly-sized Postgres DBs. It wasn't that long ago that you couldn't add a column with a default value without rewriting the whole table, or adding NOT NULL without an exclusive lock while the whole table was scanned. That becomes unfeasible pretty quickly.
- nasretdinov 1y agoDoes adding a default value into a column finally work without locking up an entire table now at least?
- williamdclt 1y agoYes, it has for a few years :) There's almost always non-locking ways to migrate things with Postgres now
- luhn 1y agoLike most ALTER TABLE subcommands, you need an exclusive lock on the table while the catalog is updated. But no table scan or rewrite is required, so that lock is sub-second and can usually be done without disrupting a live application.