Sean Reifschneider writes:
> <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>
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
documentation. Read how the references to NEW and OLD are resolved.
Play out the expansion of your example of paper.
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.
--
Peter Eisentraut peter_e@gmx.net