Re: Writeable CTEs - Mailing list pgsql-hackers

From Marko Tiikkaja
Subject Re: Writeable CTEs
Date
Msg-id 4B4CC5BA.4020901@cs.helsinki.fi
Whole thread Raw
In response to Re: Writeable CTEs  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2010-01-05 20:40 +0200, Tom Lane wrote:
> Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi> writes:
>> => with t as (delete from foo returning *)
>> -> insert into bar
>> -> select * from t;
>> INSERT 0 2
>
>> It correctly reports 2 affected rows (one deleted and one inserted), but
>> is this the answer we want?
>
> No.  The returned tag should consider only the top-level operation,
> not what happened inside any CTEs.

Attached is the latest version of the patch.  This fixes all issues I'm
aware of.  This one also allows forward-referencing and recursive CTEs
in the same CTE list with writeable CTEs, using the RECURSIVE keyword.


Regards,
Marko Tiikkaja

Attachment

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: mailing list archiver chewing patches
Next
From: Tom Lane
Date:
Subject: Re: Hot Standy introduced problem with query cancel behavior