PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
execExpr.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * execExpr.h
4 * Low level infrastructure related to expression evaluation
5 *
6 *
7 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
9 *
10 * src/include/executor/execExpr.h
11 *
12 *-------------------------------------------------------------------------
13 */
14#ifndef EXEC_EXPR_H
15#define EXEC_EXPR_H
16
17#include "executor/nodeAgg.h"
18#include "nodes/execnodes.h"
19#include "nodes/miscnodes.h"
20
21/* forward references to avoid circularity */
22struct ExprEvalStep;
26
27/* Bits in ExprState->flags (see also execnodes.h for public flag bits): */
28/* expression's interpreter has been initialized */
29#define EEO_FLAG_INTERPRETER_INITIALIZED (1 << 5)
30/* jump-threading is in use */
31#define EEO_FLAG_DIRECT_THREADED (1 << 6)
32
33/* Typical API for out-of-line evaluation subroutines */
35 struct ExprEvalStep *op,
36 ExprContext *econtext);
37
38/* API for out-of-line evaluation subroutines returning bool */
40 struct ExprEvalStep *op,
41 ExprContext *econtext);
42
43/* ExprEvalSteps that cache a composite type's tupdesc need one of these */
44/* (it fits in-line in some step types, otherwise allocate out-of-line) */
46{
47 /*
48 * cacheptr points to composite type's TypeCacheEntry if tupdesc_id is not
49 * 0; or for an anonymous RECORD type, it points directly at the cached
50 * tupdesc for the type, and tupdesc_id is 0. (We'd use separate fields
51 * if space were not at a premium.) Initial state is cacheptr == NULL.
52 */
53 void *cacheptr;
54 uint64 tupdesc_id; /* last-seen tupdesc identifier, or 0 */
56
57/*
58 * Discriminator for ExprEvalSteps.
59 *
60 * Identifies the operation to be executed and which member in the
61 * ExprEvalStep->d union is valid.
62 *
63 * The order of entries needs to be kept in sync with the dispatch_table[]
64 * array in execExprInterp.c:ExecInterpExpr().
65 */
66typedef enum ExprEvalOp
67{
68 /* entire expression has been evaluated completely, return */
70
71 /* apply slot_getsomeattrs on corresponding tuple slot */
77
78 /* compute non-system Var value */
84
85 /* compute system Var value */
91
92 /* compute wholerow Var */
94
95 /*
96 * Compute non-system Var value, assign it into ExprState's resultslot.
97 * These are not used if a CheckVarSlotCompatibility() check would be
98 * needed.
99 */
105
106 /* assign ExprState's resvalue/resnull to a column of its resultslot */
108 /* ditto, applying MakeExpandedObjectReadOnly() */
110
111 /* evaluate Const value */
113
114 /*
115 * Evaluate function call (including OpExprs etc). For speed, we
116 * distinguish in the opcode whether the function is strict and/or
117 * requires usage stats tracking.
118 */
123
124 /*
125 * Evaluate boolean AND expression, one step per subexpression. FIRST/LAST
126 * subexpressions are special-cased for performance. Since AND always has
127 * at least two subexpressions, FIRST and LAST never apply to the same
128 * subexpression.
129 */
133
134 /* similarly for boolean OR expression */
138
139 /* evaluate boolean NOT expression */
141
142 /* simplified version of BOOL_AND_STEP for use by ExecQual() */
144
145 /* unconditional jump to another step */
147
148 /* conditional jumps based on current result value */
152
153 /* perform NULL tests for scalar values */
156
157 /* perform NULL tests for row values */
160
161 /* evaluate a BooleanTest expression */
166
167 /* evaluate PARAM_EXEC/EXTERN parameters */
171 /* set PARAM_EXEC value */
173
174 /* return CaseTestExpr value */
176
177 /* apply MakeExpandedObjectReadOnly() to target value */
179
180 /* evaluate assorted special-purpose expression types */
193
194 /*
195 * Compare two individual elements of each of two compared ROW()
196 * expressions. Skip to ROWCOMPARE_FINAL if elements are not equal.
197 */
199
200 /* evaluate boolean value based on previous ROWCOMPARE_STEP operations */
202
203 /* evaluate GREATEST() or LEAST() */
205
206 /* evaluate FieldSelect expression */
208
209 /*
210 * Deform tuple before evaluating new values for individual fields in a
211 * FieldStore expression.
212 */
214
215 /*
216 * Form the new tuple for a FieldStore expression. Individual fields will
217 * have been evaluated into columns of the tuple deformed by the preceding
218 * DEFORM step.
219 */
221
222 /* Process container subscripts; possibly short-circuit result to NULL */
224
225 /*
226 * Compute old container element/slice when a SubscriptingRef assignment
227 * expression contains SubscriptingRef/FieldStore subexpressions. Value is
228 * accessed using the CaseTest mechanism.
229 */
231
232 /* compute new value for SubscriptingRef assignment expression */
234
235 /* compute element/slice for SubscriptingRef fetch expression */
237
238 /* evaluate value for CoerceToDomainValue */
240
241 /* evaluate a domain's NOT NULL constraint */
243
244 /* evaluate a single domain CHECK constraint */
246
247 /* evaluation steps for hashing */
253
254 /* evaluate assorted special-purpose expression types */
269
270 /* aggregation related nodes */
286
287 /* non-existent operation, used e.g. to check array lengths */
290
291
292typedef struct ExprEvalStep
293{
294 /*
295 * Instruction to be executed. During instruction preparation this is an
296 * enum ExprEvalOp, but later it can be changed to some other type, e.g. a
297 * pointer for computed goto (that's why it's an intptr_t).
298 */
299 intptr_t opcode;
300
301 /* where to store the result of this step */
303 bool *resnull;
304
305 /*
306 * Inline data for the operation. Inline data is faster to access, but
307 * also bloats the size of all instructions. The union should be kept to
308 * no more than 40 bytes on 64-bit systems (so that the entire struct is
309 * no more than 64 bytes, a single cacheline on common systems).
310 */
311 union
312 {
313 /* for EEOP_INNER/OUTER/SCAN/OLD/NEW_FETCHSOME */
314 struct
315 {
316 /* attribute number up to which to fetch (inclusive) */
318 /* will the type of slot be the same for every invocation */
319 bool fixed;
320 /* tuple descriptor, if known */
322 /* type of slot, can only be relied upon if fixed is set */
325
326 /* for EEOP_INNER/OUTER/SCAN/OLD/NEW_[SYS]VAR */
327 struct
328 {
329 /* attnum is attr number - 1 for regular VAR ... */
330 /* but it's just the normal (negative) attr number for SYSVAR */
332 Oid vartype; /* type OID of variable */
333 VarReturningType varreturningtype; /* return old/new/default */
335
336 /* for EEOP_WHOLEROW */
337 struct
338 {
339 Var *var; /* original Var node in plan tree */
340 bool first; /* first time through, need to initialize? */
341 bool slow; /* need runtime check for nulls? */
342 TupleDesc tupdesc; /* descriptor for resulting tuples */
343 JunkFilter *junkFilter; /* JunkFilter to remove resjunk cols */
345
346 /* for EEOP_ASSIGN_*_VAR */
347 struct
348 {
349 /* target index in ExprState->resultslot->tts_values/nulls */
351 /* source attribute number - 1 */
352 int attnum;
354
355 /* for EEOP_ASSIGN_TMP[_MAKE_RO] */
356 struct
357 {
358 /* target index in ExprState->resultslot->tts_values/nulls */
359 int resultnum;
361
362 /* for EEOP_RETURNINGEXPR */
363 struct
364 {
365 uint8 nullflag; /* flag to test if OLD/NEW row is NULL */
366 int jumpdone; /* jump here if OLD/NEW row is NULL */
368
369 /* for EEOP_CONST */
370 struct
371 {
372 /* constant's value */
374 bool isnull;
376
377 /* for EEOP_FUNCEXPR_* / NULLIF / DISTINCT */
378 struct
379 {
380 FmgrInfo *finfo; /* function's lookup data */
381 FunctionCallInfo fcinfo_data; /* arguments etc */
382 /* faster to access without additional indirection: */
383 PGFunction fn_addr; /* actual call address */
384 int nargs; /* number of arguments */
385 bool make_ro; /* make arg0 R/O (used only for NULLIF) */
387
388 /* for EEOP_BOOL_*_STEP */
389 struct
390 {
391 bool *anynull; /* track if any input was NULL */
392 int jumpdone; /* jump here if result determined */
394
395 /* for EEOP_QUAL */
396 struct
397 {
398 int jumpdone; /* jump here on false or null */
400
401 /* for EEOP_JUMP[_CONDITION] */
402 struct
403 {
404 int jumpdone; /* target instruction's index */
406
407 /* for EEOP_NULLTEST_ROWIS[NOT]NULL */
408 struct
409 {
410 /* cached descriptor for composite type - filled at runtime */
413
414 /* for EEOP_PARAM_EXEC/EXTERN and EEOP_PARAM_SET */
415 struct
416 {
417 int paramid; /* numeric ID for parameter */
418 Oid paramtype; /* OID of parameter's datatype */
420
421 /* for EEOP_PARAM_CALLBACK */
422 struct
423 {
424 ExecEvalSubroutine paramfunc; /* add-on evaluation subroutine */
425 void *paramarg; /* private data for same */
426 int paramid; /* numeric ID for parameter */
427 Oid paramtype; /* OID of parameter's datatype */
429
430 /* for EEOP_CASE_TESTVAL/DOMAIN_TESTVAL */
431 struct
432 {
433 Datum *value; /* value to return */
434 bool *isnull;
436
437 /* for EEOP_MAKE_READONLY */
438 struct
439 {
440 Datum *value; /* value to coerce to read-only */
441 bool *isnull;
443
444 /* for EEOP_IOCOERCE */
445 struct
446 {
447 /* lookup and call info for source type's output function */
450 /* lookup and call info for result type's input function */
454
455 /* for EEOP_SQLVALUEFUNCTION */
456 struct
457 {
460
461 /* for EEOP_NEXTVALUEEXPR */
462 struct
463 {
467
468 /* for EEOP_ARRAYEXPR */
469 struct
470 {
471 Datum *elemvalues; /* element values get stored here */
473 int nelems; /* length of the above arrays */
474 Oid elemtype; /* array element type */
475 int16 elemlength; /* typlen of the array element type */
476 bool elembyval; /* is the element type pass-by-value? */
477 char elemalign; /* typalign of the element type */
478 bool multidims; /* is array expression multi-D? */
480
481 /* for EEOP_ARRAYCOERCE */
482 struct
483 {
484 ExprState *elemexprstate; /* null if no per-element work */
485 Oid resultelemtype; /* element type of result array */
486 struct ArrayMapState *amstate; /* workspace for array_map */
488
489 /* for EEOP_ROW */
490 struct
491 {
492 TupleDesc tupdesc; /* descriptor for result tuples */
493 /* workspace for the values constituting the row: */
495 bool *elemnulls;
497
498 /* for EEOP_ROWCOMPARE_STEP */
499 struct
500 {
501 /* lookup and call data for column comparison function */
505 /* target for comparison resulting in NULL */
507 /* target for comparison yielding inequality */
508 int jumpdone;
510
511 /* for EEOP_ROWCOMPARE_FINAL */
512 struct
513 {
516
517 /* for EEOP_MINMAX */
518 struct
519 {
520 /* workspace for argument values */
522 bool *nulls;
523 int nelems;
524 /* is it GREATEST or LEAST? */
526 /* lookup and call data for comparison function */
530
531 /* for EEOP_FIELDSELECT */
532 struct
533 {
534 AttrNumber fieldnum; /* field number to extract */
535 Oid resulttype; /* field's type */
536 /* cached descriptor for composite type - filled at runtime */
539
540 /* for EEOP_FIELDSTORE_DEFORM / FIELDSTORE_FORM */
541 struct
542 {
543 /* original expression node */
545
546 /* cached descriptor for composite type - filled at runtime */
547 /* note that a DEFORM and FORM pair share the same cache */
549
550 /* workspace for column values */
551 Datum *values;
552 bool *nulls;
555
556 /* for EEOP_SBSREF_SUBSCRIPTS */
557 struct
558 {
559 ExecEvalBoolSubroutine subscriptfunc; /* evaluation subroutine */
560 /* too big to have inline */
562 int jumpdone; /* jump here on null */
564
565 /* for EEOP_SBSREF_OLD / ASSIGN / FETCH */
566 struct
567 {
568 ExecEvalSubroutine subscriptfunc; /* evaluation subroutine */
569 /* too big to have inline */
572
573 /* for EEOP_DOMAIN_NOTNULL / DOMAIN_CHECK */
574 struct
575 {
576 /* name of constraint */
578 /* where the result of a CHECK constraint will be stored */
581 /* OID of domain type */
585
586 /* for EEOP_HASH_SET_INITVAL */
587 struct
588 {
590
592
593 /* for EEOP_HASHDATUM_(FIRST|NEXT32)[_STRICT] */
594 struct
595 {
596 FmgrInfo *finfo; /* function's lookup data */
597 FunctionCallInfo fcinfo_data; /* arguments etc */
598 /* faster to access without additional indirection: */
599 PGFunction fn_addr; /* actual call address */
600 int jumpdone; /* jump here on null */
601 NullableDatum *iresult; /* intermediate hash result */
603
604 /* for EEOP_CONVERT_ROWTYPE */
605 struct
606 {
607 Oid inputtype; /* input composite type */
608 Oid outputtype; /* output composite type */
609 /* these three fields are filled at runtime: */
610 ExprEvalRowtypeCache *incache; /* cache for input type */
611 ExprEvalRowtypeCache *outcache; /* cache for output type */
612 TupleConversionMap *map; /* column mapping */
614
615 /* for EEOP_SCALARARRAYOP */
616 struct
617 {
618 /* element_type/typlen/typbyval/typalign are filled at runtime */
619 Oid element_type; /* InvalidOid if not yet filled */
620 bool useOr; /* use OR or AND semantics? */
621 int16 typlen; /* array element type storage info */
624 FmgrInfo *finfo; /* function's lookup data */
625 FunctionCallInfo fcinfo_data; /* arguments etc */
626 /* faster to access without additional indirection: */
627 PGFunction fn_addr; /* actual call address */
629
630 /* for EEOP_HASHED_SCALARARRAYOP */
631 struct
632 {
634 bool inclause; /* true for IN and false for NOT IN */
636 FmgrInfo *finfo; /* function's lookup data */
637 FunctionCallInfo fcinfo_data; /* arguments etc */
640
641 /* for EEOP_XMLEXPR */
642 struct
643 {
644 XmlExpr *xexpr; /* original expression node */
645 /* workspace for evaluating named args, if any */
648 /* workspace for evaluating unnamed args, if any */
650 bool *argnull;
652
653 /* for EEOP_JSON_CONSTRUCTOR */
654 struct
655 {
658
659 /* for EEOP_AGGREF */
660 struct
661 {
662 int aggno;
664
665 /* for EEOP_GROUPING_FUNC */
666 struct
667 {
668 List *clauses; /* integer list of column numbers */
670
671 /* for EEOP_WINDOW_FUNC */
672 struct
673 {
674 /* out-of-line state, modified by nodeWindowAgg.c */
677
678 /* for EEOP_SUBPLAN */
679 struct
680 {
681 /* out-of-line state, created by nodeSubplan.c */
684
685 /* for EEOP_AGG_*DESERIALIZE */
686 struct
687 {
689 int jumpnull;
691
692 /* for EEOP_AGG_STRICT_INPUT_CHECK_NULLS / STRICT_INPUT_CHECK_ARGS */
693 struct
694 {
695 /*
696 * For EEOP_AGG_STRICT_INPUT_CHECK_ARGS args contains pointers to
697 * the NullableDatums that need to be checked for NULLs.
698 *
699 * For EEOP_AGG_STRICT_INPUT_CHECK_NULLS nulls contains pointers
700 * to booleans that need to be checked for NULLs.
701 *
702 * Both cases currently need to exist because sometimes the
703 * to-be-checked nulls are in TupleTableSlot.isnull array, and
704 * sometimes in FunctionCallInfoBaseData.args[i].isnull.
705 */
707 bool *nulls;
708 int nargs;
709 int jumpnull;
711
712 /* for EEOP_AGG_PLAIN_PERGROUP_NULLCHECK */
713 struct
714 {
716 int jumpnull;
718
719 /* for EEOP_AGG_PRESORTED_DISTINCT_{SINGLE,MULTI} */
720 struct
721 {
726
727 /* for EEOP_AGG_PLAIN_TRANS_[INIT_][STRICT_]{BYVAL,BYREF} */
728 /* for EEOP_AGG_ORDERED_TRANS_{DATUM,TUPLE} */
729 struct
730 {
733 int setno;
735 int setoff;
737
738 /* for EEOP_IS_JSON */
739 struct
740 {
741 JsonIsPredicate *pred; /* original expression node */
743
744 /* for EEOP_JSONEXPR_PATH */
745 struct
746 {
749
750 /* for EEOP_JSONEXPR_COERCION */
751 struct
752 {
756 /* exists_* fields only relevant for JSON_EXISTS_OP. */
763 } d;
765
766/* Enforce the size rule given in the comment above */
768 "size of ExprEvalStep exceeds 64 bytes");
769
770
771/* Non-inline data for container operations */
773{
774 bool isassignment; /* is it assignment, or just fetch? */
775
776 /* workspace for type-specific subscripting code */
778
779 /* numupper and upperprovided[] are filled at expression compile time */
780 /* at runtime, subscripts are computed in upperindex[]/upperindexnull[] */
782 bool *upperprovided; /* indicates if this position is supplied */
785
786 /* similarly for lower indexes, if any */
791
792 /* for assignment, new value to assign is evaluated into here */
795
796 /* if we have a nested assignment, sbs_fetch_old puts old value here */
800
801/* Execution step methods used for SubscriptingRef */
802typedef struct SubscriptExecSteps
803{
804 /* See nodes/subscripting.h for more detail about these */
806 ExecEvalSubroutine sbs_fetch; /* fetch an element */
807 ExecEvalSubroutine sbs_assign; /* assign to an element */
808 ExecEvalSubroutine sbs_fetch_old; /* fetch old value for assignment */
810
811/* EEOP_JSON_CONSTRUCTOR state, too big to inline */
813{
818 struct
819 {
822 } *arg_type_cache; /* cache for datum_to_json[b]() */
823 int nargs;
825
826
827/* functions in execExpr.c */
828extern void ExprEvalPushStep(ExprState *es, const ExprEvalStep *s);
829
830/* functions in execExprInterp.c */
833
834extern Datum ExecInterpExprStillValid(ExprState *state, ExprContext *econtext, bool *isNull);
835extern void CheckExprStillValid(ExprState *state, ExprContext *econtext);
836
837/*
838 * Non fast-path execution functions. These are externs instead of statics in
839 * execExprInterp.c, because that allows them to be used by other methods of
840 * expression evaluation, reducing code duplication.
841 */
843 ExprContext *econtext);
845 ExprContext *econtext);
847 ExprContext *econtext);
849 ExprContext *econtext);
851 ExprContext *econtext);
857 ExprContext *econtext);
859 ExprContext *econtext);
862 ExprContext *econtext);
863extern void ExecEvalRow(ExprState *state, ExprEvalStep *op);
864extern void ExecEvalMinMax(ExprState *state, ExprEvalStep *op);
866 ExprContext *econtext);
868 ExprContext *econtext);
870 ExprContext *econtext);
872 ExprContext *econtext);
875 ExprContext *econtext);
880 ExprContext *econtext);
883 ExprContext *econtext);
885 ExprContext *econtext);
889 ExprContext *econtext);
891 ExprContext *econtext);
893 ExprContext *econtext);
895 ExprContext *econtext, TupleTableSlot *slot);
896
897extern void ExecAggInitGroup(AggState *aggstate, AggStatePerTrans pertrans, AggStatePerGroup pergroup,
898 ExprContext *aggcontext);
899extern Datum ExecAggCopyTransValue(AggState *aggstate, AggStatePerTrans pertrans,
900 Datum newValue, bool newValueIsNull,
901 Datum oldValue, bool oldValueIsNull);
902extern bool ExecEvalPreOrderedDistinctSingle(AggState *aggstate,
903 AggStatePerTrans pertrans);
904extern bool ExecEvalPreOrderedDistinctMulti(AggState *aggstate,
905 AggStatePerTrans pertrans);
907 ExprContext *econtext);
909 ExprContext *econtext);
910
911#endif /* EXEC_EXPR_H */
int16 AttrNumber
Definition: attnum.h:21
uint8_t uint8
Definition: c.h:486
int16_t int16
Definition: c.h:483
int32_t int32
Definition: c.h:484
uint64_t uint64
Definition: c.h:489
void ExecEvalParamExtern(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalFieldStoreForm(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalGroupingFunc(ExprState *state, ExprEvalStep *op)
struct SubscriptExecSteps SubscriptExecSteps
void ExecEvalRow(ExprState *state, ExprEvalStep *op)
void ExecEvalFieldStoreDeForm(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalCurrentOfExpr(ExprState *state, ExprEvalStep *op)
void ExecEvalSQLValueFunction(ExprState *state, ExprEvalStep *op)
void ExecEvalRowNull(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
struct SubscriptingRefState SubscriptingRefState
void ExecEvalArrayExpr(ExprState *state, ExprEvalStep *op)
void ExecEvalParamSet(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalCoerceViaIOSafe(ExprState *state, ExprEvalStep *op)
Datum ExecInterpExprStillValid(ExprState *state, ExprContext *econtext, bool *isNull)
void ExecEvalConvertRowtype(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
bool ExecEvalPreOrderedDistinctMulti(AggState *aggstate, AggStatePerTrans pertrans)
void ExecEvalFieldSelect(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
int ExecEvalJsonExprPath(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalConstraintNotNull(ExprState *state, ExprEvalStep *op)
void ExprEvalPushStep(ExprState *es, const ExprEvalStep *s)
Definition: execExpr.c:2670
void ExecEvalScalarArrayOp(ExprState *state, ExprEvalStep *op)
void ExecEvalAggOrderedTransDatum(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalParamExec(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalJsonCoercion(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
struct ExprEvalRowtypeCache ExprEvalRowtypeCache
void ExecAggInitGroup(AggState *aggstate, AggStatePerTrans pertrans, AggStatePerGroup pergroup, ExprContext *aggcontext)
void ExecEvalNextValueExpr(ExprState *state, ExprEvalStep *op)
void ExecEvalSysVar(ExprState *state, ExprEvalStep *op, ExprContext *econtext, TupleTableSlot *slot)
void ExecEvalMinMax(ExprState *state, ExprEvalStep *op)
void ExecEvalSubPlan(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalJsonIsPredicate(ExprState *state, ExprEvalStep *op)
bool(* ExecEvalBoolSubroutine)(ExprState *state, struct ExprEvalStep *op, ExprContext *econtext)
Definition: execExpr.h:39
Datum ExecAggCopyTransValue(AggState *aggstate, AggStatePerTrans pertrans, Datum newValue, bool newValueIsNull, Datum oldValue, bool oldValueIsNull)
struct ExprEvalStep ExprEvalStep
void ExecEvalMergeSupportFunc(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void CheckExprStillValid(ExprState *state, ExprContext *econtext)
void ExecEvalJsonConstructor(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalWholeRowVar(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalHashedScalarArrayOp(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalJsonCoercionFinish(ExprState *state, ExprEvalStep *op)
void ExecReadyInterpretedExpr(ExprState *state)
void ExecEvalRowNotNull(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
ExprEvalOp ExecEvalStepOp(ExprState *state, ExprEvalStep *op)
void(* ExecEvalSubroutine)(ExprState *state, struct ExprEvalStep *op, ExprContext *econtext)
Definition: execExpr.h:34
ExprEvalOp
Definition: execExpr.h:67
@ EEOP_OLD_VAR
Definition: execExpr.h:82
@ EEOP_ASSIGN_TMP
Definition: execExpr.h:107
@ EEOP_SUBPLAN
Definition: execExpr.h:268
@ EEOP_CONVERT_ROWTYPE
Definition: execExpr.h:255
@ EEOP_FUNCEXPR_STRICT_FUSAGE
Definition: execExpr.h:122
@ EEOP_ARRAYEXPR
Definition: execExpr.h:190
@ EEOP_JSONEXPR_PATH
Definition: execExpr.h:261
@ EEOP_NOT_DISTINCT
Definition: execExpr.h:184
@ EEOP_DOMAIN_TESTVAL
Definition: execExpr.h:239
@ EEOP_PARAM_EXTERN
Definition: execExpr.h:169
@ EEOP_HASHDATUM_NEXT32_STRICT
Definition: execExpr.h:252
@ EEOP_IOCOERCE_SAFE
Definition: execExpr.h:182
@ EEOP_BOOL_AND_STEP
Definition: execExpr.h:131
@ EEOP_WHOLEROW
Definition: execExpr.h:93
@ EEOP_JSONEXPR_COERCION_FINISH
Definition: execExpr.h:263
@ EEOP_HASHDATUM_FIRST_STRICT
Definition: execExpr.h:250
@ EEOP_AGGREF
Definition: execExpr.h:264
@ EEOP_INNER_VAR
Definition: execExpr.h:79
@ EEOP_AGG_PLAIN_PERGROUP_NULLCHECK
Definition: execExpr.h:275
@ EEOP_HASHDATUM_NEXT32
Definition: execExpr.h:251
@ EEOP_ROWCOMPARE_FINAL
Definition: execExpr.h:201
@ EEOP_AGG_STRICT_DESERIALIZE
Definition: execExpr.h:271
@ EEOP_IOCOERCE
Definition: execExpr.h:181
@ EEOP_RETURNINGEXPR
Definition: execExpr.h:189
@ EEOP_GROUPING_FUNC
Definition: execExpr.h:265
@ EEOP_DOMAIN_CHECK
Definition: execExpr.h:245
@ EEOP_BOOLTEST_IS_NOT_FALSE
Definition: execExpr.h:165
@ EEOP_PARAM_SET
Definition: execExpr.h:172
@ EEOP_NEXTVALUEEXPR
Definition: execExpr.h:188
@ EEOP_NEW_SYSVAR
Definition: execExpr.h:90
@ EEOP_DONE
Definition: execExpr.h:69
@ EEOP_AGG_PLAIN_TRANS_BYREF
Definition: execExpr.h:281
@ EEOP_QUAL
Definition: execExpr.h:143
@ EEOP_AGG_PRESORTED_DISTINCT_MULTI
Definition: execExpr.h:283
@ EEOP_AGG_PLAIN_TRANS_BYVAL
Definition: execExpr.h:278
@ EEOP_SCAN_VAR
Definition: execExpr.h:81
@ EEOP_BOOL_NOT_STEP
Definition: execExpr.h:140
@ EEOP_ASSIGN_SCAN_VAR
Definition: execExpr.h:102
@ EEOP_NEW_VAR
Definition: execExpr.h:83
@ EEOP_SCAN_SYSVAR
Definition: execExpr.h:88
@ EEOP_SCALARARRAYOP
Definition: execExpr.h:256
@ EEOP_DOMAIN_NOTNULL
Definition: execExpr.h:242
@ EEOP_WINDOW_FUNC
Definition: execExpr.h:266
@ EEOP_INNER_FETCHSOME
Definition: execExpr.h:72
@ EEOP_NULLTEST_ROWISNOTNULL
Definition: execExpr.h:159
@ EEOP_ASSIGN_OUTER_VAR
Definition: execExpr.h:101
@ EEOP_ROW
Definition: execExpr.h:192
@ EEOP_MAKE_READONLY
Definition: execExpr.h:178
@ EEOP_FIELDSTORE_FORM
Definition: execExpr.h:220
@ EEOP_ASSIGN_OLD_VAR
Definition: execExpr.h:103
@ EEOP_SBSREF_SUBSCRIPTS
Definition: execExpr.h:223
@ EEOP_SBSREF_FETCH
Definition: execExpr.h:236
@ EEOP_FUNCEXPR_STRICT
Definition: execExpr.h:120
@ EEOP_NULLIF
Definition: execExpr.h:185
@ EEOP_CURRENTOFEXPR
Definition: execExpr.h:187
@ EEOP_INNER_SYSVAR
Definition: execExpr.h:86
@ EEOP_ASSIGN_TMP_MAKE_RO
Definition: execExpr.h:109
@ EEOP_CONST
Definition: execExpr.h:112
@ EEOP_BOOL_OR_STEP_LAST
Definition: execExpr.h:137
@ EEOP_JSONEXPR_COERCION
Definition: execExpr.h:262
@ EEOP_BOOL_OR_STEP_FIRST
Definition: execExpr.h:135
@ EEOP_XMLEXPR
Definition: execExpr.h:258
@ EEOP_AGG_STRICT_INPUT_CHECK_NULLS
Definition: execExpr.h:274
@ EEOP_SBSREF_ASSIGN
Definition: execExpr.h:233
@ EEOP_OUTER_SYSVAR
Definition: execExpr.h:87
@ EEOP_ASSIGN_INNER_VAR
Definition: execExpr.h:100
@ EEOP_BOOL_OR_STEP
Definition: execExpr.h:136
@ EEOP_OUTER_FETCHSOME
Definition: execExpr.h:73
@ EEOP_AGG_STRICT_INPUT_CHECK_ARGS
Definition: execExpr.h:273
@ EEOP_NULLTEST_ROWISNULL
Definition: execExpr.h:158
@ EEOP_BOOLTEST_IS_TRUE
Definition: execExpr.h:162
@ EEOP_FUNCEXPR
Definition: execExpr.h:119
@ EEOP_NULLTEST_ISNOTNULL
Definition: execExpr.h:155
@ EEOP_ROWCOMPARE_STEP
Definition: execExpr.h:198
@ EEOP_MERGE_SUPPORT_FUNC
Definition: execExpr.h:267
@ EEOP_AGG_DESERIALIZE
Definition: execExpr.h:272
@ EEOP_LAST
Definition: execExpr.h:288
@ EEOP_HASHDATUM_FIRST
Definition: execExpr.h:249
@ EEOP_DISTINCT
Definition: execExpr.h:183
@ EEOP_JUMP_IF_NOT_TRUE
Definition: execExpr.h:151
@ EEOP_FUNCEXPR_FUSAGE
Definition: execExpr.h:121
@ EEOP_AGG_PRESORTED_DISTINCT_SINGLE
Definition: execExpr.h:282
@ EEOP_BOOL_AND_STEP_FIRST
Definition: execExpr.h:130
@ EEOP_JUMP
Definition: execExpr.h:146
@ EEOP_PARAM_CALLBACK
Definition: execExpr.h:170
@ EEOP_OLD_SYSVAR
Definition: execExpr.h:89
@ EEOP_BOOL_AND_STEP_LAST
Definition: execExpr.h:132
@ EEOP_NEW_FETCHSOME
Definition: execExpr.h:76
@ EEOP_AGG_ORDERED_TRANS_DATUM
Definition: execExpr.h:284
@ EEOP_OLD_FETCHSOME
Definition: execExpr.h:75
@ EEOP_ASSIGN_NEW_VAR
Definition: execExpr.h:104
@ EEOP_SBSREF_OLD
Definition: execExpr.h:230
@ EEOP_SQLVALUEFUNCTION
Definition: execExpr.h:186
@ EEOP_HASHDATUM_SET_INITVAL
Definition: execExpr.h:248
@ EEOP_JUMP_IF_NOT_NULL
Definition: execExpr.h:150
@ EEOP_AGG_PLAIN_TRANS_STRICT_BYREF
Definition: execExpr.h:280
@ EEOP_FIELDSTORE_DEFORM
Definition: execExpr.h:213
@ EEOP_BOOLTEST_IS_FALSE
Definition: execExpr.h:164
@ EEOP_BOOLTEST_IS_NOT_TRUE
Definition: execExpr.h:163
@ EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYVAL
Definition: execExpr.h:276
@ EEOP_PARAM_EXEC
Definition: execExpr.h:168
@ EEOP_JSON_CONSTRUCTOR
Definition: execExpr.h:259
@ EEOP_AGG_PLAIN_TRANS_STRICT_BYVAL
Definition: execExpr.h:277
@ EEOP_NULLTEST_ISNULL
Definition: execExpr.h:154
@ EEOP_MINMAX
Definition: execExpr.h:204
@ EEOP_JUMP_IF_NULL
Definition: execExpr.h:149
@ EEOP_ARRAYCOERCE
Definition: execExpr.h:191
@ EEOP_FIELDSELECT
Definition: execExpr.h:207
@ EEOP_CASE_TESTVAL
Definition: execExpr.h:175
@ EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYREF
Definition: execExpr.h:279
@ EEOP_HASHED_SCALARARRAYOP
Definition: execExpr.h:257
@ EEOP_OUTER_VAR
Definition: execExpr.h:80
@ EEOP_AGG_ORDERED_TRANS_TUPLE
Definition: execExpr.h:285
@ EEOP_SCAN_FETCHSOME
Definition: execExpr.h:74
@ EEOP_IS_JSON
Definition: execExpr.h:260
void ExecEvalConstraintCheck(ExprState *state, ExprEvalStep *op)
StaticAssertDecl(sizeof(ExprEvalStep)<=64, "size of ExprEvalStep exceeds 64 bytes")
void ExecEvalArrayCoerce(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalFuncExprStrictFusage(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalFuncExprFusage(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalXmlExpr(ExprState *state, ExprEvalStep *op)
bool ExecEvalPreOrderedDistinctSingle(AggState *aggstate, AggStatePerTrans pertrans)
struct JsonConstructorExprState JsonConstructorExprState
void ExecEvalAggOrderedTransTuple(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
Datum(* PGFunction)(FunctionCallInfo fcinfo)
Definition: fmgr.h:40
uintptr_t Datum
Definition: postgres.h:69
unsigned int Oid
Definition: postgres_ext.h:32
MinMaxOp
Definition: primnodes.h:1532
VarReturningType
Definition: primnodes.h:254
CompareType
Definition: primnodes.h:1470
XmlExpr * xexpr
Definition: execExpr.h:644
JsonIsPredicate * pred
Definition: execExpr.h:741
Datum * value
Definition: execExpr.h:433
uint8 nullflag
Definition: execExpr.h:365
Var * var
Definition: execExpr.h:339
void * paramarg
Definition: execExpr.h:425
bool * anynull
Definition: execExpr.h:391
ExprState * elemexprstate
Definition: execExpr.h:484
MinMaxOp op
Definition: execExpr.h:525
bool typbyval
Definition: execExpr.h:622
char elemalign
Definition: execExpr.h:477
struct ExprEvalStep::@55::@94 grouping_func
struct ExprEvalStep::@55::@66 jump
List * clauses
Definition: execExpr.h:668
WindowFuncExprState * wfstate
Definition: execExpr.h:675
void * json_coercion_cache
Definition: execExpr.h:760
ExecEvalBoolSubroutine subscriptfunc
Definition: execExpr.h:559
bool exists_coerce
Definition: execExpr.h:757
TupleDesc tupdesc
Definition: execExpr.h:342
Oid seqtypid
Definition: execExpr.h:465
ExprEvalRowtypeCache * rowcache
Definition: execExpr.h:548
int last_var
Definition: execExpr.h:317
JunkFilter * junkFilter
Definition: execExpr.h:343
struct ExprEvalStep::@55::@81 fieldselect
FmgrInfo * finfo_out
Definition: execExpr.h:448
AttrNumber fieldnum
Definition: execExpr.h:534
struct ExprEvalStep::@55::@90 hashedscalararrayop
struct ExprEvalStep::@55::@92 json_constructor
bool has_nulls
Definition: execExpr.h:633
Datum * values
Definition: execExpr.h:521
bool * elemnulls
Definition: execExpr.h:472
struct ExprEvalStep::@55::@60 assign_tmp
struct ExprEvalStep::@55::@71 make_readonly
bool * checknull
Definition: execExpr.h:580
int ncolumns
Definition: execExpr.h:553
bool * named_argnull
Definition: execExpr.h:647
struct ExprEvalStep::@55::@57 var
Oid outputtype
Definition: execExpr.h:608
struct ExprEvalStep::@55::@82 fieldstore
struct ExprEvalStep::@55::@85 domaincheck
struct ExprEvalStep::@55::@102 is_json
struct ScalarArrayOpExprHashTable * elements_tab
Definition: execExpr.h:635
bool inclause
Definition: execExpr.h:634
struct SubscriptingRefState * state
Definition: execExpr.h:561
SubPlanState * sstate
Definition: execExpr.h:682
bool multidims
Definition: execExpr.h:478
bool exists_cast_to_int
Definition: execExpr.h:758
VarReturningType varreturningtype
Definition: execExpr.h:333
int16 elemlength
Definition: execExpr.h:475
AggStatePerTrans pertrans
Definition: execExpr.h:722
struct ExprEvalStep::@55::@104 jsonexpr_coercion
struct ExprEvalStep::@55::@78 rowcompare_step
struct ExprEvalStep::@55::@83 sbsref_subscript
struct JsonExprState * jsestate
Definition: execExpr.h:747
bool * isnull
Definition: execExpr.h:434
TupleConversionMap * map
Definition: execExpr.h:612
bool * argnull
Definition: execExpr.h:650
struct ExprEvalStep::@55::@91 xmlexpr
struct ExprEvalStep::@55::@84 sbsref
intptr_t opcode
Definition: execExpr.h:299
struct ExprEvalStep::@55::@67 nulltest_row
Oid inputtype
Definition: execExpr.h:607
struct ExprEvalStep::@55::@69 cparam
char typalign
Definition: execExpr.h:623
ExecEvalSubroutine paramfunc
Definition: execExpr.h:424
FunctionCallInfo fcinfo_data_in
Definition: execExpr.h:452
bool elembyval
Definition: execExpr.h:476
PGFunction fn_addr
Definition: execExpr.h:383
TupleDesc known_desc
Definition: execExpr.h:321
NullableDatum * args
Definition: execExpr.h:706
int resultnum
Definition: execExpr.h:350
bool * nulls
Definition: execExpr.h:522
Datum * resvalue
Definition: execExpr.h:302
struct ExprEvalStep::@55::@77 row
Datum * elemvalues
Definition: execExpr.h:471
NullableDatum * iresult
Definition: execExpr.h:601
int jumpnull
Definition: execExpr.h:506
Oid resulttype
Definition: execExpr.h:535
ExprEvalRowtypeCache * incache
Definition: execExpr.h:610
struct ExprEvalStep::@55::@103 jsonexpr
struct ExprEvalStep::@55::@74 nextvalueexpr
struct ExprEvalStep::@55::@86 hashdatum_initvalue
bool exists_check_domain
Definition: execExpr.h:759
ScalarArrayOpExpr * saop
Definition: execExpr.h:638
const TupleTableSlotOps * kind
Definition: execExpr.h:323
Oid resultelemtype
Definition: execExpr.h:485
struct ExprEvalStep::@55::@99 agg_plain_pergroup_nullcheck
struct ExprEvalStep::@55::@62 constval
FunctionCallInfo fcinfo_data
Definition: execExpr.h:381
int jumpdistinct
Definition: execExpr.h:724
Datum * checkvalue
Definition: execExpr.h:579
struct ExprEvalStep::@55::@93 aggref
FmgrInfo * finfo_in
Definition: execExpr.h:451
struct ExprEvalStep::@55::@97 agg_deserialize
int jumpdone
Definition: execExpr.h:366
Datum * named_argvalue
Definition: execExpr.h:646
struct ExprEvalStep::@55::@95 window_func
struct ExprEvalStep::@55::@61 returningexpr
struct ExprEvalStep::@55::@72 iocoerce
ErrorSaveContext * escontext
Definition: execExpr.h:583
Oid paramtype
Definition: execExpr.h:418
union ExprEvalStep::@55 d
struct ExprEvalStep::@55::@98 agg_strict_input_check
bool fixed
Definition: execExpr.h:319
struct ExprEvalStep::@55::@80 minmax
struct ExprEvalStep::@55::@88 convert_rowtype
struct ExprEvalStep::@55::@79 rowcompare_final
Datum value
Definition: execExpr.h:373
bool useOr
Definition: execExpr.h:620
int32 targettypmod
Definition: execExpr.h:754
struct ExprEvalStep::@55::@70 casetest
bool make_ro
Definition: execExpr.h:385
struct ExprEvalStep::@55::@75 arrayexpr
struct ExprEvalStep::@55::@89 scalararrayop
struct ExprEvalStep::@55::@100 agg_presorted_distinctcheck
CompareType cmptype
Definition: execExpr.h:514
FieldStore * fstore
Definition: execExpr.h:544
struct ExprEvalStep::@55::@65 qualexpr
bool * resnull
Definition: execExpr.h:303
struct ExprEvalStep::@55::@58 wholerow
struct ExprEvalStep::@55::@101 agg_trans
FunctionCallInfo fcinfo_data_out
Definition: execExpr.h:449
ExecEvalSubroutine subscriptfunc
Definition: execExpr.h:568
ExprEvalRowtypeCache * outcache
Definition: execExpr.h:611
int16 typlen
Definition: execExpr.h:621
Datum * argvalue
Definition: execExpr.h:649
struct ExprEvalStep::@55::@68 param
struct ExprEvalStep::@55::@87 hashdatum
struct ExprEvalStep::@55::@96 subplan
struct ExprEvalStep::@55::@63 func
struct ExprEvalStep::@55::@73 sqlvaluefunction
struct ExprEvalStep::@55::@64 boolexpr
ExprEvalRowtypeCache rowcache
Definition: execExpr.h:411
Datum init_value
Definition: execExpr.h:589
struct JsonConstructorExprState * jcstate
Definition: execExpr.h:656
FmgrInfo * finfo
Definition: execExpr.h:380
bool isnull
Definition: execExpr.h:374
ExprContext * aggcontext
Definition: execExpr.h:723
Oid elemtype
Definition: execExpr.h:474
char * constraintname
Definition: execExpr.h:577
struct ExprEvalStep::@55::@56 fetch
struct ExprEvalStep::@55::@59 assign_var
Oid element_type
Definition: execExpr.h:619
Oid targettype
Definition: execExpr.h:753
bool first
Definition: execExpr.h:340
struct ArrayMapState * amstate
Definition: execExpr.h:486
bool omit_quotes
Definition: execExpr.h:755
struct ExprEvalStep::@55::@76 arraycoerce
SQLValueFunction * svf
Definition: execExpr.h:458
Definition: fmgr.h:57
JsonConstructorExpr * constructor
Definition: execExpr.h:814
struct JsonConstructorExprState::@105 * arg_type_cache
Definition: pg_list.h:54
ExecEvalSubroutine sbs_fetch_old
Definition: execExpr.h:808
ExecEvalBoolSubroutine sbs_check_subscripts
Definition: execExpr.h:805
ExecEvalSubroutine sbs_assign
Definition: execExpr.h:807
ExecEvalSubroutine sbs_fetch
Definition: execExpr.h:806
Definition: primnodes.h:261
Definition: regguts.h:323