WITH NOT MATERIALIZED and DML CTEs

From: Elvis Pranskevichus <elprans(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: WITH NOT MATERIALIZED and DML CTEs
Date: 2019-06-03 15:45:51
Message-ID: 7542836.7399EEAcVK@hammer.magicstack.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 is understandably late in the 12 cycle, so maybe prohibit NOT
MATERIALIZED with DML altogheter and revisit this in 13?

Thoughts?

Elvis

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-06-03 15:50:15 Re: WITH NOT MATERIALIZED and DML CTEs
Previous Message Tom Lane 2019-06-03 15:26:40 Re: Dead stores in src/common/sha2.c