Skip site navigation (1) Skip section navigation (2)

Re: can't delete record from second table in rules of view with join select

From: Sergey Burladyan <eshkinkot(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: can't delete record from second table in rules of view with join select
Date: 2008-03-25 11:57:55
Message-ID: 200803251457.55714.eshkinkot@gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
Hello, all

> not important, is it one rule like:
> create rule v_del as on delete to v do instead (
>        delete from o1 where id = old.o1_id;
>        delete from o2 where id = old.o2_id;
> );
> 
> or split into two rule like:
> create rule v_del1 as on delete to v do instead (
>        delete from o1 where id = old.o1_id;
> );
> create rule v_del2 as on delete to v do instead (
>        delete from o2 where id = old.o2_id;
> );

Sorry, after thinking some time about this problem now i may be understand what going on there... %)

When first rule was exec - no OLD row anymore in "v" view, nothing will be joined and in second rule
OLD value is empty... so my question is changed to: is this expected behavior or a bug ? %)

---

In response to

Responses

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2008-03-25 13:04:55
Subject: Re: why provide cross type arithmetic operators
Previous:From: Alvaro HerreraDate: 2008-03-25 11:55:00
Subject: Re: BUG: PG do not use index

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group