How to detect Postgres deadlocks?

From: andre <andre(at)google(dot)com>
To: pgsql-admin(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: How to detect Postgres deadlocks?
Date: 2006-08-23 19:45:56
Message-ID: 6c3954020608231245l3035ffbby41cfdbfac2d37326@mail.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

Hi,

We are using Postgres 7.4.5, and I'm trying to find a way to detect and
gather deadlock information.

1) Which sql queries should I use to detect deadlocks while they are
happening? I see the deadlock info on the log file, but I'd like to query
the database to see them as they happen...

2) Which fields on which pg catalogs indicate a deadlock condition?

3) How can I get more info about the processes involved on deadlocks?

4) How can I get the sql statements associated with the processes involved
on deadlocks?

On the logs I see the procpids of the processes involved on past deadlocks,
but I 'd like to know how to get those procpids, and how to get the
"current_query" associated with them...

Thank you in advance,

Andre Philippi

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Peter Eisentraut 2006-08-23 20:39:22 Re: [GENERAL] How to detect Postgres deadlocks?
Previous Message Joshua D. Drake 2006-08-23 14:59:47 Re: Slow delete/insert.

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2006-08-23 20:31:12 Re: pl/R problem
Previous Message Don Isgitt 2006-08-23 19:44:42 Re: pl/R problem