Re: Rule execution bug - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Rule execution bug
Date
Msg-id 27385.1064515907@sss.pgh.pa.us
Whole thread Raw
In response to Rule execution bug  (Viacheslav N Tararin <taras@dekasoft.com.ua>)
List pgsql-bugs
Viacheslav N Tararin <taras@dekasoft.com.ua> writes:
> For the next schema rule "d_analysis_plan" perform only first DELETE
> statement, second statement not performed.

You did not show us the definition of "analysis_plan", but I'll bet it's
a view joining t_sub_plan and t_account_plan.  If so, this is not a bug.
After the first DELETE, there is no longer anything in the view matching
the id, and so the second DELETE finds nothing to delete.

You might have better luck using ON DELETE CASCADE foreign-key
references to accomplish the results you want.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Postgresql 'eats' all mi data partition
Next
From: Javier Carlos
Date:
Subject: Re: Postgresql 'eats' all mi data partition