public inbox for [email protected]  
help / color / mirror / Atom feed
From: Sean Reifschneider <[email protected]>
To: Tom Lane <[email protected]>
Cc: [email protected]
Subject: Re: Docs patch to note that rules only get run once per query.
Date: Sun, 13 Apr 2003 21:58:29 -0600
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>

On Sun, Apr 13, 2003 at 11:47:32PM -0400, Tom Lane wrote:
>Sean Reifschneider <[email protected]> writes:
>> I've made the following patch to the current CVS docs.
>
>> +  Note that rules are only invoked once per query.
>
><<itch>> This still seems like a serious oversimplification or
>misexplanation to me.  It's true that a rule creates only one new query
>to execute alongside each user-supplied query --- but that additional
>query can execute upon many individual rows.  So I feel dissatisfied
>with the above "clarification".  Can you think of another way to explain
>it?

Unfortunately, I really don't understand it...  My first thought was
that it was a bug, but when I presented it to the bugs list they said
that the rule only gets executed once per query and that triggers should
be used if you want to run on every impacted row.

Perhaps this re-wording make is more clear?

<Note>
 <Para>
  Note that rules are only invoked once per query.  This may be a problem
  in instances where the rule is updating table A based on table B's
  contents.  If you do a multi-row delete on B, the rule may get run
  only after the delete of the first row, not after all deletes finish.
  In this case, you will have to use a trigger.
 </Para>
</Note>

Sean
-- 
 *** Quits: TITANIC (Excess Flood)
Sean Reifschneider, Inimitably Superfluous <[email protected]>
tummy.com, ltd. - Linux Consulting since 1995.  Qmail, Python, SysAdmin
      Back off man. I'm a scientist.   http://HackingSociety.org/




view thread (7+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Docs patch to note that rules only get run once per query.
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox