Re: Updateable Views?

Lists: pgsql-generalpgsql-hackers
From: CSN <cool_screen_name90001(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Updateable Views?
Date: 2004-08-03 19:05:36
Message-ID: 20040803190536.48851.qmail@web52910.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers


Just wondering, is updateable views slated for a
future version of Postgresql? In addition to using
rules that is.

CSN


__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: CSN <cool_screen_name90001(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Updateable Views?
Date: 2004-08-04 02:40:23
Message-ID: 200408040240.i742eNA11491@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

CSN wrote:
>
> Just wondering, is updateable views slated for a
> future version of Postgresql? In addition to using
> rules that is.

Yes, I think some folks are working on it for the next release.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: "Scott Marlowe" <smarlowe(at)qwest(dot)net>
To: "CSN" <cool_screen_name90001(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Updateable Views?
Date: 2004-08-04 02:51:45
Message-ID: 1091587905.27166.119.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

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.

It's on the todo list. Of course, the just means someone someday should
do it, but it's not on anybody's personal todo list that I know of.

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.


From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Updateable Views?
Date: 2004-08-04 03:38:48
Message-ID: 873c33mv1z.fsf_-_@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers


"Scott Marlowe" <smarlowe(at)qwest(dot)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


From: Bernd Helmle <mailings(at)oopsware(dot)de>
To: Scott Marlowe <smarlowe(at)qwest(dot)net>
Cc: pgsql-general(at)postgresql(dot)org, CSN <cool_screen_name90001(at)yahoo(dot)com>
Subject: Re: Updateable Views?
Date: 2004-08-04 09:21:59
Message-ID: B0AEBB65BB334101085B67AF@sparkey.oopsware.intra
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

--On Dienstag, August 03, 2004 20:51:45 -0600 Scott Marlowe
<smarlowe(at)qwest(dot)net> wrote:

> 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.
>
> It's on the todo list. Of course, the just means someone someday should
> do it, but it's not on anybody's personal todo list that I know of.
>

No, its on mine :)

> 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.
>

That's exactly what i'm working on. Currently I have a stored procedure
pg_create_view_updrule() that takes the OID of the view _RETURN rule and
forms
an INSERT rule from it (DELETE/UPDATE are not yet implemented). To get down
the query trees is a bit complex, but it seems to work right now, although
there's many i have to do in the next days.....i will post as soon as I
have a working proof-of-concept. Please note that i'm heading for
SQL92-compliance, SQL99 seems a todo for the next-generation.

Bernd


From: Jonathan Gardner <jgardner(at)jonathangardner(dot)net>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Updateable Views?
Date: 2004-08-04 20:47:38
Message-ID: 200408041347.38635.jgardner@jonathangardner.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

On Tuesday 03 August 2004 08:38 pm, Greg Stark wrote:
> "Scott Marlowe" <smarlowe(at)qwest(dot)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(at)jonathangardner(dot)net


From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Updateable Views?
Date: 2004-08-07 14:24:34
Message-ID: 4114E622.7070306@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

On 8/3/2004 11:38 PM, Greg Stark wrote:

> "Scott Marlowe" <smarlowe(at)qwest(dot)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(at)Yahoo(dot)com #


From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Updateable Views?
Date: 2004-08-10 00:13:33
Message-ID: sq2gh0dped68u8boc7r5dv25n6en8pf3r4@email.aon.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

On Sat, 07 Aug 2004 10:24:34 -0400, Jan Wieck <JanWieck(at)Yahoo(dot)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(at)ORA734(dot)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 for
oracle "delete statement" syntax
or
oracle "update statement" syntax

Servus
Manfred