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 2EEBD9DC984 for ; Wed, 8 Mar 2006 19:04:20 -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 87921-05 for ; Wed, 8 Mar 2006 19:04:21 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web54308.mail.yahoo.com (web54308.mail.yahoo.com [206.190.49.118]) by postgresql.org (Postfix) with SMTP id DD2BA9DC9EC for ; Wed, 8 Mar 2006 19:04:16 -0400 (AST) Received: (qmail 53925 invoked by uid 60001); 8 Mar 2006 23:04:19 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=irjqBVGdvGK2goCH5TaDvTfu9RQE044l14zjIPuiPfBWbuK/D46CkE1nWZd6UCfI/4s1B3AWEa9Ta9zVvSyEIS7u/bvSt9cO2pIfeRSgh3jdeNGmcgTjj9PybHrn0K+5dvGneAOxREN+5XcN5CxglWhRbzyg5wj5rL9+MmdZH3E= ; Message-ID: <20060308230419.53923.qmail@web54308.mail.yahoo.com> Received: from [68.54.4.83] by web54308.mail.yahoo.com via HTTP; Wed, 08 Mar 2006 15:04:18 PST Date: Wed, 8 Mar 2006 15:04:18 -0800 (PST) From: chester c young Subject: Re: Is there any way to stop triggers from cycling? To: josh@agliodbs.com, pgsql-sql@postgresql.org In-Reply-To: <200603081358.25185.josh@agliodbs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.919 required=5 tests=[AWL=-0.440, DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_WHOIS=0.879] X-Spam-Score: 0.919 X-Spam-Level: X-Archive-Number: 200603/129 X-Sequence-Number: 24475 trying to do this exlusively in triggers is a forray into folly. take advantage of "instead of" or "do also" rules to create a compound statement before your triggers do their work. (in terms of maintenance and sanity, it's best if a trigger touches only its own record.) as a handsweep example: create view tree_v as select * from tree; grant select, insert, update on tree_v to public; create or replace rule 'tree_update' as on update to tree_v do instead( -- update tree set seq = seq+1 where old.pnt=new.pnt and old.seq