Get the latest tech news
Postgres Schema Changes and Locking
Learn how schema changes can cause downtime by locking out reads and writes and how migration tools can avoid it by using lock timeouts, along with backoff and retry strategies.
Migrations that lock a database object for an unacceptable amount of time, causing the application to become unavailable as reads and writes start to fail. Today we're going to talk about the second type of breakage: how long running queries together with DDL statements can lock out reads and writes from a table, causing application downtime. However you make schema changes to your Postgres database, it's important to consider how long running queries together with DDL statements can block reads and writes to a table.
Or read this on Hacker News