pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Aldor <an@mediaroot.de>
To: olly@lfix.co.uk
Cc: pgsql-admin@postgresql.org
Subject: Re: Query failed: ERROR:  deadlock detected
Date: Mon, 29 Aug 2005 18:34:21 +0100
Message-ID: <4313471D.7020404@mediaroot.de> (raw)
In-Reply-To: <1125336357.2589.8.camel@linda>
References: <43132ED4.9000107@mediaroot.de>
	<1125336357.2589.8.camel@linda>

thanks for the explanation... i found the mistake in a new pl/pgsql
function i wrote before this error occured;-)

Oliver Elphick wrote:
> On Mon, 2005-08-29 at 16:50 +0100, Aldor wrote:
> 
>>PostgreSQL 8.0.3: Any idea what this is?
>>
>>---
>>Warning: pg_query(): Query failed: ERROR:  deadlock detected
>>DETAIL:  Process 8835 waits for ShareLock on transaction 193588236;
>>blocked by process 8834.
>>Process 8834 waits for ShareLock on transaction 193588228; blocked by
>>process 8835
>>---
>>
>>I have never seen such a log entry until now.
> 
> 
> You have two transactions locking each other out.
> 
>   For example:
>     trans A:  begin;
>     trans B:  begin;
>     trans A:  select * from table_a for update;    -- locks table_a
>     trans B:  select * from table_b for update;    -- locks table_b
>     trans A:  select * from table_b for update;    -- blocked by trans B's lock
>     trans B:  select * from table_a for update;    -- blocked by trans A's lock
> 
> Since the two transactions are blocking each other, the locks will never
> be released by the transactions that are holding them.  After a preset
> interval (about 1 second by default) a deadlock is detected and reported
> with this error message and one of the transactions is aborted.
> 
> See manual section 12.3.3 in the 8.0 documentation.
> 



view thread (3+ messages)

Message-ID: <4313471D.7020404@mediaroot.de>
Permalink:  ../4313471D.7020404@mediaroot.de/
Also on:    postgresql.org/message-id/4313471D.7020404@mediaroot.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: an@mediaroot.de, olly@lfix.co.uk
  Subject: Re: Query failed: ERROR:  deadlock detected
  In-Reply-To: <4313471D.7020404@mediaroot.de>
  References: <43132ED4.9000107@mediaroot.de> <1125336357.2589.8.camel@linda> <4313471D.7020404@mediaroot.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox