Skip site navigation (1) Skip section navigation (2)

Re: Deadlocks ?

From: Tino Schwarze <postgresql(at)tisc(dot)de>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Deadlocks ?
Date: 2008-05-13 19:30:48
Message-ID: 20080513193048.GA15701@easy2.in-chemnitz.de (view raw or flat)
Thread:
Lists: pgsql-admin
On Tue, May 13, 2008 at 01:18:24PM -0600, kevin kempter wrote:

> we seem to be getting deadlock quite a lot. We have a python process  
> that does the following and we keep getting deadlocks. Is this a real  
> deadlock or maybe a wait condition? Any help in debugging / resolving  
> this would be much appreciated.

An easy way to avoid deadlocks is to lock tables always in the same
order. 

> cursor.execute("lock player_log_uuid in share update exclusive mode")
> 
> 
> >Traceback (most recent call last):
> >  File "StatsParser.py", line 740, in InsertData
> >    cursor.execute("lock player_log_uuid in share update exclusive  
> >mode")
> >ProgrammingError: deadlock detected
> >DETAIL:  Process 23098 waits for ShareUpdateExclusiveLock on  
> >relation 428126 of database 427376; blocked by process 23916.
> >Process 23916 waits for ShareLock on transaction 46802680; blocked  
> >by process 23098.

I've never figured out how to resolve the "lock on transaction" to
something understandable...

HTH,

Tino.

-- 
"What we resist, persists." (Zen saying)

www.craniosacralzentrum.de
www.forteego.de

In response to

  • Deadlocks ? at 2008-05-13 19:18:24 from kevin kempter

Responses

pgsql-admin by date

Next:From: Tom LaneDate: 2008-05-13 23:00:28
Subject: Re: Deadlocks ?
Previous:From: kevin kempterDate: 2008-05-13 19:18:24
Subject: Deadlocks ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group