Re: Query::targetList and RETURNING - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Query::targetList and RETURNING
Date
Msg-id 27879.1257863939@sss.pgh.pa.us
Whole thread Raw
In response to Query::targetList and RETURNING  (Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>)
Responses Re: Query::targetList and RETURNING
List pgsql-hackers
Marko Tiikkaja <marko.tiikkaja@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 the output of that Query.  However, this
> is different from SELECT where targetList actually is the output of that
> Query node.  Attached is a patch which avoids this special-casing by
> making Query's targetList always be the output target list.  The target
> list for the result relation is stored separately.  The patch needs a
> bit more work but I'll be glad to do it if people think this is useful.

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.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: plpgsql EXECUTE will not set FOUND
Next
From: Simon Riggs
Date:
Subject: Re: Parsing config files in a directory