Re: [HACKERS] Query::targetList and RETURNING

2009-11-10 Thread Tom Lane
Marko Tiikkaja marko.tiikk...@cs.helsinki.fi 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

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,

Re: [HACKERS] Query::targetList and RETURNING

2009-11-10 Thread Tom Lane
Marko Tiikkaja marko.tiikk...@cs.helsinki.fi 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

Re: [HACKERS] Query::targetList and RETURNING

2009-11-10 Thread Greg Stark
On Tue, Nov 10, 2009 at 2:56 PM, Marko Tiikkaja marko.tiikk...@cs.helsinki.fi 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.  

Re: [HACKERS] Query::targetList and RETURNING

2009-11-10 Thread Marko Tiikkaja
Tom Lane wrote: Marko Tiikkaja marko.tiikk...@cs.helsinki.fi 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

Re: [HACKERS] Query::targetList and RETURNING

2009-11-10 Thread Tom Lane
Marko Tiikkaja marko.tiikk...@cs.helsinki.fi 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

Re: [HACKERS] Query::targetList and RETURNING

2009-11-10 Thread Marko Tiikkaja
Tom Lane wrote: Marko Tiikkaja marko.tiikk...@cs.helsinki.fi 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

Re: [HACKERS] Query::targetList and RETURNING

2009-11-10 Thread Tom Lane
Marko Tiikkaja marko.tiikk...@cs.helsinki.fi 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