Re: Delete rule chain stops unexpectedly - Mailing list pgsql-sql

From Wiebe Cazemier
Subject Re: Delete rule chain stops unexpectedly
Date
Msg-id 435902DC.3000807@gmail.com
Whole thread Raw
In response to Re: Delete rule chain stops unexpectedly  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Delete rule chain stops unexpectedly  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Tom Lane wrote:> The rule that actually deletes the rows from the underlying has to fire> last, since the rows are gone
fromthe view (and hence from OLD) the> moment you delete them.
 

A quote from the postgresql manual:

"But for ON UPDATE and ON DELETE rules, the original query is done after the 
actions added by rules. This ensures that the actions can see the to-be-updated 
or to-be-deleted rows"

So, the actual delete should be done after all the rules. And even if it does 
delete before anything else, that does not explain why "step2" is not inserted 
into the debuglog table. Or, that all the rules _are_ executed when I call the 
query with "explain analayze".


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Delete rule chain stops unexpectedly
Next
From: Tom Lane
Date:
Subject: Re: Delete rule chain stops unexpectedly