X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 599C59DC886 for ; Thu, 9 Mar 2006 09:55:56 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 69756-06 for ; Thu, 9 Mar 2006 09:55:59 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mx1.surnet.cl (mx1.surnet.cl [216.155.73.180]) by postgresql.org (Postfix) with ESMTP id B51F79DC816 for ; Thu, 9 Mar 2006 09:55:53 -0400 (AST) Received: from unknown (HELO cluster.surnet.cl) ([216.155.73.165]) by mx1.surnet.cl with ESMTP; 09 Mar 2006 10:55:57 -0300 X-IronPort-AV: i="4.02,178,1139194800"; d="scan'208"; a="45301932:sNHT18676332" Received: from alvh.no-ip.org (201.220.123.90) by cluster.surnet.cl (7.0.043) (authenticated as alvherre@surnet.cl) id 43A978FD009B57D1; Thu, 9 Mar 2006 10:55:57 -0300 Received: by alvh.no-ip.org (Postfix, from userid 1000) id 47358C3A2BB; Thu, 9 Mar 2006 10:55:57 -0300 (CLST) Date: Thu, 9 Mar 2006 10:55:57 -0300 From: Alvaro Herrera To: =?iso-8859-1?Q?Fl=E1vio?= Suguimoto Cc: pgsql-sql@postgresql.org Subject: Re: Problems with disabling triggers in Postgres 7.3.9 Message-ID: <20060309135557.GA5489@surnet.cl> Mail-Followup-To: =?iso-8859-1?Q?Fl=E1vio?= Suguimoto , pgsql-sql@postgresql.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.11+cvs20060126 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.713 required=5 tests=[AWL=-0.206, DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_POST=1.44] X-Spam-Score: 1.713 X-Spam-Level: * X-Archive-Number: 200603/136 X-Sequence-Number: 24482 Flávio Suguimoto wrote: > Hi all, > > I have a problem in a trigger that disable all the triggers of a table. This > error occurs randomly and my guess is that occurs when i have a lot of > concurrents inserts in the table participation. > > The error is : RelationBuildTriggers: 2 record(s) not found for rel > participation I don't know what's involved in this particular bug, but the short answer is: don't update system catalogs directly. Have your triggers cope with the situation where you don't want to fire them in certain cases. System catalogs are delicate stuff; there are some caches that must be maintained in a coherent manner. Usually the catalogs do not follow MVCC rules to the letter. The "UPDATE pg_class" was used by pg_dump at some point, but it was only a hack and I wouldn't expect it to work correctly when multiple processes are involved. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.