AW: deficiency on delete and update instead rules for v iews - Mailing list pgsql-hackers

From Zeugswetter Andreas SB
Subject AW: deficiency on delete and update instead rules for v iews
Date
Msg-id 11C1E6749A55D411A9670001FA68796336813A@sdexcsrv1.f000.d0188.sd.spardat.at
Whole thread Raw
List pgsql-hackers
> >We lack a syntax that would enable us to write an on update/delete do instead rule
> >that would efficiently map an update/delete to a table that  is referenced by a view.
> >
> >Currently the only rule you can implement is one that uses a primary key.
> >This has the disadvantage of needing a self join to find the appropriate rows.
> >
> 
> One of the concepts used in other DBs is to have views with row
> OIDs/DBKeys: ie. views that have one primary table (but maybe have column
> selects, calculations and/or function calls) can still have a real row
> underlying each row. This then allows insert, update & delete to work more
> easily. Doesn't really help now, but it might be useful in a 
> future release.

Imho the functionality inside the backend is probably there since old Postgres 4
could do such rules. That is why I said that syntax is missing.

Btw, the insert is not a problem, the on insert do instead rules are straight forward
to write, at least in the cases where other db's allow an insert on a view. 
(e.g. on insert to test1 do instead insert into test (a,b) values (new.a, new.b); 
where test1 has a few extra calculated columns)

Andreas


pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Re: deficiency on delete and update instead rules for views
Next
From: Don Baccus
Date:
Subject: Re: Please advise features in 7.1