X-Original-To: pgsql-docs@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 8075C4758C9 for ; Sun, 13 Apr 2003 19:43:45 -0400 (EDT) Received: from tummy.com (secure.tummy.com [198.49.126.3]) by postgresql.org (Postfix) with ESMTP id BE77D47580B for ; Sun, 13 Apr 2003 19:43:44 -0400 (EDT) Received: (qmail 11326 invoked by uid 10); 13 Apr 2003 23:44:12 -0000 Received: (qmail 28001 invoked by uid 500); 13 Apr 2003 23:43:49 -0000 Date: Sun, 13 Apr 2003 17:43:49 -0600 From: Sean Reifschneider To: pgsql-docs@postgresql.org Subject: Docs patch to note that rules only get run once per query. Message-ID: <20030413234349.GF7507@tummy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Spam-Status: No, hits=-18.4 required=5.0 tests=BAYES_10,PATCH_UNIFIED_DIFF,USER_AGENT_MUTT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/22 X-Sequence-Number: 1748 I've made the following patch to the current CVS docs. This is to explain some confusion I ran into when trying to use rules. After reading the documentation on rules, I was expecting my rule to get run at the end of a query where I deleted multiple rows, not after the first row was deleted, then not any further. I think the below text makes it more clear that this may happen and is not a bug. Sean --- rules.sgml.old 2003-04-13 16:58:27.000000000 -0600 +++ rules.sgml 2003-04-13 17:26:53.000000000 -0600 @@ -32,6 +32,15 @@ linkend="ONG90">. + + + Note that rules are only invoked once per query. This may be a problem + in instances where the rule is updating a table based on another table's + contents, and you do a delete or update that changes multiple rows. In + this case, you will have to use a trigger. + + + The Query Tree -- Do one thing every day that scares you. -- Mary Schmich Sean Reifschneider, Inimitably Superfluous tummy.com, ltd. - Linux Consulting since 1995. Qmail, Python, SysAdmin