Statement and Transaction Timeouts in Postgres and CockroachDB

One of the worst day-to-day things you can do in a database is lock a table or rows for too long. This will cause other requests to wait or fail. In some cases, you will need a DBA to step in and kill the offending session to release the locks. There are three timeouts on Postgres and CockroachDB to help prevent this from happening - statement_timeout - the maximum time a single statement can run.…