Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id B20A89F992B for ; Tue, 25 Sep 2007 08:39:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 45813-08 for ; Tue, 25 Sep 2007 08:39:35 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from beaver.fastcrypt.com (beaver.fastcrypt.com [64.7.141.17]) by postgresql.org (Postfix) with ESMTP id B09AD9F95FD for ; Tue, 25 Sep 2007 08:39:42 -0300 (ADT) Received: from dave-cramers-computer-2.local (dcdsl.ebox.com [64.7.143.116]) by beaver.fastcrypt.com (Postfix) with ESMTP id CD2C21580658; Tue, 25 Sep 2007 07:44:10 -0400 (EDT) Message-ID: <46F8F37E.9060204@fastcrypt.com> Date: Tue, 25 Sep 2007 07:39:42 -0400 From: Dave Cramer Reply-To: pg@fastcrypt.com User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070807) MIME-Version: 1.0 To: depesz@depesz.com CC: postgresql performance list Subject: Re: Attempting to disable count triggers on cleanup References: <46F8EC3A.4040607@fastcrypt.com> <20070925112149.GA21433@depesz.com> In-Reply-To: <20070925112149.GA21433@depesz.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/439 X-Sequence-Number: 26984 hubert depesz lubaczewski wrote: > On Tue, Sep 25, 2007 at 07:08:42AM -0400, Dave Cramer wrote: > >> ERROR: deadlock detected >> DETAIL: Process 23063 waits for ExclusiveLock on tuple (20502,48) of >> relation 48999028 of database 14510214; blocked by process 23110. >> Process 23110 waits for ShareLock on transaction 1427023217; blocked by >> process 23098. >> ... >> CONTEXT: SQL statement "update user_profile_count set >> buddycount=buddycount-1 where user_profile_count.uid= $1 " >> PL/pgSQL function "user_buddy_count" line 11 at SQL statement >> SQL statement "DELETE FROM ONLY "public"."user_buddies" WHERE >> "buddyuserid" = $1" >> > > take a look at: > http://www.depesz.com/index.php/2007/09/12/objects-in-categories-counters-with-triggers/ > > and if you want to temporarily disable trigger, simply do appropriate > "alter table disable trigger". > > Well, that doesn't work inside a transaction I've tried it. This has been fixed in 8.3 Dave > depesz > >