Re: deadlock error messages

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: dan chak <chak(at)MIT(dot)EDU>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: deadlock error messages
Date: 2008-03-21 16:33:05
Message-ID: 47E3E341.4020901@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

dan chak wrote:
>
> What would be really great would be to know what the other query is,
> as opposed to just the pid (not sure from this output if it's 4483 or
> 29245). Also not sure if this is the right list for this. But
> potentially someone on here may have a good tip on debugging deadlocking?
>
Just logging the other query would be a nasty information disclosure
problem.

Process blah waits for sharelock on transaction blah blocked by process blah
Context: sql statement "update passwords set password = 'kitty' where
user = 'dummy'"
Blocking sql statement: "update passwords set password = 'woof' where
user 'dummy'"

Ouch.

What could be more securely done, though, would be to issue a NOTICE on
the backend on which the deadlocking transaction not killed is running
that includes the backend pid and the problem statement. Your later log
analysis could then match up the statements from the separate log
records. Including the transaction IDs of both in both log lines would
be nice too, as pids get reused.

Sound sane?

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-03-21 16:34:29 Re: MySQL to Postgres question
Previous Message Steve Clark 2008-03-21 16:30:59 Re: ecpg program getting stuck