Re: [HACKERS] Query::targetList and RETURNING

2009-11-10 Thread Tom Lane
Marko Tiikkaja writes: > Tom Lane wrote: >> if (query->returningList) >> cteList = query->returningList; >> else >> cteList = query->targetList; > My initial thought is that this won't work because there might not be a > RETURNING clause, but I'm not sure. Hm, would we allow DML withou

Re: [HACKERS] Query::targetList and RETURNING

2009-11-10 Thread Marko Tiikkaja
Tom Lane wrote: Marko Tiikkaja writes: I wouldn't care for this at all, but with things the way they are right now, the writeable CTE patch has to do quite a few of these: [ shrug... ] How many is "quite a few"? In a quick search for existing references to targetList in the planner, it look

Re: [HACKERS] Query::targetList and RETURNING

2009-11-10 Thread Tom Lane
Marko Tiikkaja writes: > I wouldn't care for this at all, but with things the way they are right > now, the writeable CTE patch has to do quite a few of these: [ shrug... ] How many is "quite a few"? In a quick search for existing references to targetList in the planner, it looked to me like th

Re: [HACKERS] Query::targetList and RETURNING

2009-11-10 Thread Marko Tiikkaja
Tom Lane wrote: Marko Tiikkaja writes: Tom Lane wrote: This doesn't really seem like a good idea from here. You're changing a decision that has something like twenty years' standing in the code, for no real gain. AFAICS this is just going to move the special cases from point A to point B.

Re: [HACKERS] Query::targetList and RETURNING

2009-11-10 Thread Greg Stark
On Tue, Nov 10, 2009 at 2:56 PM, Marko Tiikkaja wrote: > (Sorry, forgot to CC the list) > > Tom Lane wrote: >> >> This doesn't really seem like a good idea from here.  You're changing >> a decision that has something like twenty years' standing in the code, >> for no real gain.  AFAICS this is jus

Re: [HACKERS] Query::targetList and RETURNING

2009-11-10 Thread Tom Lane
Marko Tiikkaja writes: > Tom Lane wrote: >> This doesn't really seem like a good idea from here. You're changing >> a decision that has something like twenty years' standing in the code, >> for no real gain. AFAICS this is just going to move the special cases >> from point A to point B. > Right

Re: [HACKERS] Query::targetList and RETURNING

2009-11-10 Thread Marko Tiikkaja
(Sorry, forgot to CC the list) Tom Lane wrote: This doesn't really seem like a good idea from here. You're changing a decision that has something like twenty years' standing in the code, for no real gain. AFAICS this is just going to move the special cases from point A to point B. Right, but

Re: [HACKERS] Query::targetList and RETURNING

2009-11-10 Thread Tom Lane
Marko Tiikkaja writes: > While working on writeable CTEs, I noticed I have to special-case the > output of a Query node frequently because in INSERT/UPDATE/DELETE query > targetList is the target list which is used for modifying the result > relation and returningList is the output of that Query.

[HACKERS] Query::targetList and RETURNING

2009-11-10 Thread Marko Tiikkaja
Hi, While working on writeable CTEs, I noticed I have to special-case the output of a Query node frequently because in INSERT/UPDATE/DELETE query targetList is the target list which is used for modifying the result relation and returningList is the output of that Query. However, this is differen