Re: wCTE behaviour - Mailing list pgsql-hackers

From Marko Tiikkaja
Subject Re: wCTE behaviour
Date
Msg-id 4CDEAD76.1040803@cs.helsinki.fi
Whole thread Raw
In response to Re: wCTE behaviour  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: wCTE behaviour
Re: wCTE behaviour
List pgsql-hackers
On 2010-11-13 5:08 PM +0200, Tom Lane wrote:
> Marko Tiikkaja<marko.tiikkaja@cs.helsinki.fi>  writes:
>> On 13 Nov 2010, at 15:41, David Fetter<david@fetter.org>  wrote:
>>> Similarly, if a normal CTE called a data-changing function but was
>>> nevertheless not referred to, it would still run.
>
>> Actually, it wouldn't.
>
> Indeed, and that was considered a feature when we did it.  I think
> that having wCTEs behave arbitrarily differently on this point
> might be a bad idea.

So these queries would behave differently?

WITH t AS (DELETE FROM foo RETURNING *)
SELECT 1 WHERE false;

WITH t AS (DELETE FROM foo RETURNING *)
SELECT 1 FROM t LIMIT 0;


Regards,
Marko Tiikkaja


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: wCTE behaviour
Next
From: "Clark C. Evans"
Date:
Subject: Re: wCTE behaviour