From: Bernd Helmle <mailings@oopsware.de>
To: Bernd Helmle <bernd@oopsware.de>
To: Jaime Casanova <jcasanov@systemguards.com.ec>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: WIP: Automatic view update rules
Date: Fri, 09 Jan 2009 13:20:57 +0100
Message-ID: <E8182FB470BA1207E6A8838D@teje> (raw)
In-Reply-To: <61043.91.48.33.48.1230474598.squirrel@tooney.at.xencon.de>
References: <2849137C693B65CC8E86411C@imhotep.credativ.de>
<94CF655A8D0DC7D5B4B81D8B@imhotep.credativ.de>
<603c8f070811112006q906b3a6o59a66228b7fc997@mail.gmail.com>
<7F84532C73CB3279DE8436E0@imhotep.credativ.de>
<603c8f070811131344n5c087057p11f94780dae80885@mail.gmail.com>
<603c8f070811252043r75db3e83v2eba1611452ee62e@mail.gmail.com>
<EB911BE7EC3A7A599A379DEF@teje>
<D0935A35C6F4B274E0CD4DDB@teje>
<3073cc9b0812250943x23547116ud956d8ab111e55bf@mail.gmail.com>
<61043.91.48.33.48.1230474598.squirrel@tooney.at.xencon.de>
--On Sonntag, Dezember 28, 2008 15:29:58 +0100 Bernd Helmle
<bernd@oopsware.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: mailings@oopsware.de, bernd@oopsware.de, jcasanov@systemguards.com.ec, robertmhaas@gmail.com
Subject: Re: WIP: Automatic view update rules
In-Reply-To: <E8182FB470BA1207E6A8838D@teje>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox