Re: Writeable CTEs and side effects - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: Writeable CTEs and side effects
Date
Msg-id b42b73150910080854u38547aa1u4c5ee9b85596102e@mail.gmail.com
Whole thread Raw
In response to Re: Writeable CTEs and side effects  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Writeable CTEs and side effects
Re: Writeable CTEs and side effects
List pgsql-hackers
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

IOW, will WITH be able to terminate in update/insert/delete and not just select?

merlin


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: COPY enhancements
Next
From: Robert Haas
Date:
Subject: Re: COPY enhancements