Re: wCTE behaviour - Mailing list pgsql-hackers

From Tom Lane
Subject Re: wCTE behaviour
Date
Msg-id 17467.1289496895@sss.pgh.pa.us
Whole thread Raw
In response to Re: wCTE behaviour  (Thom Brown <thom@linux.com>)
Responses Re: wCTE behaviour
List pgsql-hackers
Thom Brown <thom@linux.com> writes:
> WITH t AS (UPDATE foo SET col = true)
> SELECT * FROM foo WHERE col = false;

> ... Wouldn't this be more practical to have foo's UPDATEs applied prior to
> SELECT?  Otherwise what would the usecase be?

If that's what you want, you might as well just issue two separate
statements.  There is no use-case for this at all unless the WITH
produces some RETURNING data that the SELECT makes use of.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: wCTE behaviour
Next
From: Marko Tiikkaja
Date:
Subject: Re: wCTE behaviour