Re: WITH NOT MATERIALIZED and DML CTEs - Mailing list pgsql-hackers

From David Fetter
Subject Re: WITH NOT MATERIALIZED and DML CTEs
Date
Msg-id 20190603231428.GQ12249@fetter.org
Whole thread Raw
In response to WITH NOT MATERIALIZED and DML CTEs  (Elvis Pranskevichus <elprans@gmail.com>)
Responses Re: WITH NOT MATERIALIZED and DML CTEs
List pgsql-hackers
On Mon, Jun 03, 2019 at 11:45:51AM -0400, Elvis Pranskevichus wrote:
> Currently, WITH a AS NOT MATERIALIZED (INSERT ...) would silently 
> disregard the "NOT MATERIALIZED" instruction and execute the data-
> modifying CTE to completion (as per the long-standing DML CTE rule).
> 
> This seems like an omission to me.  Ideally, the presence of an explicit 
> "NOT MATERIALIZED" clause on a data-modifying CTE should disable the 
> "run to completion" logic.

It might be worth documenting the fact that NOT MATERIALIZED doesn't
affect DML CTEs, just as it doesn't affect statements with volatile
functions and recursive CTEs.

Best,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Use of multi-column gin index
Next
From: Tom Lane
Date:
Subject: Re: WITH NOT MATERIALIZED and DML CTEs