3 ms·
Prepared statements work fine with CTEs. My experience was that this was not the case. Basically the CTE was materialized and the variables were resolved as p
by inferiorhuman 3y ago
Prepared statements work fine with CTEs.
My experience was that this was not the case. Basically the CTE was materialized and the variables were resolved as part of PREPARE, so each invocation got the same values. I couldn't find the blurb I'd read previously but I did a little digging today and it looks like maybe NOT MATERIALIZED would fix the problem?
- paulddraper 3y agoCTEs used to be an optimization fence, with or without prepared statements. PG 14 or something changed that.