Re: RULE: ON DELETE doesn't stack deletes - Mailing list pgsql-bugs

From Stephan Szabo
Subject Re: RULE: ON DELETE doesn't stack deletes
Date
Msg-id 20021126083446.S77510-100000@megazone23.bigpanda.com
Whole thread Raw
In response to RULE: ON DELETE doesn't stack deletes  (Malcolm Hutty <msah-postgres@hutty.com>)
List pgsql-bugs
On Wed, 20 Nov 2002, Malcolm Hutty wrote:

> According to the manual you can stack multiple queries in a RULE:
>
> CREATE RULE name AS ON event
>      TO object [ WHERE condition ]
>      DO [ INSTEAD ] action
>
> where action can be:
>
> NOTHING
> |
> query
> |
> ( query ; query ... )
> |
> [ query ; query ... ]
>
>
> This seems to work provided 'query' is not "DELETE"; if it is, only
> the first one is executed.

I think it's something like:
delete from v_ab
 turns into something equivalent to the two statements (I don't know
what the actual form of the queries is however)
 delete from a where a_data=ANY(select a_data from v_ab);
 delete from b where b_data=ANY(select b_data from v_ab);

So when the second runs there is no matching rows (having already had all
the a rows deleted).

pgsql-bugs by date:

Previous
From: Rod Taylor
Date:
Subject: Re: RULE: ON DELETE doesn't stack deletes
Next
From: Stephan Szabo
Date:
Subject: Re: [BUGS] Bug #823: upper() does not handle å, ä and ö correctly.