X-Original-To: pgsql-docs@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D17DB4758F1 for ; Mon, 14 Apr 2003 13:53:24 -0400 (EDT) Received: from tummy.com (secure.tummy.com [198.49.126.3]) by postgresql.org (Postfix) with ESMTP id 9ECEB4758E6 for ; Mon, 14 Apr 2003 13:53:23 -0400 (EDT) Received: (qmail 10046 invoked by uid 10); 14 Apr 2003 17:54:00 -0000 Received: (qmail 20107 invoked by uid 500); 14 Apr 2003 17:53:25 -0000 Date: Mon, 14 Apr 2003 11:53:25 -0600 From: Sean Reifschneider To: Peter Eisentraut Cc: Tom Lane , pgsql-docs@postgresql.org Subject: Re: Docs patch to note that rules only get run once per query. Message-ID: <20030414175325.GK7507@tummy.com> References: <20030414035829.GI7507@tummy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Spam-Status: No, hits=-34.8 required=5.0 tests=BAYES_10,EMAIL_ATTRIBUTION,IN_REP_TO,REFERENCES, REPLY_WITH_QUOTES,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/29 X-Sequence-Number: 1755 On Mon, Apr 14, 2003 at 06:38:16PM +0200, Peter Eisentraut wrote: >This can't possibly be true. Rules are never invoked "after" any deletion >of any row. Take a close look at the examples of update rules in the I'm open to you suggesting a different way of saying the above. I understand that rules aren't really invoked, but that's what I came up with to describe what I was seeing. After a review of my SQL, I made a post to the bugs list about it and the only reply I got was that the problem I was seeing was due to rules only doing their thing once per query. In my case, it seemed like the rule SQL was being executed after the first deletion. This worked fine if I was doing a single deletion, but would muck things up if I was doing a multi-column deletion. A full description including a sample of how to reproduce it is in my original bugs posting, available at: http://archives.postgresql.org/pgsql-bugs/2003-03/msg00098.php >The rule will expand your initial command to a big and ugly set of >commands. But all those commands are applied like any normal command that >you could have entered by hand. So if too few or too many rows are >affected, that's because of the conditions attached to the command. I would welcome a solution. I tried a number of different mechanisms for doing the updates I want using rules, but wasn't able to find one that would do the right thing. Thanks, Sean -- The question of whether a computer can think is no more interesting than the question of whether a submarine can swim." -- Edsgar W. Dijkstra (1930-2002) Sean Reifschneider, Inimitably Superfluous tummy.com, ltd. - Linux Consulting since 1995. Qmail, Python, SysAdmin