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

From Elvis Pranskevichus
Subject Re: WITH NOT MATERIALIZED and DML CTEs
Date
Msg-id 8773800.aLnjnIGtRz@hammer.magicstack.net
Whole thread Raw
In response to Re: WITH NOT MATERIALIZED and DML CTEs  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Fix inconsistencies for v12
Next
From: Jesper Pedersen
Date:
Subject: Re: Index Skip Scan