Re: Thoughts about updateable views - Mailing list pgsql-hackers

From Bernd Helmle
Subject Re: Thoughts about updateable views
Date
Msg-id DEFE7A13B0BC352715EA9170@sparkey.oopsware.intra
Whole thread Raw
In response to Re: Thoughts about updateable views  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
--On Mittwoch, Dezember 22, 2004 11:25:42 -0500 Tom Lane 
<tgl@sss.pgh.pa.us> wrote:

> Richard Huxton <dev@archonet.com> writes:
>> There are two things (AFAICT) you need to be able to do to update (NOTE
>> - not insert) a view.
>>   1. Identify the underlying table(s) for the updated column(s)
>>   2. Identify (primary) key values for the table(s) being updated.
>> So - I could have a join listing users and how many email aliases they
>> have (so sum()) and still update their name, so long as the key for the
>> users table was present in the view.
>
> No; you'd also have to have some guarantee that a given underlying table
> row gives rise to at most one join row.  If the same table row gives
> rise to multiple join rows, then a request specifying an UPDATE of just
> one of those join rows can't be satisfied.
>

Not sure if i understand correctly, but that means JOINs between 1:n 
relations
falls under the "not updateable" category, because the "parent row" 
triggers updates to n possible "child" rows?




-- 
 Bernd


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: oldish libpq bug still in RC2
Next
From: Tom Lane
Date:
Subject: Re: Thoughts about updateable views