Re: wCTE behaviour

Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>

From: Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>
To: Hitoshi Harada <umi.tanuki@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>, Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Yeb Havinga <yebhavinga@gmail.com>, David Fetter <david@fetter.org>
Date: 2010-11-14T18:07:22Z
Lists: pgsql-hackers
On 2010-11-14 8:01 PM +0200, I wrote:
> In my opinion, all of these should have the same effect: DELETE all rows
> from "foo".

Since the example wasn't entirely clear on this one: in my opinion the 
DML should also only be executed once.  So:

WITH t AS (INSERT INTO foo VALUES (0) RETURNING *)
SELECT 1 FROM t t1, t t2;

would only insert one row in any case.


Regards,
Marko Tiikkaja