Tobias T–

Get back to Notes expressing the moment

Comment I've been there in…

I've been there in the past: a new column had to be added to a database table, it should have a default value and it should not be allowed to have a null value. As larger the table is, the more reluctant I have been to add it.

With PostgreSQL 11 this seems to be a thing of the past:

Many other useful performance improvements, including making ALTER TABLE .. ADD COLUMN with a non-null column default faster

Want to know some details about this feature and why it's important? Brandur can explain this much better then I could:

One of the biggest reasons to prefer relational databases over document stores and other less sophisticated storage technology is data integrity. […] With a good schema design you can rest assured that your data is in a high quality state because the very database is ensuring it. […] Enthusiasts like me have always argued in favor of strong data constraints, but knew also that new non nullable fields often weren’t possible in Postgres when it was running at scale.