PostgreSQL Source Code  git master
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-2022, 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 
20 /* forward references to avoid circularity */
21 struct ExprEvalStep;
24 struct JsonbValue;
25 
26 /* Bits in ExprState->flags (see also execnodes.h for public flag bits): */
27 /* expression's interpreter has been initialized */
28 #define EEO_FLAG_INTERPRETER_INITIALIZED (1 << 1)
29 /* jump-threading is in use */
30 #define EEO_FLAG_DIRECT_THREADED (1 << 2)
31 
32 /* Typical API for out-of-line evaluation subroutines */
34  struct ExprEvalStep *op,
35  ExprContext *econtext);
36 
37 /* API for out-of-line evaluation subroutines returning bool */
39  struct ExprEvalStep *op,
40  ExprContext *econtext);
41 
42 /* ExprEvalSteps that cache a composite type's tupdesc need one of these */
43 /* (it fits in-line in some step types, otherwise allocate out-of-line) */
44 typedef struct ExprEvalRowtypeCache
45 {
46  /*
47  * cacheptr points to composite type's TypeCacheEntry if tupdesc_id is not
48  * 0; or for an anonymous RECORD type, it points directly at the cached
49  * tupdesc for the type, and tupdesc_id is 0. (We'd use separate fields
50  * if space were not at a premium.) Initial state is cacheptr == NULL.
51  */
52  void *cacheptr;
53  uint64 tupdesc_id; /* last-seen tupdesc identifier, or 0 */
55 
56 /*
57  * Discriminator for ExprEvalSteps.
58  *
59  * Identifies the operation to be executed and which member in the
60  * ExprEvalStep->d union is valid.
61  *
62  * The order of entries needs to be kept in sync with the dispatch_table[]
63  * array in execExprInterp.c:ExecInterpExpr().
64  */
65 typedef enum ExprEvalOp
66 {
67  /* entire expression has been evaluated completely, return */
69 
70  /* apply slot_getsomeattrs on corresponding tuple slot */
74 
75  /* compute non-system Var value */
79 
80  /* compute system Var value */
84 
85  /* compute wholerow Var */
87 
88  /*
89  * Compute non-system Var value, assign it into ExprState's resultslot.
90  * These are not used if a CheckVarSlotCompatibility() check would be
91  * needed.
92  */
96 
97  /* assign ExprState's resvalue/resnull to a column of its resultslot */
99  /* ditto, applying MakeExpandedObjectReadOnly() */
101 
102  /* evaluate Const value */
104 
105  /*
106  * Evaluate function call (including OpExprs etc). For speed, we
107  * distinguish in the opcode whether the function is strict and/or
108  * requires usage stats tracking.
109  */
114 
115  /*
116  * Evaluate boolean AND expression, one step per subexpression. FIRST/LAST
117  * subexpressions are special-cased for performance. Since AND always has
118  * at least two subexpressions, FIRST and LAST never apply to the same
119  * subexpression.
120  */
124 
125  /* similarly for boolean OR expression */
129 
130  /* evaluate boolean NOT expression */
132 
133  /* simplified version of BOOL_AND_STEP for use by ExecQual() */
135 
136  /* unconditional jump to another step */
138 
139  /* conditional jumps based on current result value */
143 
144  /* perform NULL tests for scalar values */
147 
148  /* perform NULL tests for row values */
151 
152  /* evaluate a BooleanTest expression */
157 
158  /* evaluate PARAM_EXEC/EXTERN parameters */
162 
163  /* return CaseTestExpr value */
165 
166  /* apply MakeExpandedObjectReadOnly() to target value */
168 
169  /* evaluate assorted special-purpose expression types */
180 
181  /*
182  * Compare two individual elements of each of two compared ROW()
183  * expressions. Skip to ROWCOMPARE_FINAL if elements are not equal.
184  */
186 
187  /* evaluate boolean value based on previous ROWCOMPARE_STEP operations */
189 
190  /* evaluate GREATEST() or LEAST() */
192 
193  /* evaluate FieldSelect expression */
195 
196  /*
197  * Deform tuple before evaluating new values for individual fields in a
198  * FieldStore expression.
199  */
201 
202  /*
203  * Form the new tuple for a FieldStore expression. Individual fields will
204  * have been evaluated into columns of the tuple deformed by the preceding
205  * DEFORM step.
206  */
208 
209  /* Process container subscripts; possibly short-circuit result to NULL */
211 
212  /*
213  * Compute old container element/slice when a SubscriptingRef assignment
214  * expression contains SubscriptingRef/FieldStore subexpressions. Value is
215  * accessed using the CaseTest mechanism.
216  */
218 
219  /* compute new value for SubscriptingRef assignment expression */
221 
222  /* compute element/slice for SubscriptingRef fetch expression */
224 
225  /* evaluate value for CoerceToDomainValue */
227 
228  /* evaluate a domain's NOT NULL constraint */
230 
231  /* evaluate a single domain CHECK constraint */
233 
234  /* evaluate assorted special-purpose expression types */
246 
247  /* aggregation related nodes */
261 
262  /* non-existent operation, used e.g. to check array lengths */
263  EEOP_LAST
265 
266 
267 typedef struct ExprEvalStep
268 {
269  /*
270  * Instruction to be executed. During instruction preparation this is an
271  * enum ExprEvalOp, but later it can be changed to some other type, e.g. a
272  * pointer for computed goto (that's why it's an intptr_t).
273  */
274  intptr_t opcode;
275 
276  /* where to store the result of this step */
278  bool *resnull;
279 
280  /*
281  * Inline data for the operation. Inline data is faster to access, but
282  * also bloats the size of all instructions. The union should be kept to
283  * no more than 40 bytes on 64-bit systems (so that the entire struct is
284  * no more than 64 bytes, a single cacheline on common systems).
285  */
286  union
287  {
288  /* for EEOP_INNER/OUTER/SCAN_FETCHSOME */
289  struct
290  {
291  /* attribute number up to which to fetch (inclusive) */
292  int last_var;
293  /* will the type of slot be the same for every invocation */
294  bool fixed;
295  /* tuple descriptor, if known */
297  /* type of slot, can only be relied upon if fixed is set */
299  } fetch;
300 
301  /* for EEOP_INNER/OUTER/SCAN_[SYS]VAR[_FIRST] */
302  struct
303  {
304  /* attnum is attr number - 1 for regular VAR ... */
305  /* but it's just the normal (negative) attr number for SYSVAR */
306  int attnum;
307  Oid vartype; /* type OID of variable */
308  } var;
309 
310  /* for EEOP_WHOLEROW */
311  struct
312  {
313  Var *var; /* original Var node in plan tree */
314  bool first; /* first time through, need to initialize? */
315  bool slow; /* need runtime check for nulls? */
316  TupleDesc tupdesc; /* descriptor for resulting tuples */
317  JunkFilter *junkFilter; /* JunkFilter to remove resjunk cols */
319 
320  /* for EEOP_ASSIGN_*_VAR */
321  struct
322  {
323  /* target index in ExprState->resultslot->tts_values/nulls */
325  /* source attribute number - 1 */
326  int attnum;
328 
329  /* for EEOP_ASSIGN_TMP[_MAKE_RO] */
330  struct
331  {
332  /* target index in ExprState->resultslot->tts_values/nulls */
333  int resultnum;
335 
336  /* for EEOP_CONST */
337  struct
338  {
339  /* constant's value */
341  bool isnull;
343 
344  /* for EEOP_FUNCEXPR_* / NULLIF / DISTINCT */
345  struct
346  {
347  FmgrInfo *finfo; /* function's lookup data */
348  FunctionCallInfo fcinfo_data; /* arguments etc */
349  /* faster to access without additional indirection: */
350  PGFunction fn_addr; /* actual call address */
351  int nargs; /* number of arguments */
352  } func;
353 
354  /* for EEOP_BOOL_*_STEP */
355  struct
356  {
357  bool *anynull; /* track if any input was NULL */
358  int jumpdone; /* jump here if result determined */
360 
361  /* for EEOP_QUAL */
362  struct
363  {
364  int jumpdone; /* jump here on false or null */
366 
367  /* for EEOP_JUMP[_CONDITION] */
368  struct
369  {
370  int jumpdone; /* target instruction's index */
371  } jump;
372 
373  /* for EEOP_NULLTEST_ROWIS[NOT]NULL */
374  struct
375  {
376  /* cached descriptor for composite type - filled at runtime */
379 
380  /* for EEOP_PARAM_EXEC/EXTERN */
381  struct
382  {
383  int paramid; /* numeric ID for parameter */
384  Oid paramtype; /* OID of parameter's datatype */
385  } param;
386 
387  /* for EEOP_PARAM_CALLBACK */
388  struct
389  {
390  ExecEvalSubroutine paramfunc; /* add-on evaluation subroutine */
391  void *paramarg; /* private data for same */
392  int paramid; /* numeric ID for parameter */
393  Oid paramtype; /* OID of parameter's datatype */
395 
396  /* for EEOP_CASE_TESTVAL/DOMAIN_TESTVAL */
397  struct
398  {
399  Datum *value; /* value to return */
400  bool *isnull;
402 
403  /* for EEOP_MAKE_READONLY */
404  struct
405  {
406  Datum *value; /* value to coerce to read-only */
407  bool *isnull;
409 
410  /* for EEOP_IOCOERCE */
411  struct
412  {
413  /* lookup and call info for source type's output function */
416  /* lookup and call info for result type's input function */
420 
421  /* for EEOP_SQLVALUEFUNCTION */
422  struct
423  {
426 
427  /* for EEOP_NEXTVALUEEXPR */
428  struct
429  {
433 
434  /* for EEOP_ARRAYEXPR */
435  struct
436  {
437  Datum *elemvalues; /* element values get stored here */
438  bool *elemnulls;
439  int nelems; /* length of the above arrays */
440  Oid elemtype; /* array element type */
441  int16 elemlength; /* typlen of the array element type */
442  bool elembyval; /* is the element type pass-by-value? */
443  char elemalign; /* typalign of the element type */
444  bool multidims; /* is array expression multi-D? */
446 
447  /* for EEOP_ARRAYCOERCE */
448  struct
449  {
450  ExprState *elemexprstate; /* null if no per-element work */
451  Oid resultelemtype; /* element type of result array */
452  struct ArrayMapState *amstate; /* workspace for array_map */
454 
455  /* for EEOP_ROW */
456  struct
457  {
458  TupleDesc tupdesc; /* descriptor for result tuples */
459  /* workspace for the values constituting the row: */
460  Datum *elemvalues;
461  bool *elemnulls;
462  } row;
463 
464  /* for EEOP_ROWCOMPARE_STEP */
465  struct
466  {
467  /* lookup and call data for column comparison function */
468  FmgrInfo *finfo;
471  /* target for comparison resulting in NULL */
472  int jumpnull;
473  /* target for comparison yielding inequality */
474  int jumpdone;
476 
477  /* for EEOP_ROWCOMPARE_FINAL */
478  struct
479  {
482 
483  /* for EEOP_MINMAX */
484  struct
485  {
486  /* workspace for argument values */
488  bool *nulls;
489  int nelems;
490  /* is it GREATEST or LEAST? */
492  /* lookup and call data for comparison function */
493  FmgrInfo *finfo;
496 
497  /* for EEOP_FIELDSELECT */
498  struct
499  {
500  AttrNumber fieldnum; /* field number to extract */
501  Oid resulttype; /* field's type */
502  /* cached descriptor for composite type - filled at runtime */
505 
506  /* for EEOP_FIELDSTORE_DEFORM / FIELDSTORE_FORM */
507  struct
508  {
509  /* original expression node */
511 
512  /* cached descriptor for composite type - filled at runtime */
513  /* note that a DEFORM and FORM pair share the same cache */
515 
516  /* workspace for column values */
517  Datum *values;
518  bool *nulls;
519  int ncolumns;
521 
522  /* for EEOP_SBSREF_SUBSCRIPTS */
523  struct
524  {
525  ExecEvalBoolSubroutine subscriptfunc; /* evaluation subroutine */
526  /* too big to have inline */
528  int jumpdone; /* jump here on null */
530 
531  /* for EEOP_SBSREF_OLD / ASSIGN / FETCH */
532  struct
533  {
534  ExecEvalSubroutine subscriptfunc; /* evaluation subroutine */
535  /* too big to have inline */
536  struct SubscriptingRefState *state;
538 
539  /* for EEOP_DOMAIN_NOTNULL / DOMAIN_CHECK */
540  struct
541  {
542  /* name of constraint */
544  /* where the result of a CHECK constraint will be stored */
546  bool *checknull;
547  /* OID of domain type */
548  Oid resulttype;
550 
551  /* for EEOP_CONVERT_ROWTYPE */
552  struct
553  {
554  Oid inputtype; /* input composite type */
555  Oid outputtype; /* output composite type */
556  /* these three fields are filled at runtime: */
557  ExprEvalRowtypeCache *incache; /* cache for input type */
558  ExprEvalRowtypeCache *outcache; /* cache for output type */
559  TupleConversionMap *map; /* column mapping */
561 
562  /* for EEOP_SCALARARRAYOP */
563  struct
564  {
565  /* element_type/typlen/typbyval/typalign are filled at runtime */
566  Oid element_type; /* InvalidOid if not yet filled */
567  bool useOr; /* use OR or AND semantics? */
568  int16 typlen; /* array element type storage info */
569  bool typbyval;
570  char typalign;
571  FmgrInfo *finfo; /* function's lookup data */
572  FunctionCallInfo fcinfo_data; /* arguments etc */
573  /* faster to access without additional indirection: */
574  PGFunction fn_addr; /* actual call address */
576 
577  /* for EEOP_HASHED_SCALARARRAYOP */
578  struct
579  {
580  bool has_nulls;
581  bool inclause; /* true for IN and false for NOT IN */
583  FmgrInfo *finfo; /* function's lookup data */
584  FunctionCallInfo fcinfo_data; /* arguments etc */
585  /* faster to access without additional indirection: */
586  PGFunction fn_addr; /* actual call address */
587  FmgrInfo *hash_finfo; /* function's lookup data */
588  FunctionCallInfo hash_fcinfo_data; /* arguments etc */
589  /* faster to access without additional indirection: */
590  PGFunction hash_fn_addr; /* actual call address */
592 
593  /* for EEOP_XMLEXPR */
594  struct
595  {
596  XmlExpr *xexpr; /* original expression node */
597  /* workspace for evaluating named args, if any */
600  /* workspace for evaluating unnamed args, if any */
602  bool *argnull;
604 
605  /* for EEOP_AGGREF */
606  struct
607  {
608  int aggno;
610 
611  /* for EEOP_GROUPING_FUNC */
612  struct
613  {
614  List *clauses; /* integer list of column numbers */
616 
617  /* for EEOP_WINDOW_FUNC */
618  struct
619  {
620  /* out-of-line state, modified by nodeWindowAgg.c */
623 
624  /* for EEOP_SUBPLAN */
625  struct
626  {
627  /* out-of-line state, created by nodeSubplan.c */
630 
631  /* for EEOP_AGG_*DESERIALIZE */
632  struct
633  {
635  int jumpnull;
637 
638  /* for EEOP_AGG_STRICT_INPUT_CHECK_NULLS / STRICT_INPUT_CHECK_ARGS */
639  struct
640  {
641  /*
642  * For EEOP_AGG_STRICT_INPUT_CHECK_ARGS args contains pointers to
643  * the NullableDatums that need to be checked for NULLs.
644  *
645  * For EEOP_AGG_STRICT_INPUT_CHECK_NULLS nulls contains pointers
646  * to booleans that need to be checked for NULLs.
647  *
648  * Both cases currently need to exist because sometimes the
649  * to-be-checked nulls are in TupleTableSlot.isnull array, and
650  * sometimes in FunctionCallInfoBaseData.args[i].isnull.
651  */
653  bool *nulls;
654  int nargs;
655  int jumpnull;
657 
658  /* for EEOP_AGG_PLAIN_PERGROUP_NULLCHECK */
659  struct
660  {
661  int setoff;
662  int jumpnull;
664 
665  /* for EEOP_AGG_PLAIN_TRANS_[INIT_][STRICT_]{BYVAL,BYREF} */
666  /* for EEOP_AGG_ORDERED_TRANS_{DATUM,TUPLE} */
667  struct
668  {
671  int setno;
672  int transno;
673  int setoff;
675 
676  /* for EEOP_JSON_CONSTRUCTOR */
677  struct
678  {
681  bool *arg_nulls;
683  struct
684  {
685  int category;
687  } *arg_type_cache; /* cache for datum_to_json[b]() */
688  int nargs;
690 
691  /* for EEOP_IS_JSON */
692  struct
693  {
694  JsonIsPredicate *pred; /* original expression node */
696 
697  /* for EEOP_JSONEXPR */
698  struct
699  {
700  JsonExpr *jsexpr; /* original expression node */
701 
702  struct
703  {
704  FmgrInfo func; /* typinput function for output type */
706  } input; /* I/O info for output type */
707 
709  *formatted_expr, /* formatted context item value */
710  *res_expr, /* result item */
711  *coercion_expr, /* input for JSON item coercion */
712  *pathspec; /* path specification value */
713 
714  ExprState *result_expr; /* coerced to output type */
715  ExprState *default_on_empty; /* ON EMPTY DEFAULT expression */
716  ExprState *default_on_error; /* ON ERROR DEFAULT expression */
717  List *args; /* passing arguments */
718 
719  void *cache; /* cache for json_populate_type() */
720 
721  struct JsonCoercionsState
722  {
723  struct JsonCoercionState
724  {
725  JsonCoercion *coercion; /* coercion expression */
726  ExprState *estate; /* coercion expression state */
727  } null,
737  } coercions; /* states for coercion from SQL/JSON item
738  * types directly to the output type */
740 
741  } d;
743 
744 
745 /* Non-inline data for container operations */
746 typedef struct SubscriptingRefState
747 {
748  bool isassignment; /* is it assignment, or just fetch? */
749 
750  /* workspace for type-specific subscripting code */
751  void *workspace;
752 
753  /* numupper and upperprovided[] are filled at expression compile time */
754  /* at runtime, subscripts are computed in upperindex[]/upperindexnull[] */
755  int numupper;
756  bool *upperprovided; /* indicates if this position is supplied */
759 
760  /* similarly for lower indexes, if any */
761  int numlower;
765 
766  /* for assignment, new value to assign is evaluated into here */
769 
770  /* if we have a nested assignment, sbs_fetch_old puts old value here */
772  bool prevnull;
774 
775 /* Execution step methods used for SubscriptingRef */
776 typedef struct SubscriptExecSteps
777 {
778  /* See nodes/subscripting.h for more detail about these */
780  ExecEvalSubroutine sbs_fetch; /* fetch an element */
781  ExecEvalSubroutine sbs_assign; /* assign to an element */
782  ExecEvalSubroutine sbs_fetch_old; /* fetch old value for assignment */
784 
785 
786 /* functions in execExpr.c */
787 extern void ExprEvalPushStep(ExprState *es, const ExprEvalStep *s);
788 
789 /* functions in execExprInterp.c */
792 
793 extern Datum ExecInterpExprStillValid(ExprState *state, ExprContext *econtext, bool *isNull);
794 extern void CheckExprStillValid(ExprState *state, ExprContext *econtext);
795 
796 /*
797  * Non fast-path execution functions. These are externs instead of statics in
798  * execExprInterp.c, because that allows them to be used by other methods of
799  * expression evaluation, reducing code duplication.
800  */
802  ExprContext *econtext);
804  ExprContext *econtext);
806  ExprContext *econtext);
808  ExprContext *econtext);
812 extern void ExecEvalRowNull(ExprState *state, ExprEvalStep *op,
813  ExprContext *econtext);
815  ExprContext *econtext);
816 extern void ExecEvalArrayExpr(ExprState *state, ExprEvalStep *op);
818  ExprContext *econtext);
819 extern void ExecEvalRow(ExprState *state, ExprEvalStep *op);
820 extern void ExecEvalMinMax(ExprState *state, ExprEvalStep *op);
822  ExprContext *econtext);
824  ExprContext *econtext);
826  ExprContext *econtext);
828  ExprContext *econtext);
831  ExprContext *econtext);
834 extern void ExecEvalXmlExpr(ExprState *state, ExprEvalStep *op);
837 extern void ExecEvalSubPlan(ExprState *state, ExprEvalStep *op,
838  ExprContext *econtext);
840  ExprContext *econtext);
841 extern void ExecEvalSysVar(ExprState *state, ExprEvalStep *op,
842  ExprContext *econtext, TupleTableSlot *slot);
844  ExprContext *econtext);
845 extern void ExecEvalJson(ExprState *state, ExprEvalStep *op,
846  ExprContext *econtext);
847 extern Datum ExecPrepareJsonItemCoercion(struct JsonbValue *item,
848  JsonReturning *returning,
849  struct JsonCoercionsState *coercions,
850  struct JsonCoercionState **pjcstate);
851 extern bool ExecEvalJsonNeedsSubTransaction(JsonExpr *jsexpr,
852  struct JsonCoercionsState *);
854  ExprContext *econtext, bool *isnull,
855  Datum caseval_datum,
856  bool caseval_isnull);
857 
858 extern void ExecAggInitGroup(AggState *aggstate, AggStatePerTrans pertrans, AggStatePerGroup pergroup,
859  ExprContext *aggcontext);
860 extern Datum ExecAggTransReparent(AggState *aggstate, AggStatePerTrans pertrans,
861  Datum newValue, bool newValueIsNull,
862  Datum oldValue, bool oldValueIsNull);
864  ExprContext *econtext);
866  ExprContext *econtext);
867 
868 #endif /* EXEC_EXPR_H */
int16 AttrNumber
Definition: attnum.h:21
signed short int16
Definition: c.h:428
unsigned char bool
Definition: c.h:391
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)
Datum ExecInterpExprStillValid(ExprState *state, ExprContext *econtext, bool *isNull)
void ExecEvalJson(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalConvertRowtype(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalFieldSelect(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalConstraintNotNull(ExprState *state, ExprEvalStep *op)
void ExprEvalPushStep(ExprState *es, const ExprEvalStep *s)
Definition: execExpr.c:2693
void ExecEvalScalarArrayOp(ExprState *state, ExprEvalStep *op)
void ExecEvalAggOrderedTransDatum(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalParamExec(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:38
struct ExprEvalStep ExprEvalStep
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 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:33
ExprEvalOp
Definition: execExpr.h:66
@ EEOP_ASSIGN_TMP
Definition: execExpr.h:98
@ EEOP_SUBPLAN
Definition: execExpr.h:242
@ EEOP_CONVERT_ROWTYPE
Definition: execExpr.h:235
@ EEOP_FUNCEXPR_STRICT_FUSAGE
Definition: execExpr.h:113
@ EEOP_ARRAYEXPR
Definition: execExpr.h:177
@ EEOP_NOT_DISTINCT
Definition: execExpr.h:172
@ EEOP_DOMAIN_TESTVAL
Definition: execExpr.h:226
@ EEOP_PARAM_EXTERN
Definition: execExpr.h:160
@ EEOP_BOOL_AND_STEP
Definition: execExpr.h:122
@ EEOP_WHOLEROW
Definition: execExpr.h:86
@ EEOP_AGGREF
Definition: execExpr.h:239
@ EEOP_INNER_VAR
Definition: execExpr.h:76
@ EEOP_AGG_PLAIN_PERGROUP_NULLCHECK
Definition: execExpr.h:252
@ EEOP_ROWCOMPARE_FINAL
Definition: execExpr.h:188
@ EEOP_AGG_STRICT_DESERIALIZE
Definition: execExpr.h:248
@ EEOP_IOCOERCE
Definition: execExpr.h:170
@ EEOP_GROUPING_FUNC
Definition: execExpr.h:240
@ EEOP_DOMAIN_CHECK
Definition: execExpr.h:232
@ EEOP_BOOLTEST_IS_NOT_FALSE
Definition: execExpr.h:156
@ EEOP_NEXTVALUEEXPR
Definition: execExpr.h:176
@ EEOP_DONE
Definition: execExpr.h:68
@ EEOP_AGG_PLAIN_TRANS_BYREF
Definition: execExpr.h:258
@ EEOP_QUAL
Definition: execExpr.h:134
@ EEOP_AGG_PLAIN_TRANS_BYVAL
Definition: execExpr.h:255
@ EEOP_SCAN_VAR
Definition: execExpr.h:78
@ EEOP_BOOL_NOT_STEP
Definition: execExpr.h:131
@ EEOP_ASSIGN_SCAN_VAR
Definition: execExpr.h:95
@ EEOP_SCAN_SYSVAR
Definition: execExpr.h:83
@ EEOP_SCALARARRAYOP
Definition: execExpr.h:236
@ EEOP_DOMAIN_NOTNULL
Definition: execExpr.h:229
@ EEOP_WINDOW_FUNC
Definition: execExpr.h:241
@ EEOP_INNER_FETCHSOME
Definition: execExpr.h:71
@ EEOP_NULLTEST_ROWISNOTNULL
Definition: execExpr.h:150
@ EEOP_ASSIGN_OUTER_VAR
Definition: execExpr.h:94
@ EEOP_ROW
Definition: execExpr.h:179
@ EEOP_MAKE_READONLY
Definition: execExpr.h:167
@ EEOP_FIELDSTORE_FORM
Definition: execExpr.h:207
@ EEOP_SBSREF_SUBSCRIPTS
Definition: execExpr.h:210
@ EEOP_SBSREF_FETCH
Definition: execExpr.h:223
@ EEOP_FUNCEXPR_STRICT
Definition: execExpr.h:111
@ EEOP_NULLIF
Definition: execExpr.h:173
@ EEOP_CURRENTOFEXPR
Definition: execExpr.h:175
@ EEOP_INNER_SYSVAR
Definition: execExpr.h:81
@ EEOP_ASSIGN_TMP_MAKE_RO
Definition: execExpr.h:100
@ EEOP_CONST
Definition: execExpr.h:103
@ EEOP_BOOL_OR_STEP_LAST
Definition: execExpr.h:128
@ EEOP_JSONEXPR
Definition: execExpr.h:245
@ EEOP_BOOL_OR_STEP_FIRST
Definition: execExpr.h:126
@ EEOP_XMLEXPR
Definition: execExpr.h:238
@ EEOP_AGG_STRICT_INPUT_CHECK_NULLS
Definition: execExpr.h:251
@ EEOP_SBSREF_ASSIGN
Definition: execExpr.h:220
@ EEOP_OUTER_SYSVAR
Definition: execExpr.h:82
@ EEOP_ASSIGN_INNER_VAR
Definition: execExpr.h:93
@ EEOP_BOOL_OR_STEP
Definition: execExpr.h:127
@ EEOP_OUTER_FETCHSOME
Definition: execExpr.h:72
@ EEOP_AGG_STRICT_INPUT_CHECK_ARGS
Definition: execExpr.h:250
@ EEOP_NULLTEST_ROWISNULL
Definition: execExpr.h:149
@ EEOP_BOOLTEST_IS_TRUE
Definition: execExpr.h:153
@ EEOP_FUNCEXPR
Definition: execExpr.h:110
@ EEOP_NULLTEST_ISNOTNULL
Definition: execExpr.h:146
@ EEOP_ROWCOMPARE_STEP
Definition: execExpr.h:185
@ EEOP_AGG_DESERIALIZE
Definition: execExpr.h:249
@ EEOP_LAST
Definition: execExpr.h:263
@ EEOP_DISTINCT
Definition: execExpr.h:171
@ EEOP_JUMP_IF_NOT_TRUE
Definition: execExpr.h:142
@ EEOP_FUNCEXPR_FUSAGE
Definition: execExpr.h:112
@ EEOP_BOOL_AND_STEP_FIRST
Definition: execExpr.h:121
@ EEOP_JUMP
Definition: execExpr.h:137
@ EEOP_PARAM_CALLBACK
Definition: execExpr.h:161
@ EEOP_BOOL_AND_STEP_LAST
Definition: execExpr.h:123
@ EEOP_AGG_ORDERED_TRANS_DATUM
Definition: execExpr.h:259
@ EEOP_SBSREF_OLD
Definition: execExpr.h:217
@ EEOP_SQLVALUEFUNCTION
Definition: execExpr.h:174
@ EEOP_JUMP_IF_NOT_NULL
Definition: execExpr.h:141
@ EEOP_AGG_PLAIN_TRANS_STRICT_BYREF
Definition: execExpr.h:257
@ EEOP_FIELDSTORE_DEFORM
Definition: execExpr.h:200
@ EEOP_BOOLTEST_IS_FALSE
Definition: execExpr.h:155
@ EEOP_BOOLTEST_IS_NOT_TRUE
Definition: execExpr.h:154
@ EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYVAL
Definition: execExpr.h:253
@ EEOP_PARAM_EXEC
Definition: execExpr.h:159
@ EEOP_JSON_CONSTRUCTOR
Definition: execExpr.h:243
@ EEOP_AGG_PLAIN_TRANS_STRICT_BYVAL
Definition: execExpr.h:254
@ EEOP_NULLTEST_ISNULL
Definition: execExpr.h:145
@ EEOP_MINMAX
Definition: execExpr.h:191
@ EEOP_JUMP_IF_NULL
Definition: execExpr.h:140
@ EEOP_ARRAYCOERCE
Definition: execExpr.h:178
@ EEOP_FIELDSELECT
Definition: execExpr.h:194
@ EEOP_CASE_TESTVAL
Definition: execExpr.h:164
@ EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYREF
Definition: execExpr.h:256
@ EEOP_HASHED_SCALARARRAYOP
Definition: execExpr.h:237
@ EEOP_OUTER_VAR
Definition: execExpr.h:77
@ EEOP_AGG_ORDERED_TRANS_TUPLE
Definition: execExpr.h:260
@ EEOP_SCAN_FETCHSOME
Definition: execExpr.h:73
@ EEOP_IS_JSON
Definition: execExpr.h:244
Datum ExecPrepareJsonItemCoercion(struct JsonbValue *item, JsonReturning *returning, struct JsonCoercionsState *coercions, struct JsonCoercionState **pjcstate)
void ExecEvalConstraintCheck(ExprState *state, ExprEvalStep *op)
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)
Datum ExecEvalExprPassingCaseValue(ExprState *estate, ExprContext *econtext, bool *isnull, Datum caseval_datum, bool caseval_isnull)
void ExecEvalAggOrderedTransTuple(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
bool ExecEvalJsonNeedsSubTransaction(JsonExpr *jsexpr, struct JsonCoercionsState *)
Datum ExecAggTransReparent(AggState *aggstate, AggStatePerTrans pertrans, Datum newValue, bool newValueIsNull, Datum oldValue, bool oldValueIsNull)
Datum(* PGFunction)(FunctionCallInfo fcinfo)
Definition: fmgr.h:40
uintptr_t Datum
Definition: postgres.h:411
unsigned int Oid
Definition: postgres_ext.h:31
MinMaxOp
Definition: primnodes.h:1147
RowCompareType
Definition: primnodes.h:1110
ExprState * estate
Definition: execExpr.h:726
JsonCoercion * coercion
Definition: execExpr.h:725
XmlExpr * xexpr
Definition: execExpr.h:596
JsonIsPredicate * pred
Definition: execExpr.h:694
Oid * arg_types
Definition: execExpr.h:682
List * args
Definition: execExpr.h:717
Datum * value
Definition: execExpr.h:399
struct ExprEvalStep::@52::@95 is_json
struct ExprEvalStep::@52::@62 jump
Var * var
Definition: execExpr.h:313
void * paramarg
Definition: execExpr.h:391
bool * anynull
Definition: execExpr.h:357
ExprState * elemexprstate
Definition: execExpr.h:450
MinMaxOp op
Definition: execExpr.h:491
struct ExprEvalStep::@52::@96::JsonCoercionsState::JsonCoercionState string
bool typbyval
Definition: execExpr.h:569
char elemalign
Definition: execExpr.h:443
struct ExprEvalStep::@52::@68 iocoerce
struct ExprEvalStep::@52::@81 domaincheck
struct ExprEvalStep::@52::@56 assign_var
struct ExprEvalStep::@52::@78 fieldstore
List * clauses
Definition: execExpr.h:614
WindowFuncExprState * wfstate
Definition: execExpr.h:621
ExecEvalBoolSubroutine subscriptfunc
Definition: execExpr.h:525
struct ExprEvalStep::@52::@75 rowcompare_final
TupleDesc tupdesc
Definition: execExpr.h:316
Oid seqtypid
Definition: execExpr.h:431
ExprEvalRowtypeCache * rowcache
Definition: execExpr.h:514
int last_var
Definition: execExpr.h:292
struct ExprEvalStep::@52::@96::JsonCoercionsState::JsonCoercionState boolean
JunkFilter * junkFilter
Definition: execExpr.h:317
NullableDatum * coercion_expr
Definition: execExpr.h:711
FmgrInfo * finfo_out
Definition: execExpr.h:414
struct ExprEvalStep::@52::@77 fieldselect
AttrNumber fieldnum
Definition: execExpr.h:500
struct ExprEvalStep::@52::@53 fetch
struct ExprEvalStep::@52::@85 xmlexpr
bool has_nulls
Definition: execExpr.h:580
Datum * values
Definition: execExpr.h:487
struct ExprEvalStep::@52::@96::JsonCoercionsState::JsonCoercionState date
ExprState * result_expr
Definition: execExpr.h:714
bool * elemnulls
Definition: execExpr.h:438
bool * checknull
Definition: execExpr.h:546
int ncolumns
Definition: execExpr.h:519
bool * named_argnull
Definition: execExpr.h:599
struct ExprEvalStep::@52::@87 grouping_func
Oid outputtype
Definition: execExpr.h:555
struct ScalarArrayOpExprHashTable * elements_tab
Definition: execExpr.h:582
bool inclause
Definition: execExpr.h:581
struct SubscriptingRefState * state
Definition: execExpr.h:527
RowCompareType rctype
Definition: execExpr.h:480
SubPlanState * sstate
Definition: execExpr.h:628
bool multidims
Definition: execExpr.h:444
PGFunction hash_fn_addr
Definition: execExpr.h:590
Oid typioparam
Definition: execExpr.h:705
int16 elemlength
Definition: execExpr.h:441
struct ExprEvalStep::@52::@79 sbsref_subscript
AggStatePerTrans pertrans
Definition: execExpr.h:669
Oid outfuncid
Definition: execExpr.h:686
struct ExprEvalStep::@52::@59 func
ExprState * default_on_empty
Definition: execExpr.h:715
NullableDatum * formatted_expr
Definition: execExpr.h:709
struct ExprEvalStep::@52::@67 make_readonly
struct ExprEvalStep::@52::@80 sbsref
bool * isnull
Definition: execExpr.h:400
struct ExprEvalStep::@52::@96::JsonCoercionsState::JsonCoercionState timestamp
TupleConversionMap * map
Definition: execExpr.h:559
bool * argnull
Definition: execExpr.h:602
struct ExprEvalStep::@52::@61 qualexpr
struct ExprEvalStep::@52::@96::JsonCoercionsState::JsonCoercionState numeric
intptr_t opcode
Definition: execExpr.h:274
Oid inputtype
Definition: execExpr.h:554
char typalign
Definition: execExpr.h:570
ExecEvalSubroutine paramfunc
Definition: execExpr.h:390
FunctionCallInfo fcinfo_data_in
Definition: execExpr.h:418
bool elembyval
Definition: execExpr.h:442
struct ExprEvalStep::@52::@94::@97 * arg_type_cache
PGFunction fn_addr
Definition: execExpr.h:350
TupleDesc known_desc
Definition: execExpr.h:296
NullableDatum * args
Definition: execExpr.h:652
int resultnum
Definition: execExpr.h:324
struct ExprEvalStep::@52::@93 agg_trans
bool * nulls
Definition: execExpr.h:488
Datum * resvalue
Definition: execExpr.h:277
struct ExprEvalStep::@52::@70 nextvalueexpr
struct ExprEvalStep::@52::@96::JsonCoercionsState::JsonCoercionState time
Datum * elemvalues
Definition: execExpr.h:437
bool * arg_nulls
Definition: execExpr.h:681
int jumpnull
Definition: execExpr.h:472
Oid resulttype
Definition: execExpr.h:501
ExprEvalRowtypeCache * incache
Definition: execExpr.h:557
ExprState * default_on_error
Definition: execExpr.h:716
const TupleTableSlotOps * kind
Definition: execExpr.h:298
Oid resultelemtype
Definition: execExpr.h:451
struct ExprEvalStep::@52::@63 nulltest_row
FunctionCallInfo fcinfo_data
Definition: execExpr.h:348
Datum * checkvalue
Definition: execExpr.h:545
struct ExprEvalStep::@52::@54 var
FmgrInfo * finfo_in
Definition: execExpr.h:417
int jumpdone
Definition: execExpr.h:358
JsonConstructorExpr * constructor
Definition: execExpr.h:679
void * cache
Definition: execExpr.h:719
Datum * named_argvalue
Definition: execExpr.h:598
struct ExprEvalStep::@52::@65 cparam
struct ExprEvalStep::@52::@96 jsonexpr
struct ExprEvalStep::@52::@76 minmax
struct ExprEvalStep::@52::@55 wholerow
Oid paramtype
Definition: execExpr.h:384
struct ExprEvalStep::@52::@96::@98 input
bool fixed
Definition: execExpr.h:294
NullableDatum * pathspec
Definition: execExpr.h:712
union ExprEvalStep::@52 d
struct ExprEvalStep::@52::@94 json_constructor
struct ExprEvalStep::@52::@57 assign_tmp
struct ExprEvalStep::@52::@72 arraycoerce
Datum value
Definition: execExpr.h:340
struct ExprEvalStep::@52::@82 convert_rowtype
bool useOr
Definition: execExpr.h:567
FmgrInfo func
Definition: execExpr.h:704
struct ExprEvalStep::@52::@96::JsonCoercionsState::JsonCoercionState composite
struct ExprEvalStep::@52::@58 constval
struct ExprEvalStep::@52::@90 agg_deserialize
Datum * arg_values
Definition: execExpr.h:680
FunctionCallInfo hash_fcinfo_data
Definition: execExpr.h:588
FieldStore * fstore
Definition: execExpr.h:510
bool * resnull
Definition: execExpr.h:278
JsonExpr * jsexpr
Definition: execExpr.h:700
NullableDatum * res_expr
Definition: execExpr.h:710
FunctionCallInfo fcinfo_data_out
Definition: execExpr.h:415
ExecEvalSubroutine subscriptfunc
Definition: execExpr.h:534
ExprEvalRowtypeCache * outcache
Definition: execExpr.h:558
int16 typlen
Definition: execExpr.h:568
Datum * argvalue
Definition: execExpr.h:601
struct ExprEvalStep::@52::@74 rowcompare_step
struct ExprEvalStep::@52::@96::JsonCoercionsState::JsonCoercionState timestamptz
FmgrInfo * hash_finfo
Definition: execExpr.h:587
struct ExprEvalStep::@52::@96::JsonCoercionsState coercions
struct ExprEvalStep::@52::@92 agg_plain_pergroup_nullcheck
struct ExprEvalStep::@52::@83 scalararrayop
int category
Definition: execExpr.h:685
struct ExprEvalStep::@52::@84 hashedscalararrayop
struct ExprEvalStep::@52::@86 aggref
ExprEvalRowtypeCache rowcache
Definition: execExpr.h:377
struct ExprEvalStep::@52::@66 casetest
FmgrInfo * finfo
Definition: execExpr.h:347
struct ExprEvalStep::@52::@89 subplan
bool isnull
Definition: execExpr.h:341
ExprContext * aggcontext
Definition: execExpr.h:670
struct ExprEvalStep::@52::@91 agg_strict_input_check
Oid elemtype
Definition: execExpr.h:440
struct ExprEvalStep::@52::@69 sqlvaluefunction
char * constraintname
Definition: execExpr.h:543
struct ExprEvalStep::@52::@60 boolexpr
struct ExprEvalStep::@52::@73 row
struct ExprEvalStep::@52::@88 window_func
Oid element_type
Definition: execExpr.h:566
struct ExprEvalStep::@52::@64 param
struct ExprEvalStep::@52::@71 arrayexpr
bool first
Definition: execExpr.h:314
struct ArrayMapState * amstate
Definition: execExpr.h:452
SQLValueFunction * svf
Definition: execExpr.h:424
struct ExprEvalStep::@52::@96::JsonCoercionsState::JsonCoercionState timetz
Definition: fmgr.h:57
Definition: pg_list.h:51
ExecEvalSubroutine sbs_fetch_old
Definition: execExpr.h:782
ExecEvalBoolSubroutine sbs_check_subscripts
Definition: execExpr.h:779
ExecEvalSubroutine sbs_assign
Definition: execExpr.h:781
ExecEvalSubroutine sbs_fetch
Definition: execExpr.h:780
Definition: primnodes.h:196
Definition: regguts.h:318