On Thu, Nov 7, 2013 at 9:08 PM, Craig Ringer <cr...@2ndquadrant.com> wrote: > On 11/07/2013 09:47 PM, Greg Stark wrote: >> Incidentally I still feel this is at root the problem with updateable >> views in general. I know it's a bit off to be tossing in concerns from >> the peanut gallery when I'm not actually offering to work on it and >> others are having putting in serious efforts in this area and having >> some success. So take this for what it's worth... > > Frankly, the peanut gallery input can be quite handy. It's easy to get > so stuck in the way you've seen it thought about already that you don't > see other ways to view it. Plus, sometimes the peanut gallery becomes > the "oh, I don't like this at all" crowd when commit time is > approaching, so early comments are better than no comments then last > minute complaints. > >> I think the right approach for updateable views would be to support a >> syntax like this in the planner: >> >> UPDATE (select * from tab1,tab2 ...) WHERE tab1.id <http://tab1.id> = .. >> SET ... > > I want to support that for rewritten parse trees, and therefore (because > of recursive rewrite) in pre-rewrite parse trees. It's exactly what's > needed to make this sane, IMO, and I think this is what Robert was > suggesting with making UPDATE capable of dealing with operating directly > on a subquery scan. > > I'm not at all convinced it should be exposed to the user and accepted > by the parser as SQL, but I don't know if that's what you were suggesting. > > Robert? Is this what you meant? If so, any chance you can point a > planner neophyte like me in vaguely the right direction?
I haven't studied this issue well enough to know what's really needed here, but Dean Rasheed's approach sounded like a promising tack to me. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers