I am looking for help in debugging a deadlock situation that
occurs intermittently. I am aware of queries that I can use against system
tables/views such as pg_locks and pg_stat_activity to get good information
about current process statements and locks. However, by the time postgresql
reports deadlock detection, the deadlock loser has already been selected and the
deadlock has been resolved. Thus, the locks that caused the deadlock are now
released. Is there any way to get complete statement/lock information
as of the time of deadlock, before postgresql resolves the deadlock? The current
log for deadlock reports the last statement for both processes, but not the granted
locks for the processes that caused those statements to deadlock. Thanks, Greg
Burcher |