Re: Attempting to disable count triggers on cleanup - Mailing list pgsql-performance

From hubert depesz lubaczewski
Subject Re: Attempting to disable count triggers on cleanup
Date
Msg-id 20070925112149.GA21433@depesz.com
Whole thread Raw
In response to Attempting to disable count triggers on cleanup  (Dave Cramer <pg@fastcrypt.com>)
Responses Re: Attempting to disable count triggers on cleanup
List pgsql-performance
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".

depesz

--
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA.  here's my CV!" :)
http://www.depesz.com/ - blog dla ciebie (i moje CV)

pgsql-performance by date:

Previous
From: Dave Cramer
Date:
Subject: Attempting to disable count triggers on cleanup
Next
From: Dave Cramer
Date:
Subject: Re: Attempting to disable count triggers on cleanup