Re: Writeable CTEs and side effects

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Writeable CTEs and side effects
Дата
Msg-id 25734.1255019436@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Writeable CTEs and side effects  (Merlin Moncure <mmoncure@gmail.com>)
Ответы Re: Writeable CTEs and side effects
Список pgsql-hackers
Merlin Moncure <mmoncure@gmail.com> writes:
> On Thu, Oct 8, 2009 at 6:52 AM, Robert Haas <robertmhaas@gmail.com> wrote:
>> up to the main query. �For what may turn out to be pretty common uses
>> cases like WITH tuples AS (DELETE FROM big_table_1 RETURNING ...)
>> INSERT INTO big_table_2 ... this is going to suck pretty bad. �I

> Is the above form:

> with x as (delete .. returning *) insert into y select * from x

> going to be allowed?  I was informed on irc that it wasn't...it would
> have to be written as:

> insert into y with x as (delete .. returning *) select * from x

I would think that we would require the former and forbid the latter.
One of the basic limitations of the feature is going to be that you
can only have WITH (something RETURNING) at the top level, and the
latter syntax doesn't look like that to me.
        regards, tom lane


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: one line comment style
Следующее
От: Tom Lane
Дата:
Сообщение: Re: COPY enhancements