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

From Andres Freund
Subject Re: WITH NOT MATERIALIZED and DML CTEs
Date
Msg-id 20190603155015.kdnej2yjdf7jveuk@alap3.anarazel.de
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
Re: WITH NOT MATERIALIZED and DML CTEs
List pgsql-hackers
Hi,

On 2019-06-03 11:45:51 -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.

I don't see us ever doing that. The result of minor costing and other
planner changes would yield different updated data. That'll just create
endless bug reports.


> It is understandably late in the 12 cycle, so maybe prohibit NOT 
> MATERIALIZED with DML altogheter and revisit this in 13?

I could see us adding an error, or just continuing to silently ignore
it.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Elvis Pranskevichus
Date:
Subject: WITH NOT MATERIALIZED and DML CTEs
Next
From: Robert Haas
Date:
Subject: undo: zedstore vs. zheap