Re: WIP: Automatic view update rules

From: Bernd Helmle <mailings(at)oopsware(dot)de>
To: Bernd Helmle <bernd(at)oopsware(dot)de>, Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WIP: Automatic view update rules
Date: 2009-01-09 12:20:57
Message-ID: E8182FB470BA1207E6A8838D@teje
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

--On Sonntag, Dezember 28, 2008 15:29:58 +0100 Bernd Helmle
<bernd(at)oopsware(dot)de> wrote:

>> maybe the better solution is to not allow such a view to be updatable
>>
>
> Yes, it seems we have to check for target lists having negative attnums in
> checkTree(). Another solution would be to simply ignore those columns
> (extract them from the target list and include all updatable columns
> only).

While looking at this it turned out that the problem of updatability is
more complex than
i originally thought: Consider a relation tree of the following
views/relations:

View1 -> View2 -> View3 -> Table1

That means, View1 consists of View2 and so on. What happens now if someone
is going to change View3, so that it's not updatable anymore? What the
patch actually does is, scanning all relations/views involved in a current
view (and cascading updates) und reject update rules as soon as it finds
more than one relation within a view definition. Unfortunately this seems
not to be enough, we had really check all involved views for updatability
recursively. The infrastructure for this is already there, but i wonder if
it could be made easier when we are going to maintain a separate
is_updatable flag somewhere in the catalog, which would make checking the
relation tree for updatability more easier.

Comments?

--
Thanks

Bernd

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-01-09 12:21:39 Re: Hot standby, slot ids and stuff
Previous Message Heikki Linnakangas 2009-01-09 11:49:57 Re: Visibility map and freezing