Re: Updateable views

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Updateable views
Date: 2004-12-27 20:45:08
Message-ID: 22761.1104180308@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Stark <gsstark(at)mit(dot)edu> writes:
> I think you want to extend the SQL syntax to allow updating views, and
> implement plan nodes and executor functionality to handle them. So things
> like this works:

> UPDATE (SELECT id,val FROM t) SET val=0 where id < 100

> Then the rules you create on the views are just like the rules for SELECT,
> they simply mechanically replace the view with the view definition.

> I think this is the right approach because:

> a) I think creating the general rules to transform an update into an update on
> the underlying table will be extremely complex, and you'll only ever be
> able to handle the simplest cases. By handling the view at planning time
> you'll be able to handle arbitrarily complex cases limited only by whether
> you can come up with reasonable semantics.

Please provide an existence proof. I don't really see any basis for the
claim that this will be simpler to implement --- the semantic problems
will be the same either way.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jaime Casanova 2004-12-27 21:11:11 displaying contents
Previous Message Stephen Frost 2004-12-27 20:01:47 Schema permissions inheiritance