Re: Delete rule chain stops unexpectedly

From: Wiebe Cazemier <halfgaar(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Delete rule chain stops unexpectedly
Date: 2005-10-21 15:01:48
Message-ID: 435902DC.3000807@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tom Lane wrote:
> The rule that actually deletes the rows from the underlying has to fire
> last, since the rows are gone from the 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".

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message krishnaa sridharan 2005-10-21 15:24:11 SQL language
Previous Message Tom Lane 2005-10-21 14:42:52 Re: Delete rule chain stops unexpectedly