Re: Update Returning as subquery

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Update Returning as subquery
Дата
Msg-id 16830.1407691068@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Update Returning as subquery  (pascal+postgres@ensieve.org)
Список pgsql-sql
pascal+postgres@ensieve.org writes:
> Why is that forbidden? Isn't the purpose of a RETURNING clause to return values like a SELECT statement would, and
shouldn'tit therefore be allowed to occur in the same places?
 

An INSERT/UPDATE/DELETE RETURNING can be used as a CTE, not as a
sub-select.  Sub-selects aren't sufficiently independent of the outer
query, eg they might be evaluated more than once, or not at all, or
only partially.
        regards, tom lane



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

Предыдущее
От: Marcin Krawczyk
Дата:
Сообщение: Re: function call
Следующее
От: Andreas Joseph Krogh
Дата:
Сообщение: How to optimize WHERE column_a IS NOT NULL OR column_b = 'value'