Re: Writeable CTEs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
Cc: PostgreSQL development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Writeable CTEs
Date: 2010-01-05 18:40:28
Message-ID: 12968.1262716828@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)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.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stefan Kaltenbrunner 2010-01-05 18:44:07 Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Previous Message Pavel Stehule 2010-01-05 18:33:33 Re: Proposal: XML helper functions