Re: WITH NOT MATERIALIZED and DML CTEs

From: Andres Freund <andres(at)anarazel(dot)de>
To: Elvis Pranskevichus <elprans(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: WITH NOT MATERIALIZED and DML CTEs
Date: 2019-06-03 15:50:15
Message-ID: 20190603155015.kdnej2yjdf7jveuk@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2019-06-03 15:53:35 undo: zedstore vs. zheap
Previous Message Elvis Pranskevichus 2019-06-03 15:45:51 WITH NOT MATERIALIZED and DML CTEs