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