Re: delayed initialization in worktable scan

2023-01-07 Thread Tom Lane
Andres Freund writes: > Basically the issue is that in queries with two CTEs we can, at least > currently, end up with a WorkTable scans on a CTE we've not yet initialized, > due to the WorkTable scan of one CTE appearing in the other. Thus > ExecInitRecursiveUnion() hasn't yet set up the param we

delayed initialization in worktable scan

2023-01-07 Thread Andres Freund
Hi, while looking at fixing [1], I again came across the fact that we don't initialize the projection etc during ExecInitWorkTableScan(), but do so during the first call to ExecWorkTableScan(). This is explained with the following comment: /* * On the first call, find the ancest