Обсуждение: Re: Updateable Views?

Поиск
Список
Период
Сортировка

Re: Updateable Views?

От
Greg Stark
Дата:
"Scott Marlowe" <smarlowe@qwest.net> writes:

> On Tue, 2004-08-03 at 13:05, CSN wrote:
> > Just wondering, is updateable views slated for a
> > future version of Postgresql? In addition to using
> > rules that is.
> 
> I would think that a basic fleshing out of the logic with some kind of
> stored proc to make the views and triggers would likely get someone
> started on the backend work.  You know, a proof of concept thingy.

I have some fears here. It seems everyone's first thought when they think
about updateable views is to think about constructing rules on the views.

How would that approach help with inline views? Things like:
UPDATE (SELECT a+b AS x, c AS y FROM foo) SET c=1 WHERE x = 10

It seems like starting with these types of views in the backend would be more
productive than implementing something in rules. Once postgres can handle
inline views it should be trivial to handle persistent views just like they're
handled on selects.

-- 
greg



Re: Updateable Views?

От
Jonathan Gardner
Дата:
On Tuesday 03 August 2004 08:38 pm, Greg Stark wrote:
> "Scott Marlowe" <smarlowe@qwest.net> writes:
> > On Tue, 2004-08-03 at 13:05, CSN wrote:
> > > Just wondering, is updateable views slated for a
> > > future version of Postgresql? In addition to using
> > > rules that is.
> >
> > I would think that a basic fleshing out of the logic with some kind of
> > stored proc to make the views and triggers would likely get someone
> > started on the backend work.  You know, a proof of concept thingy.
>
> I have some fears here. It seems everyone's first thought when they think
> about updateable views is to think about constructing rules on the views.
>
> How would that approach help with inline views? Things like:
>
>  UPDATE (SELECT a+b AS x, c AS y FROM foo) SET c=1 WHERE x = 10
>
> It seems like starting with these types of views in the backend would be
> more productive than implementing something in rules. Once postgres can
> handle inline views it should be trivial to handle persistent views just
> like they're handled on selects.

I think you are putting the cart before the horse. We have to get things 
working and get the rules figured out before we can start modifying the 
backend. Once we get it all figured out, implemented, tested, and debugged, 
then maybe we can start considering modifying the backend.

-- 
Jonathan Gardner
jgardner@jonathangardner.net


Re: Updateable Views?

От
Jan Wieck
Дата:
On 8/3/2004 11:38 PM, Greg Stark wrote:

> "Scott Marlowe" <smarlowe@qwest.net> writes:
> 
>> On Tue, 2004-08-03 at 13:05, CSN wrote:
>> > Just wondering, is updateable views slated for a
>> > future version of Postgresql? In addition to using
>> > rules that is.
>> 
>> I would think that a basic fleshing out of the logic with some kind of
>> stored proc to make the views and triggers would likely get someone
>> started on the backend work.  You know, a proof of concept thingy.
> 
> I have some fears here. It seems everyone's first thought when they think
> about updateable views is to think about constructing rules on the views.
> 
> How would that approach help with inline views? Things like:
> 
>  UPDATE (SELECT a+b AS x, c AS y FROM foo) SET c=1 WHERE x = 10

There is no such thing as an "inline view". What you show here is a 
subselect, and I have not heard of "updatable subselects" yet. Could you 
point me to the section in the ANSI SQL specifications that describes 
this feature please?


Jan

> 
> It seems like starting with these types of views in the backend would be more
> productive than implementing something in rules. Once postgres can handle
> inline views it should be trivial to handle persistent views just like they're
> handled on selects.
> 


-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #


Re: Updateable Views?

От
Manfred Koizar
Дата:
On Sat, 07 Aug 2004 10:24:34 -0400, Jan Wieck <JanWieck@Yahoo.com>
wrote:
>I have not heard of "updatable subselects" yet.


http://asktom.oracle.com/pls/ask/f?p=4950:8:6693556430011788783::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:273215737113,

| Here we update a join. [...]
| scott@ORA734.WORLD> update
|   2    ( select columnName, value
|   3        from name, lookup
|   4       where name.keyname = lookup.keyname
|   5         and lookup.otherColumn = :other_value )
|   6     set columnName = value
|   7  /

Google fororacle "delete statement" syntax
ororacle "update statement" syntax

ServusManfred