When Postgres blocks: 7 tips for dealing with locks