Re: Query::targetList and RETURNING

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query::targetList and RETURNING
Дата
Msg-id 29749.1257868944@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Query::targetList and RETURNING  (Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>)
Ответы Re: Query::targetList and RETURNING
Список pgsql-hackers
Marko Tiikkaja <marko.tiikkaja@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 planner, it looked to me like the
majority were places that wouldn't be relevant for writable CTEs anyway.
For example, none of the references in allpaths.c are, because they have
to do with deciding whether quals can be pushed down into the subquery.
And the answer to that, for a non-SELECT CTE, is always "no".

> if (query->cmdType != CMD_SELECT)
>     cteList = query->returningList;
> else
>     cteList = query->targetList;

Just a thought ... where you do need this, would it be better to phrase
it as

if (query->returningList)cteList = query->returningList;
elsecteList = query->targetList;

?  I'm not sure myself, but it's something to consider.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Marko Tiikkaja
Дата:
Сообщение: Re: Query::targetList and RETURNING
Следующее
От: Marko Tiikkaja
Дата:
Сообщение: Re: Query::targetList and RETURNING