Re: WITH NOT MATERIALIZED and DML CTEs

From: Elvis Pranskevichus <elprans(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: WITH NOT MATERIALIZED and DML CTEs
Date: 2019-06-03 17:44:44
Message-ID: 8773800.aLnjnIGtRz@hammer.magicstack.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Monday, June 3, 2019 1:03:44 P.M. EDT Tom Lane wrote:
> CASE is a scalar-expression construct. It's got little to do with
> the timing of scan/join operations such as row fetches. We offer
> users essentially no control over when those happen ... other than
> the guarantees about CTE materialization, which are exactly what
> you say you want to give up.

In the general case, yes, but I *can* use a scalar-returning INSERT CTE
in a THEN clause as a subquery. Useful for a conditional INSERT, when
you can't use ON CONFLICT.

Anyway, I understand that the complications are probably not worth it.

Thanks,

Elvis

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jesper Pedersen 2019-06-03 18:13:56 Re: Index Skip Scan
Previous Message Tom Lane 2019-06-03 17:26:54 Re: Fix inconsistencies for v12