Logging deadlocked statements?

From: "Mason Hale" <masonhale(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Logging deadlocked statements?
Date: 2007-10-16 19:00:17
Message-ID: 8bca3aa10710161200l6ea99fb4m2d2bebf8a54f063@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

We're noticing a number of deadlock errors in our postgres logs.
Along with the errors, there is a single statement logged to give
context to the deadlock.

Is is possible to log all the statements involved in the deadlock?
We're having a hard time detecting these deadlocks when they happen,
and it would help if we knew what other statements were involved.

I know about looking at the pg_locks table, and will do that if we can
catch one of these happening in real time. But I'm most interested in
knowing if I can somehow log all statements involved in a deadlock
when they occur. Is that possible?

thanks in advance,
Mason

Browse pgsql-general by date

  From Date Subject
Next Message jooy 2007-10-16 19:02:49 need help with rebuilding postgresql
Previous Message Stanislav Raskin 2007-10-16 18:53:50 Re: Updating a production database schema from dev server