228{
231 int off;
232
233 /* check for unsupported flags */
235
236 /*
237 * create state structure
238 */
241 state->ps.state = estate;
243
244 state->pending_srf_tuples =
false;
245
246 /*
247 * Miscellaneous initialization
248 *
249 * create expression context for node
250 */
252
253 /*
254 * initialize child nodes
255 */
257
258 /*
259 * we don't use inner plan
260 */
262
263 /*
264 * tuple table and result type initialization
265 */
267
268 /* Create workspace for per-tlist-entry expr state & SRF-is-done state */
274
275 /*
276 * Build expressions to evaluate targetlist. We can't use
277 * ExecBuildProjectionInfo here, since that doesn't deal with SRFs.
278 * Instead compile each expression separately, using
279 * ExecInitFunctionResultSet where applicable.
280 */
281 off = 0;
283 {
286
289 {
293 }
294 else
295 {
298 }
299
300 off++;
301 }
302
303 /* We don't support any qual on ProjectSet nodes */
305
306 /*
307 * Create a memory context that ExecMakeFunctionResultSet can use to
308 * evaluate function arguments in. We can't use the per-tuple context for
309 * this because it gets reset too often; but we don't want to leak
310 * evaluation results into the query-lifespan context either. We use one
311 * context for the arguments of all tSRFs, as they have roughly equivalent
312 * lifetimes.
313 */
315 "tSRF function arguments",
317
319}
ExprState * ExecInitExpr(Expr *node, PlanState *parent)
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
SetExprState * ExecInitFunctionResultSet(Expr *expr, ExprContext *econtext, PlanState *parent)
const TupleTableSlotOps TTSOpsVirtual
void ExecInitResultTupleSlotTL(PlanState *planstate, const TupleTableSlotOps *tts_ops)
void ExecAssignExprContext(EState *estate, PlanState *planstate)
#define EXEC_FLAG_BACKWARD
Assert(PointerIsAligned(start, uint64))
MemoryContext CurrentMemoryContext
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
bool expression_returns_set(Node *clause)
static TupleTableSlot * ExecProjectSet(PlanState *pstate)
#define IsA(nodeptr, _type_)
static int list_length(const List *l)