[GENERAL] View's rule on delete problem

2004-10-31 Thread Stanislaw Tristan
CREATE RULE new_rule2 AS ON DELETE TO public.klients_view DO INSTEAD ( DELETE FROM klients WHERE (klients.klient_id = old.klient_id); DELETE FROM klient_services WHERE (klient_services.klient_id = old.klient_id); ); It's 2 commands, but executing only first. Why? Stanislaw Tristan Kyiv,

Re: [GENERAL] View's rule on delete problem

2004-10-31 Thread Tom Lane
Stanislaw Tristan [EMAIL PROTECTED] writes: It's 2 commands, but executing only first. Why? You didn't show us the view, but I suppose it's an inner join of the two tables? As soon as you delete the row from the first table, there's no longer any matching row in the view, so the second command

Re: [GENERAL] View's rule on delete problem

2004-10-31 Thread Michael Fuhr
On Thu, Oct 28, 2004 at 04:32:21AM +0300, Stanislaw Tristan wrote: CREATE RULE new_rule2 AS ON DELETE TO public.klients_view DO INSTEAD ( DELETE FROM klients WHERE (klients.klient_id = old.klient_id); DELETE FROM klient_services WHERE (klient_services.klient_id = old.klient_id); );