Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id CC1842E003A for ; Tue, 13 May 2008 16:30:56 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 08546-08 for ; Tue, 13 May 2008 16:30:49 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from easy2.in-chemnitz.de (easy2.in-chemnitz.de [88.198.17.232]) by developer.postgresql.org (Postfix) with ESMTP id C62612E0037 for ; Tue, 13 May 2008 16:30:51 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by easy2.in-chemnitz.de (Postfix) with ESMTP id D0757470007 for ; Tue, 13 May 2008 21:30:48 +0200 (CEST) Received: from easy2.in-chemnitz.de ([127.0.0.1]) by localhost (easy.in-chemnitz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TBZP15inDxcR for ; Tue, 13 May 2008 21:30:48 +0200 (CEST) Received: by easy2.in-chemnitz.de (Postfix, from userid 1013) id BE06D470001; Tue, 13 May 2008 21:30:48 +0200 (CEST) Date: Tue, 13 May 2008 21:30:48 +0200 From: Tino Schwarze To: pgsql-admin@postgresql.org Subject: Re: Deadlocks ? Message-ID: <20080513193048.GA15701@easy2.in-chemnitz.de> References: <8490DCB9-7D9B-47E5-B5A6-A0FD52C30C59@kevinkempterllc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8490DCB9-7D9B-47E5-B5A6-A0FD52C30C59@kevinkempterllc.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/112 X-Sequence-Number: 29196 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