How to add a column
Add a column in PostgreSQL safely under load using lock_timeout, retries, DEFAULT and NOT NULL rules, and backfilling.
Add a column in PostgreSQL safely under load using lock_timeout, retries, DEFAULT and NOT NULL rules, and backfilling.
Adding a foreign key (FK) is straightforward:
Heavyweight locks, both relation- and row-level, are acquired by a query and always held until the end of the transaction this query belongs to.
Identify and handle long-running transactions that can impact OLTP system performance
In day 60, we discussed how to add a column and that under load you need low lock_timeout and retries (also see: Zero-downtime Postgres schema migrations need…