Dealing with deadlocks in postgresql
In an ideal production environment, we all would have faced a situation where we get a deadlock from our database. There might be multiple reasons behind your table(s) getting deadlocked. We shall go through couple of scenarios and potential fix to handle deadlock.