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 221459DC818 for ; Thu, 9 Mar 2006 10:04:50 -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 69560-09 for ; Thu, 9 Mar 2006 10:04:53 -0400 (AST) X-Greylist: delayed 00:46:04.171338 by SQLgrey- Received: from server114.midphase.com (server114.midphase.com [66.225.255.59]) by postgresql.org (Postfix) with ESMTP id 9AA809DC816 for ; Thu, 9 Mar 2006 10:04:47 -0400 (AST) Received: from [200.161.74.107] (helo=Pragya01) by server114.midphase.com with smtp (Exim 4.52) id 1FHLlR-0006zA-3h; Thu, 09 Mar 2006 08:05:13 -0600 From: =?iso-8859-1?Q?Fl=E1vio_Suguimoto?= To: "Alvaro Herrera" Cc: Subject: Re: Problems with disabling triggers in Postgres 7.3.9 Date: Thu, 9 Mar 2006 11:04:44 -0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Importance: Normal In-Reply-To: <20060309135557.GA5489@surnet.cl> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server114.midphase.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - pragyatechnologies.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200603/137 X-Sequence-Number: 24483 Thanks Alvaro, I know that is a hack but i don't have (that i know) other way to disable a trigger. The reason that i need to disable is that trigger will be called recursively. Let explain better my case, the trigger that i sent the code is called after inserts in table participation but itself insert 3 more records in the participation table. If i don't disable the trigger it will be calling recursively... There is another walk-around to avoi it? regards, Flávio Suguimoto -----Original Message----- From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Alvaro Herrera Sent: Thursday, March 09, 2006 10:56 AM To: Flávio Suguimoto Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] Problems with disabling triggers in Postgres 7.3.9 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. ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq