Re: deadlock detected - Mailing list pgsql-general

From Richard Huxton
Subject Re: deadlock detected
Date
Msg-id 50980D86.7040203@archonet.com
Whole thread Raw
In response to deadlock detected  (AI Rumman <rummandba@gmail.com>)
Responses Re: deadlock detected
List pgsql-general
On 05/11/12 18:39, AI Rumman wrote:
> Hi all,
>
> I am using Postrgesql 9.1
>
> I got a message in my log:
> ERROR:  deadlock detected
> DETAIL:  Process 20265 waits for ShareLock on transaction 27774015;
> blocked by process 20262.
>         Process 20262 waits for ShareLock on transaction 27774018;
> blocked by process 20265.
>         Process 20265: UPDATE t1 SET product_id = 1017966 WHERE
> ticketid = '2170501'
>         Process 20262: UPDATE c1 SET deleted=1 WHERE id='2170501'
> HINT:  See server log for query details.
> STATEMENT:  UPDATE t1 SET product_id = 1017966 WHERE ticketid = '2170501'
>
> How may I get more information about this deadlock like which queries
> created it.
>
The error message shows which queries - your two UPDATEs. I'm guessing
either t1 or c1 are views and so refer to the same row with id "2710501".

--
   Richard Huxton



pgsql-general by date:

Previous
From: AI Rumman
Date:
Subject: deadlock detected
Next
From: Tom Lane
Date:
Subject: Re: Problem with heap_form_tuple error