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.
--- 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 @@
+ 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.
<Title>The Query Tree</Title>
Do one thing every day that scares you.
-- Mary Schmich
Sean Reifschneider, Inimitably Superfluous <jafo(at)tummy(dot)com>
tummy.com, ltd. - Linux Consulting since 1995. Qmail, Python, SysAdmin
pgsql-docs by date
|Next:||From: Tom Lane||Date: 2003-04-14 03:47:32|
|Subject: Re: Docs patch to note that rules only get run once per query. |
|Previous:||From: Tom Lane||Date: 2003-04-12 04:16:18|
|Subject: Re: 6.8.5: Location of CURRENT_DATE unclear |