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

From Richard Huxton
Subject Re: Thoughts about updateable views
Date
Msg-id 41C990CB.4000601@archonet.com
Whole thread Raw
In response to Re: Thoughts about updateable views  (Yann Michel <yann-postgresql@spline.de>)
Responses Re: Thoughts about updateable views
List pgsql-hackers
Yann Michel wrote:
> Hi,
> 
> On Wed, Dec 22, 2004 at 09:41:40AM +0000, Richard Huxton wrote:
> 
>>UNION etc doesn't necessarily mean you can't update, so long as the 
>>underlying table/key can be identified.
> 
> 
> I think you mean UNION ALL, i.e. the set addition, don't you?
> Otherwise UNION (wothout ALL) is kind of a aggregation due to it only
> adds a row once to the resulting set wheter it is found twice or not.
> Therefore any updates are not possible.

Not if you can identify the underlying table(s) and key(s). If the UNION 
hides that information, then you are correct. Imagine the case where you 
were running a calendar system and had people_invited unioned with 
rooms_booked - you could in theory alter the name on both.

--   Richard Huxton  Archonet Ltd


pgsql-hackers by date:

Previous
From: Yann Michel
Date:
Subject: Re: Thoughts about updateable views
Next
From: Greg Stark
Date:
Subject: Re: RC2 and open issues