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, return value */
70
71 /* entire expression has been evaluated, no return value */
73
74 /* apply slot_getsomeattrs on corresponding tuple slot */
80
81 /* compute non-system Var value */
87
88 /* compute system Var value */
94
95 /* compute wholerow Var */
97
98 /*
99 * Compute non-system Var value, assign it into ExprState's resultslot.
100 * These are not used if a CheckVarSlotCompatibility() check would be
101 * needed.
102 */
108
109 /* assign ExprState's resvalue/resnull to a column of its resultslot */
111 /* ditto, applying MakeExpandedObjectReadOnly() */
113
114 /* evaluate Const value */
116
117 /*
118 * Evaluate function call (including OpExprs etc). For speed, we
119 * distinguish in the opcode whether the function is strict with 1, 2, or
120 * more arguments and/or requires usage stats tracking.
121 */
128
129 /*
130 * Evaluate boolean AND expression, one step per subexpression. FIRST/LAST
131 * subexpressions are special-cased for performance. Since AND always has
132 * at least two subexpressions, FIRST and LAST never apply to the same
133 * subexpression.
134 */
138
139 /* similarly for boolean OR expression */
143
144 /* evaluate boolean NOT expression */
146
147 /* simplified version of BOOL_AND_STEP for use by ExecQual() */
149
150 /* unconditional jump to another step */
152
153 /* conditional jumps based on current result value */
157
158 /* perform NULL tests for scalar values */
161
162 /* perform NULL tests for row values */
165
166 /* evaluate a BooleanTest expression */
171
172 /* evaluate PARAM_EXEC/EXTERN parameters */
176 /* set PARAM_EXEC value */
178
179 /* return CaseTestExpr value */
182
183 /* apply MakeExpandedObjectReadOnly() to target value */
185
186 /* evaluate assorted special-purpose expression types */
199
200 /*
201 * Compare two individual elements of each of two compared ROW()
202 * expressions. Skip to ROWCOMPARE_FINAL if elements are not equal.
203 */
205
206 /* evaluate boolean value based on previous ROWCOMPARE_STEP operations */
208
209 /* evaluate GREATEST() or LEAST() */
211
212 /* evaluate FieldSelect expression */
214
215 /*
216 * Deform tuple before evaluating new values for individual fields in a
217 * FieldStore expression.
218 */
220
221 /*
222 * Form the new tuple for a FieldStore expression. Individual fields will
223 * have been evaluated into columns of the tuple deformed by the preceding
224 * DEFORM step.
225 */
227
228 /* Process container subscripts; possibly short-circuit result to NULL */
230
231 /*
232 * Compute old container element/slice when a SubscriptingRef assignment
233 * expression contains SubscriptingRef/FieldStore subexpressions. Value is
234 * accessed using the CaseTest mechanism.
235 */
237
238 /* compute new value for SubscriptingRef assignment expression */
240
241 /* compute element/slice for SubscriptingRef fetch expression */
243
244 /* evaluate value for CoerceToDomainValue */
247
248 /* evaluate a domain's NOT NULL constraint */
250
251 /* evaluate a single domain CHECK constraint */
253
254 /* evaluation steps for hashing */
260
261 /* evaluate assorted special-purpose expression types */
276
277 /* aggregation related nodes */
294
295 /* non-existent operation, used e.g. to check array lengths */
298
299
300typedef struct ExprEvalStep
301{
302 /*
303 * Instruction to be executed. During instruction preparation this is an
304 * enum ExprEvalOp, but later it can be changed to some other type, e.g. a
305 * pointer for computed goto (that's why it's an intptr_t).
306 */
307 intptr_t opcode;
308
309 /* where to store the result of this step */
311 bool *resnull;
312
313 /*
314 * Inline data for the operation. Inline data is faster to access, but
315 * also bloats the size of all instructions. The union should be kept to
316 * no more than 40 bytes on 64-bit systems (so that the entire struct is
317 * no more than 64 bytes, a single cacheline on common systems).
318 */
319 union
320 {
321 /* for EEOP_INNER/OUTER/SCAN/OLD/NEW_FETCHSOME */
322 struct
323 {
324 /* attribute number up to which to fetch (inclusive) */
326 /* will the type of slot be the same for every invocation */
327 bool fixed;
328 /* tuple descriptor, if known */
330 /* type of slot, can only be relied upon if fixed is set */
333
334 /* for EEOP_INNER/OUTER/SCAN/OLD/NEW_[SYS]VAR */
335 struct
336 {
337 /* attnum is attr number - 1 for regular VAR ... */
338 /* but it's just the normal (negative) attr number for SYSVAR */
340 Oid vartype; /* type OID of variable */
341 VarReturningType varreturningtype; /* return old/new/default */
343
344 /* for EEOP_WHOLEROW */
345 struct
346 {
347 Var *var; /* original Var node in plan tree */
348 bool first; /* first time through, need to initialize? */
349 bool slow; /* need runtime check for nulls? */
350 TupleDesc tupdesc; /* descriptor for resulting tuples */
351 JunkFilter *junkFilter; /* JunkFilter to remove resjunk cols */
353
354 /* for EEOP_ASSIGN_*_VAR */
355 struct
356 {
357 /* target index in ExprState->resultslot->tts_values/nulls */
359 /* source attribute number - 1 */
360 int attnum;
362
363 /* for EEOP_ASSIGN_TMP[_MAKE_RO] */
364 struct
365 {
366 /* target index in ExprState->resultslot->tts_values/nulls */
367 int resultnum;
369
370 /* for EEOP_RETURNINGEXPR */
371 struct
372 {
373 uint8 nullflag; /* flag to test if OLD/NEW row is NULL */
374 int jumpdone; /* jump here if OLD/NEW row is NULL */
376
377 /* for EEOP_CONST */
378 struct
379 {
380 /* constant's value */
382 bool isnull;
384
385 /* for EEOP_FUNCEXPR_* / NULLIF / DISTINCT */
386 struct
387 {
388 FmgrInfo *finfo; /* function's lookup data */
389 FunctionCallInfo fcinfo_data; /* arguments etc */
390 /* faster to access without additional indirection: */
391 PGFunction fn_addr; /* actual call address */
392 int nargs; /* number of arguments */
393 bool make_ro; /* make arg0 R/O (used only for NULLIF) */
395
396 /* for EEOP_BOOL_*_STEP */
397 struct
398 {
399 bool *anynull; /* track if any input was NULL */
400 int jumpdone; /* jump here if result determined */
402
403 /* for EEOP_QUAL */
404 struct
405 {
406 int jumpdone; /* jump here on false or null */
408
409 /* for EEOP_JUMP[_CONDITION] */
410 struct
411 {
412 int jumpdone; /* target instruction's index */
414
415 /* for EEOP_NULLTEST_ROWIS[NOT]NULL */
416 struct
417 {
418 /* cached descriptor for composite type - filled at runtime */
421
422 /* for EEOP_PARAM_EXEC/EXTERN and EEOP_PARAM_SET */
423 struct
424 {
425 int paramid; /* numeric ID for parameter */
426 Oid paramtype; /* OID of parameter's datatype */
428
429 /* for EEOP_PARAM_CALLBACK */
430 struct
431 {
432 ExecEvalSubroutine paramfunc; /* add-on evaluation subroutine */
433 void *paramarg; /* private data for same */
434 void *paramarg2; /* more private data for same */
435 int paramid; /* numeric ID for parameter */
436 Oid paramtype; /* OID of parameter's datatype */
438
439 /* for EEOP_CASE_TESTVAL/DOMAIN_TESTVAL */
440 struct
441 {
442 Datum *value; /* value to return */
443 bool *isnull;
445
446 /* for EEOP_MAKE_READONLY */
447 struct
448 {
449 Datum *value; /* value to coerce to read-only */
450 bool *isnull;
452
453 /* for EEOP_IOCOERCE */
454 struct
455 {
456 /* lookup and call info for source type's output function */
459 /* lookup and call info for result type's input function */
463
464 /* for EEOP_SQLVALUEFUNCTION */
465 struct
466 {
469
470 /* for EEOP_NEXTVALUEEXPR */
471 struct
472 {
476
477 /* for EEOP_ARRAYEXPR */
478 struct
479 {
480 Datum *elemvalues; /* element values get stored here */
482 int nelems; /* length of the above arrays */
483 Oid elemtype; /* array element type */
484 int16 elemlength; /* typlen of the array element type */
485 bool elembyval; /* is the element type pass-by-value? */
486 char elemalign; /* typalign of the element type */
487 bool multidims; /* is array expression multi-D? */
489
490 /* for EEOP_ARRAYCOERCE */
491 struct
492 {
493 ExprState *elemexprstate; /* null if no per-element work */
494 Oid resultelemtype; /* element type of result array */
495 struct ArrayMapState *amstate; /* workspace for array_map */
497
498 /* for EEOP_ROW */
499 struct
500 {
501 TupleDesc tupdesc; /* descriptor for result tuples */
502 /* workspace for the values constituting the row: */
504 bool *elemnulls;
506
507 /* for EEOP_ROWCOMPARE_STEP */
508 struct
509 {
510 /* lookup and call data for column comparison function */
514 /* target for comparison resulting in NULL */
516 /* target for comparison yielding inequality */
517 int jumpdone;
519
520 /* for EEOP_ROWCOMPARE_FINAL */
521 struct
522 {
525
526 /* for EEOP_MINMAX */
527 struct
528 {
529 /* workspace for argument values */
531 bool *nulls;
532 int nelems;
533 /* is it GREATEST or LEAST? */
535 /* lookup and call data for comparison function */
539
540 /* for EEOP_FIELDSELECT */
541 struct
542 {
543 AttrNumber fieldnum; /* field number to extract */
544 Oid resulttype; /* field's type */
545 /* cached descriptor for composite type - filled at runtime */
548
549 /* for EEOP_FIELDSTORE_DEFORM / FIELDSTORE_FORM */
550 struct
551 {
552 /* original expression node */
554
555 /* cached descriptor for composite type - filled at runtime */
556 /* note that a DEFORM and FORM pair share the same cache */
558
559 /* workspace for column values */
560 Datum *values;
561 bool *nulls;
564
565 /* for EEOP_SBSREF_SUBSCRIPTS */
566 struct
567 {
568 ExecEvalBoolSubroutine subscriptfunc; /* evaluation subroutine */
569 /* too big to have inline */
571 int jumpdone; /* jump here on null */
573
574 /* for EEOP_SBSREF_OLD / ASSIGN / FETCH */
575 struct
576 {
577 ExecEvalSubroutine subscriptfunc; /* evaluation subroutine */
578 /* too big to have inline */
581
582 /* for EEOP_DOMAIN_NOTNULL / DOMAIN_CHECK */
583 struct
584 {
585 /* name of constraint */
587 /* where the result of a CHECK constraint will be stored */
590 /* OID of domain type */
594
595 /* for EEOP_HASH_SET_INITVAL */
596 struct
597 {
599
601
602 /* for EEOP_HASHDATUM_(FIRST|NEXT32)[_STRICT] */
603 struct
604 {
605 FmgrInfo *finfo; /* function's lookup data */
606 FunctionCallInfo fcinfo_data; /* arguments etc */
607 /* faster to access without additional indirection: */
608 PGFunction fn_addr; /* actual call address */
609 int jumpdone; /* jump here on null */
610 NullableDatum *iresult; /* intermediate hash result */
612
613 /* for EEOP_CONVERT_ROWTYPE */
614 struct
615 {
616 Oid inputtype; /* input composite type */
617 Oid outputtype; /* output composite type */
618 /* these three fields are filled at runtime: */
619 ExprEvalRowtypeCache *incache; /* cache for input type */
620 ExprEvalRowtypeCache *outcache; /* cache for output type */
621 TupleConversionMap *map; /* column mapping */
623
624 /* for EEOP_SCALARARRAYOP */
625 struct
626 {
627 /* element_type/typlen/typbyval/typalign are filled at runtime */
628 Oid element_type; /* InvalidOid if not yet filled */
629 bool useOr; /* use OR or AND semantics? */
630 int16 typlen; /* array element type storage info */
633 FmgrInfo *finfo; /* function's lookup data */
634 FunctionCallInfo fcinfo_data; /* arguments etc */
635 /* faster to access without additional indirection: */
636 PGFunction fn_addr; /* actual call address */
638
639 /* for EEOP_HASHED_SCALARARRAYOP */
640 struct
641 {
643 bool inclause; /* true for IN and false for NOT IN */
645 FmgrInfo *finfo; /* function's lookup data */
646 FunctionCallInfo fcinfo_data; /* arguments etc */
649
650 /* for EEOP_XMLEXPR */
651 struct
652 {
653 XmlExpr *xexpr; /* original expression node */
654 /* workspace for evaluating named args, if any */
657 /* workspace for evaluating unnamed args, if any */
659 bool *argnull;
661
662 /* for EEOP_JSON_CONSTRUCTOR */
663 struct
664 {
667
668 /* for EEOP_AGGREF */
669 struct
670 {
671 int aggno;
673
674 /* for EEOP_GROUPING_FUNC */
675 struct
676 {
677 List *clauses; /* integer list of column numbers */
679
680 /* for EEOP_WINDOW_FUNC */
681 struct
682 {
683 /* out-of-line state, modified by nodeWindowAgg.c */
686
687 /* for EEOP_SUBPLAN */
688 struct
689 {
690 /* out-of-line state, created by nodeSubplan.c */
693
694 /* for EEOP_AGG_*DESERIALIZE */
695 struct
696 {
698 int jumpnull;
700
701 /* for EEOP_AGG_STRICT_INPUT_CHECK_NULLS / STRICT_INPUT_CHECK_ARGS */
702 struct
703 {
704 /*
705 * For EEOP_AGG_STRICT_INPUT_CHECK_ARGS args contains pointers to
706 * the NullableDatums that need to be checked for NULLs.
707 *
708 * For EEOP_AGG_STRICT_INPUT_CHECK_NULLS nulls contains pointers
709 * to booleans that need to be checked for NULLs.
710 *
711 * Both cases currently need to exist because sometimes the
712 * to-be-checked nulls are in TupleTableSlot.isnull array, and
713 * sometimes in FunctionCallInfoBaseData.args[i].isnull.
714 */
716 bool *nulls;
717 int nargs;
718 int jumpnull;
720
721 /* for EEOP_AGG_PLAIN_PERGROUP_NULLCHECK */
722 struct
723 {
725 int jumpnull;
727
728 /* for EEOP_AGG_PRESORTED_DISTINCT_{SINGLE,MULTI} */
729 struct
730 {
735
736 /* for EEOP_AGG_PLAIN_TRANS_[INIT_][STRICT_]{BYVAL,BYREF} */
737 /* for EEOP_AGG_ORDERED_TRANS_{DATUM,TUPLE} */
738 struct
739 {
742 int setno;
744 int setoff;
746
747 /* for EEOP_IS_JSON */
748 struct
749 {
750 JsonIsPredicate *pred; /* original expression node */
752
753 /* for EEOP_JSONEXPR_PATH */
754 struct
755 {
758
759 /* for EEOP_JSONEXPR_COERCION */
760 struct
761 {
765 /* exists_* fields only relevant for JSON_EXISTS_OP. */
772 } d;
774
775/* Enforce the size rule given in the comment above */
777 "size of ExprEvalStep exceeds 64 bytes");
778
779
780/* Non-inline data for container operations */
782{
783 bool isassignment; /* is it assignment, or just fetch? */
784
785 /* workspace for type-specific subscripting code */
787
788 /* numupper and upperprovided[] are filled at expression compile time */
789 /* at runtime, subscripts are computed in upperindex[]/upperindexnull[] */
791 bool *upperprovided; /* indicates if this position is supplied */
794
795 /* similarly for lower indexes, if any */
800
801 /* for assignment, new value to assign is evaluated into here */
804
805 /* if we have a nested assignment, sbs_fetch_old puts old value here */
809
810/* Execution step methods used for SubscriptingRef */
811typedef struct SubscriptExecSteps
812{
813 /* See nodes/subscripting.h for more detail about these */
815 ExecEvalSubroutine sbs_fetch; /* fetch an element */
816 ExecEvalSubroutine sbs_assign; /* assign to an element */
817 ExecEvalSubroutine sbs_fetch_old; /* fetch old value for assignment */
819
820/* EEOP_JSON_CONSTRUCTOR state, too big to inline */
822{
827 struct
828 {
831 } *arg_type_cache; /* cache for datum_to_json[b]() */
832 int nargs;
834
835
836/* functions in execExpr.c */
837extern void ExprEvalPushStep(ExprState *es, const ExprEvalStep *s);
838
839/* functions in execExprInterp.c */
842
843extern Datum ExecInterpExprStillValid(ExprState *state, ExprContext *econtext, bool *isNull);
844extern void CheckExprStillValid(ExprState *state, ExprContext *econtext);
845
846/*
847 * Non fast-path execution functions. These are externs instead of statics in
848 * execExprInterp.c, because that allows them to be used by other methods of
849 * expression evaluation, reducing code duplication.
850 */
852 ExprContext *econtext);
854 ExprContext *econtext);
856 ExprContext *econtext);
858 ExprContext *econtext);
860 ExprContext *econtext);
866 ExprContext *econtext);
868 ExprContext *econtext);
871 ExprContext *econtext);
872extern void ExecEvalRow(ExprState *state, ExprEvalStep *op);
873extern void ExecEvalMinMax(ExprState *state, ExprEvalStep *op);
875 ExprContext *econtext);
877 ExprContext *econtext);
879 ExprContext *econtext);
881 ExprContext *econtext);
884 ExprContext *econtext);
889 ExprContext *econtext);
892 ExprContext *econtext);
894 ExprContext *econtext);
898 ExprContext *econtext);
900 ExprContext *econtext);
902 ExprContext *econtext);
904 ExprContext *econtext, TupleTableSlot *slot);
905
906extern void ExecAggInitGroup(AggState *aggstate, AggStatePerTrans pertrans, AggStatePerGroup pergroup,
907 ExprContext *aggcontext);
908extern Datum ExecAggCopyTransValue(AggState *aggstate, AggStatePerTrans pertrans,
909 Datum newValue, bool newValueIsNull,
910 Datum oldValue, bool oldValueIsNull);
911extern bool ExecEvalPreOrderedDistinctSingle(AggState *aggstate,
912 AggStatePerTrans pertrans);
913extern bool ExecEvalPreOrderedDistinctMulti(AggState *aggstate,
914 AggStatePerTrans pertrans);
916 ExprContext *econtext);
918 ExprContext *econtext);
919
920#endif /* EXEC_EXPR_H */
int16 AttrNumber
Definition: attnum.h:21
uint8_t uint8
Definition: c.h:500
int16_t int16
Definition: c.h:497
int32_t int32
Definition: c.h:498
uint64_t uint64
Definition: c.h:503
CompareType
Definition: cmptype.h:32
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:2678
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:85
@ EEOP_ASSIGN_TMP
Definition: execExpr.h:110
@ EEOP_SUBPLAN
Definition: execExpr.h:275
@ EEOP_CONVERT_ROWTYPE
Definition: execExpr.h:262
@ EEOP_FUNCEXPR_STRICT_FUSAGE
Definition: execExpr.h:127
@ EEOP_ARRAYEXPR
Definition: execExpr.h:196
@ EEOP_JSONEXPR_PATH
Definition: execExpr.h:268
@ EEOP_NOT_DISTINCT
Definition: execExpr.h:190
@ EEOP_DOMAIN_TESTVAL
Definition: execExpr.h:245
@ EEOP_PARAM_EXTERN
Definition: execExpr.h:174
@ EEOP_HASHDATUM_NEXT32_STRICT
Definition: execExpr.h:259
@ EEOP_IOCOERCE_SAFE
Definition: execExpr.h:188
@ EEOP_BOOL_AND_STEP
Definition: execExpr.h:136
@ EEOP_DONE_RETURN
Definition: execExpr.h:69
@ EEOP_WHOLEROW
Definition: execExpr.h:96
@ EEOP_JSONEXPR_COERCION_FINISH
Definition: execExpr.h:270
@ EEOP_HASHDATUM_FIRST_STRICT
Definition: execExpr.h:257
@ EEOP_AGGREF
Definition: execExpr.h:271
@ EEOP_FUNCEXPR_STRICT_1
Definition: execExpr.h:124
@ EEOP_INNER_VAR
Definition: execExpr.h:82
@ EEOP_AGG_PLAIN_PERGROUP_NULLCHECK
Definition: execExpr.h:283
@ EEOP_HASHDATUM_NEXT32
Definition: execExpr.h:258
@ EEOP_ROWCOMPARE_FINAL
Definition: execExpr.h:207
@ EEOP_AGG_STRICT_DESERIALIZE
Definition: execExpr.h:278
@ EEOP_IOCOERCE
Definition: execExpr.h:187
@ EEOP_RETURNINGEXPR
Definition: execExpr.h:195
@ EEOP_GROUPING_FUNC
Definition: execExpr.h:272
@ EEOP_DOMAIN_CHECK
Definition: execExpr.h:252
@ EEOP_BOOLTEST_IS_NOT_FALSE
Definition: execExpr.h:170
@ EEOP_PARAM_SET
Definition: execExpr.h:177
@ EEOP_NEXTVALUEEXPR
Definition: execExpr.h:194
@ EEOP_NEW_SYSVAR
Definition: execExpr.h:93
@ EEOP_AGG_PLAIN_TRANS_BYREF
Definition: execExpr.h:289
@ EEOP_QUAL
Definition: execExpr.h:148
@ EEOP_AGG_PRESORTED_DISTINCT_MULTI
Definition: execExpr.h:291
@ EEOP_AGG_PLAIN_TRANS_BYVAL
Definition: execExpr.h:286
@ EEOP_SCAN_VAR
Definition: execExpr.h:84
@ EEOP_CASE_TESTVAL_EXT
Definition: execExpr.h:181
@ EEOP_BOOL_NOT_STEP
Definition: execExpr.h:145
@ EEOP_ASSIGN_SCAN_VAR
Definition: execExpr.h:105
@ EEOP_NEW_VAR
Definition: execExpr.h:86
@ EEOP_SCAN_SYSVAR
Definition: execExpr.h:91
@ EEOP_SCALARARRAYOP
Definition: execExpr.h:263
@ EEOP_DOMAIN_NOTNULL
Definition: execExpr.h:249
@ EEOP_WINDOW_FUNC
Definition: execExpr.h:273
@ EEOP_INNER_FETCHSOME
Definition: execExpr.h:75
@ EEOP_NULLTEST_ROWISNOTNULL
Definition: execExpr.h:164
@ EEOP_ASSIGN_OUTER_VAR
Definition: execExpr.h:104
@ EEOP_ROW
Definition: execExpr.h:198
@ EEOP_MAKE_READONLY
Definition: execExpr.h:184
@ EEOP_FIELDSTORE_FORM
Definition: execExpr.h:226
@ EEOP_ASSIGN_OLD_VAR
Definition: execExpr.h:106
@ EEOP_SBSREF_SUBSCRIPTS
Definition: execExpr.h:229
@ EEOP_FUNCEXPR_STRICT_2
Definition: execExpr.h:125
@ EEOP_SBSREF_FETCH
Definition: execExpr.h:242
@ EEOP_FUNCEXPR_STRICT
Definition: execExpr.h:123
@ EEOP_NULLIF
Definition: execExpr.h:191
@ EEOP_CURRENTOFEXPR
Definition: execExpr.h:193
@ EEOP_INNER_SYSVAR
Definition: execExpr.h:89
@ EEOP_ASSIGN_TMP_MAKE_RO
Definition: execExpr.h:112
@ EEOP_CONST
Definition: execExpr.h:115
@ EEOP_BOOL_OR_STEP_LAST
Definition: execExpr.h:142
@ EEOP_JSONEXPR_COERCION
Definition: execExpr.h:269
@ EEOP_BOOL_OR_STEP_FIRST
Definition: execExpr.h:140
@ EEOP_XMLEXPR
Definition: execExpr.h:265
@ EEOP_AGG_STRICT_INPUT_CHECK_NULLS
Definition: execExpr.h:282
@ EEOP_SBSREF_ASSIGN
Definition: execExpr.h:239
@ EEOP_OUTER_SYSVAR
Definition: execExpr.h:90
@ EEOP_ASSIGN_INNER_VAR
Definition: execExpr.h:103
@ EEOP_BOOL_OR_STEP
Definition: execExpr.h:141
@ EEOP_AGG_STRICT_INPUT_CHECK_ARGS_1
Definition: execExpr.h:281
@ EEOP_OUTER_FETCHSOME
Definition: execExpr.h:76
@ EEOP_AGG_STRICT_INPUT_CHECK_ARGS
Definition: execExpr.h:280
@ EEOP_NULLTEST_ROWISNULL
Definition: execExpr.h:163
@ EEOP_BOOLTEST_IS_TRUE
Definition: execExpr.h:167
@ EEOP_FUNCEXPR
Definition: execExpr.h:122
@ EEOP_NULLTEST_ISNOTNULL
Definition: execExpr.h:160
@ EEOP_ROWCOMPARE_STEP
Definition: execExpr.h:204
@ EEOP_MERGE_SUPPORT_FUNC
Definition: execExpr.h:274
@ EEOP_AGG_DESERIALIZE
Definition: execExpr.h:279
@ EEOP_LAST
Definition: execExpr.h:296
@ EEOP_HASHDATUM_FIRST
Definition: execExpr.h:256
@ EEOP_DISTINCT
Definition: execExpr.h:189
@ EEOP_JUMP_IF_NOT_TRUE
Definition: execExpr.h:156
@ EEOP_FUNCEXPR_FUSAGE
Definition: execExpr.h:126
@ EEOP_AGG_PRESORTED_DISTINCT_SINGLE
Definition: execExpr.h:290
@ EEOP_BOOL_AND_STEP_FIRST
Definition: execExpr.h:135
@ EEOP_JUMP
Definition: execExpr.h:151
@ EEOP_DONE_NO_RETURN
Definition: execExpr.h:72
@ EEOP_PARAM_CALLBACK
Definition: execExpr.h:175
@ EEOP_DOMAIN_TESTVAL_EXT
Definition: execExpr.h:246
@ EEOP_OLD_SYSVAR
Definition: execExpr.h:92
@ EEOP_BOOL_AND_STEP_LAST
Definition: execExpr.h:137
@ EEOP_NEW_FETCHSOME
Definition: execExpr.h:79
@ EEOP_AGG_ORDERED_TRANS_DATUM
Definition: execExpr.h:292
@ EEOP_OLD_FETCHSOME
Definition: execExpr.h:78
@ EEOP_ASSIGN_NEW_VAR
Definition: execExpr.h:107
@ EEOP_SBSREF_OLD
Definition: execExpr.h:236
@ EEOP_SQLVALUEFUNCTION
Definition: execExpr.h:192
@ EEOP_HASHDATUM_SET_INITVAL
Definition: execExpr.h:255
@ EEOP_JUMP_IF_NOT_NULL
Definition: execExpr.h:155
@ EEOP_AGG_PLAIN_TRANS_STRICT_BYREF
Definition: execExpr.h:288
@ EEOP_FIELDSTORE_DEFORM
Definition: execExpr.h:219
@ EEOP_BOOLTEST_IS_FALSE
Definition: execExpr.h:169
@ EEOP_BOOLTEST_IS_NOT_TRUE
Definition: execExpr.h:168
@ EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYVAL
Definition: execExpr.h:284
@ EEOP_PARAM_EXEC
Definition: execExpr.h:173
@ EEOP_JSON_CONSTRUCTOR
Definition: execExpr.h:266
@ EEOP_AGG_PLAIN_TRANS_STRICT_BYVAL
Definition: execExpr.h:285
@ EEOP_NULLTEST_ISNULL
Definition: execExpr.h:159
@ EEOP_MINMAX
Definition: execExpr.h:210
@ EEOP_JUMP_IF_NULL
Definition: execExpr.h:154
@ EEOP_ARRAYCOERCE
Definition: execExpr.h:197
@ EEOP_FIELDSELECT
Definition: execExpr.h:213
@ EEOP_CASE_TESTVAL
Definition: execExpr.h:180
@ EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYREF
Definition: execExpr.h:287
@ EEOP_HASHED_SCALARARRAYOP
Definition: execExpr.h:264
@ EEOP_OUTER_VAR
Definition: execExpr.h:83
@ EEOP_AGG_ORDERED_TRANS_TUPLE
Definition: execExpr.h:293
@ EEOP_SCAN_FETCHSOME
Definition: execExpr.h:77
@ EEOP_IS_JSON
Definition: execExpr.h:267
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:30
MinMaxOp
Definition: primnodes.h:1506
VarReturningType
Definition: primnodes.h:255
XmlExpr * xexpr
Definition: execExpr.h:653
JsonIsPredicate * pred
Definition: execExpr.h:750
Datum * value
Definition: execExpr.h:442
uint8 nullflag
Definition: execExpr.h:373
Var * var
Definition: execExpr.h:347
void * paramarg
Definition: execExpr.h:433
bool * anynull
Definition: execExpr.h:399
ExprState * elemexprstate
Definition: execExpr.h:493
MinMaxOp op
Definition: execExpr.h:534
bool typbyval
Definition: execExpr.h:631
char elemalign
Definition: execExpr.h:486
struct ExprEvalStep::@55::@94 grouping_func
struct ExprEvalStep::@55::@66 jump
List * clauses
Definition: execExpr.h:677
WindowFuncExprState * wfstate
Definition: execExpr.h:684
void * json_coercion_cache
Definition: execExpr.h:769
ExecEvalBoolSubroutine subscriptfunc
Definition: execExpr.h:568
bool exists_coerce
Definition: execExpr.h:766
TupleDesc tupdesc
Definition: execExpr.h:350
Oid seqtypid
Definition: execExpr.h:474
ExprEvalRowtypeCache * rowcache
Definition: execExpr.h:557
int last_var
Definition: execExpr.h:325
JunkFilter * junkFilter
Definition: execExpr.h:351
struct ExprEvalStep::@55::@81 fieldselect
FmgrInfo * finfo_out
Definition: execExpr.h:457
AttrNumber fieldnum
Definition: execExpr.h:543
struct ExprEvalStep::@55::@90 hashedscalararrayop
struct ExprEvalStep::@55::@92 json_constructor
bool has_nulls
Definition: execExpr.h:642
void * paramarg2
Definition: execExpr.h:434
Datum * values
Definition: execExpr.h:530
bool * elemnulls
Definition: execExpr.h:481
struct ExprEvalStep::@55::@60 assign_tmp
struct ExprEvalStep::@55::@71 make_readonly
bool * checknull
Definition: execExpr.h:589
int ncolumns
Definition: execExpr.h:562
bool * named_argnull
Definition: execExpr.h:656
struct ExprEvalStep::@55::@57 var
Oid outputtype
Definition: execExpr.h:617
struct ExprEvalStep::@55::@82 fieldstore
struct ExprEvalStep::@55::@85 domaincheck
struct ExprEvalStep::@55::@102 is_json
struct ScalarArrayOpExprHashTable * elements_tab
Definition: execExpr.h:644
bool inclause
Definition: execExpr.h:643
struct SubscriptingRefState * state
Definition: execExpr.h:570
SubPlanState * sstate
Definition: execExpr.h:691
bool multidims
Definition: execExpr.h:487
bool exists_cast_to_int
Definition: execExpr.h:767
VarReturningType varreturningtype
Definition: execExpr.h:341
int16 elemlength
Definition: execExpr.h:484
AggStatePerTrans pertrans
Definition: execExpr.h:731
struct ExprEvalStep::@55::@104 jsonexpr_coercion
struct ExprEvalStep::@55::@78 rowcompare_step
struct ExprEvalStep::@55::@83 sbsref_subscript
struct JsonExprState * jsestate
Definition: execExpr.h:756
bool * isnull
Definition: execExpr.h:443
TupleConversionMap * map
Definition: execExpr.h:621
bool * argnull
Definition: execExpr.h:659
struct ExprEvalStep::@55::@91 xmlexpr
struct ExprEvalStep::@55::@84 sbsref
intptr_t opcode
Definition: execExpr.h:307
struct ExprEvalStep::@55::@67 nulltest_row
Oid inputtype
Definition: execExpr.h:616
struct ExprEvalStep::@55::@69 cparam
char typalign
Definition: execExpr.h:632
ExecEvalSubroutine paramfunc
Definition: execExpr.h:432
FunctionCallInfo fcinfo_data_in
Definition: execExpr.h:461
bool elembyval
Definition: execExpr.h:485
PGFunction fn_addr
Definition: execExpr.h:391
TupleDesc known_desc
Definition: execExpr.h:329
NullableDatum * args
Definition: execExpr.h:715
int resultnum
Definition: execExpr.h:358
bool * nulls
Definition: execExpr.h:531
Datum * resvalue
Definition: execExpr.h:310
struct ExprEvalStep::@55::@77 row
Datum * elemvalues
Definition: execExpr.h:480
NullableDatum * iresult
Definition: execExpr.h:610
int jumpnull
Definition: execExpr.h:515
Oid resulttype
Definition: execExpr.h:544
ExprEvalRowtypeCache * incache
Definition: execExpr.h:619
struct ExprEvalStep::@55::@103 jsonexpr
struct ExprEvalStep::@55::@74 nextvalueexpr
struct ExprEvalStep::@55::@86 hashdatum_initvalue
bool exists_check_domain
Definition: execExpr.h:768
ScalarArrayOpExpr * saop
Definition: execExpr.h:647
const TupleTableSlotOps * kind
Definition: execExpr.h:331
Oid resultelemtype
Definition: execExpr.h:494
struct ExprEvalStep::@55::@99 agg_plain_pergroup_nullcheck
struct ExprEvalStep::@55::@62 constval
FunctionCallInfo fcinfo_data
Definition: execExpr.h:389
int jumpdistinct
Definition: execExpr.h:733
Datum * checkvalue
Definition: execExpr.h:588
struct ExprEvalStep::@55::@93 aggref
FmgrInfo * finfo_in
Definition: execExpr.h:460
struct ExprEvalStep::@55::@97 agg_deserialize
int jumpdone
Definition: execExpr.h:374
Datum * named_argvalue
Definition: execExpr.h:655
struct ExprEvalStep::@55::@95 window_func
struct ExprEvalStep::@55::@61 returningexpr
struct ExprEvalStep::@55::@72 iocoerce
ErrorSaveContext * escontext
Definition: execExpr.h:592
Oid paramtype
Definition: execExpr.h:426
union ExprEvalStep::@55 d
struct ExprEvalStep::@55::@98 agg_strict_input_check
bool fixed
Definition: execExpr.h:327
struct ExprEvalStep::@55::@80 minmax
struct ExprEvalStep::@55::@88 convert_rowtype
struct ExprEvalStep::@55::@79 rowcompare_final
Datum value
Definition: execExpr.h:381
bool useOr
Definition: execExpr.h:629
int32 targettypmod
Definition: execExpr.h:763
struct ExprEvalStep::@55::@70 casetest
bool make_ro
Definition: execExpr.h:393
struct ExprEvalStep::@55::@75 arrayexpr
struct ExprEvalStep::@55::@89 scalararrayop
struct ExprEvalStep::@55::@100 agg_presorted_distinctcheck
CompareType cmptype
Definition: execExpr.h:523
FieldStore * fstore
Definition: execExpr.h:553
struct ExprEvalStep::@55::@65 qualexpr
bool * resnull
Definition: execExpr.h:311
struct ExprEvalStep::@55::@58 wholerow
struct ExprEvalStep::@55::@101 agg_trans
FunctionCallInfo fcinfo_data_out
Definition: execExpr.h:458
ExecEvalSubroutine subscriptfunc
Definition: execExpr.h:577
ExprEvalRowtypeCache * outcache
Definition: execExpr.h:620
int16 typlen
Definition: execExpr.h:630
Datum * argvalue
Definition: execExpr.h:658
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:419
Datum init_value
Definition: execExpr.h:598
struct JsonConstructorExprState * jcstate
Definition: execExpr.h:665
FmgrInfo * finfo
Definition: execExpr.h:388
bool isnull
Definition: execExpr.h:382
ExprContext * aggcontext
Definition: execExpr.h:732
Oid elemtype
Definition: execExpr.h:483
char * constraintname
Definition: execExpr.h:586
struct ExprEvalStep::@55::@56 fetch
struct ExprEvalStep::@55::@59 assign_var
Oid element_type
Definition: execExpr.h:628
Oid targettype
Definition: execExpr.h:762
bool first
Definition: execExpr.h:348
struct ArrayMapState * amstate
Definition: execExpr.h:495
bool omit_quotes
Definition: execExpr.h:764
struct ExprEvalStep::@55::@76 arraycoerce
SQLValueFunction * svf
Definition: execExpr.h:467
Definition: fmgr.h:57
JsonConstructorExpr * constructor
Definition: execExpr.h:823
struct JsonConstructorExprState::@105 * arg_type_cache
Definition: pg_list.h:54
ExecEvalSubroutine sbs_fetch_old
Definition: execExpr.h:817
ExecEvalBoolSubroutine sbs_check_subscripts
Definition: execExpr.h:814
ExecEvalSubroutine sbs_assign
Definition: execExpr.h:816
ExecEvalSubroutine sbs_fetch
Definition: execExpr.h:815
Definition: primnodes.h:262
Definition: regguts.h:323