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-2023, 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;
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 */
245 
246  /* aggregation related nodes */
262 
263  /* non-existent operation, used e.g. to check array lengths */
264  EEOP_LAST
266 
267 
268 typedef struct ExprEvalStep
269 {
270  /*
271  * Instruction to be executed. During instruction preparation this is an
272  * enum ExprEvalOp, but later it can be changed to some other type, e.g. a
273  * pointer for computed goto (that's why it's an intptr_t).
274  */
275  intptr_t opcode;
276 
277  /* where to store the result of this step */
279  bool *resnull;
280 
281  /*
282  * Inline data for the operation. Inline data is faster to access, but
283  * also bloats the size of all instructions. The union should be kept to
284  * no more than 40 bytes on 64-bit systems (so that the entire struct is
285  * no more than 64 bytes, a single cacheline on common systems).
286  */
287  union
288  {
289  /* for EEOP_INNER/OUTER/SCAN_FETCHSOME */
290  struct
291  {
292  /* attribute number up to which to fetch (inclusive) */
293  int last_var;
294  /* will the type of slot be the same for every invocation */
295  bool fixed;
296  /* tuple descriptor, if known */
298  /* type of slot, can only be relied upon if fixed is set */
300  } fetch;
301 
302  /* for EEOP_INNER/OUTER/SCAN_[SYS]VAR[_FIRST] */
303  struct
304  {
305  /* attnum is attr number - 1 for regular VAR ... */
306  /* but it's just the normal (negative) attr number for SYSVAR */
307  int attnum;
308  Oid vartype; /* type OID of variable */
309  } var;
310 
311  /* for EEOP_WHOLEROW */
312  struct
313  {
314  Var *var; /* original Var node in plan tree */
315  bool first; /* first time through, need to initialize? */
316  bool slow; /* need runtime check for nulls? */
317  TupleDesc tupdesc; /* descriptor for resulting tuples */
318  JunkFilter *junkFilter; /* JunkFilter to remove resjunk cols */
320 
321  /* for EEOP_ASSIGN_*_VAR */
322  struct
323  {
324  /* target index in ExprState->resultslot->tts_values/nulls */
326  /* source attribute number - 1 */
327  int attnum;
329 
330  /* for EEOP_ASSIGN_TMP[_MAKE_RO] */
331  struct
332  {
333  /* target index in ExprState->resultslot->tts_values/nulls */
334  int resultnum;
336 
337  /* for EEOP_CONST */
338  struct
339  {
340  /* constant's value */
342  bool isnull;
344 
345  /* for EEOP_FUNCEXPR_* / NULLIF / DISTINCT */
346  struct
347  {
348  FmgrInfo *finfo; /* function's lookup data */
349  FunctionCallInfo fcinfo_data; /* arguments etc */
350  /* faster to access without additional indirection: */
351  PGFunction fn_addr; /* actual call address */
352  int nargs; /* number of arguments */
353  } func;
354 
355  /* for EEOP_BOOL_*_STEP */
356  struct
357  {
358  bool *anynull; /* track if any input was NULL */
359  int jumpdone; /* jump here if result determined */
361 
362  /* for EEOP_QUAL */
363  struct
364  {
365  int jumpdone; /* jump here on false or null */
367 
368  /* for EEOP_JUMP[_CONDITION] */
369  struct
370  {
371  int jumpdone; /* target instruction's index */
372  } jump;
373 
374  /* for EEOP_NULLTEST_ROWIS[NOT]NULL */
375  struct
376  {
377  /* cached descriptor for composite type - filled at runtime */
380 
381  /* for EEOP_PARAM_EXEC/EXTERN */
382  struct
383  {
384  int paramid; /* numeric ID for parameter */
385  Oid paramtype; /* OID of parameter's datatype */
386  } param;
387 
388  /* for EEOP_PARAM_CALLBACK */
389  struct
390  {
391  ExecEvalSubroutine paramfunc; /* add-on evaluation subroutine */
392  void *paramarg; /* private data for same */
393  int paramid; /* numeric ID for parameter */
394  Oid paramtype; /* OID of parameter's datatype */
396 
397  /* for EEOP_CASE_TESTVAL/DOMAIN_TESTVAL */
398  struct
399  {
400  Datum *value; /* value to return */
401  bool *isnull;
403 
404  /* for EEOP_MAKE_READONLY */
405  struct
406  {
407  Datum *value; /* value to coerce to read-only */
408  bool *isnull;
410 
411  /* for EEOP_IOCOERCE */
412  struct
413  {
414  /* lookup and call info for source type's output function */
417  /* lookup and call info for result type's input function */
421 
422  /* for EEOP_SQLVALUEFUNCTION */
423  struct
424  {
427 
428  /* for EEOP_NEXTVALUEEXPR */
429  struct
430  {
434 
435  /* for EEOP_ARRAYEXPR */
436  struct
437  {
438  Datum *elemvalues; /* element values get stored here */
439  bool *elemnulls;
440  int nelems; /* length of the above arrays */
441  Oid elemtype; /* array element type */
442  int16 elemlength; /* typlen of the array element type */
443  bool elembyval; /* is the element type pass-by-value? */
444  char elemalign; /* typalign of the element type */
445  bool multidims; /* is array expression multi-D? */
447 
448  /* for EEOP_ARRAYCOERCE */
449  struct
450  {
451  ExprState *elemexprstate; /* null if no per-element work */
452  Oid resultelemtype; /* element type of result array */
453  struct ArrayMapState *amstate; /* workspace for array_map */
455 
456  /* for EEOP_ROW */
457  struct
458  {
459  TupleDesc tupdesc; /* descriptor for result tuples */
460  /* workspace for the values constituting the row: */
461  Datum *elemvalues;
462  bool *elemnulls;
463  } row;
464 
465  /* for EEOP_ROWCOMPARE_STEP */
466  struct
467  {
468  /* lookup and call data for column comparison function */
469  FmgrInfo *finfo;
472  /* target for comparison resulting in NULL */
473  int jumpnull;
474  /* target for comparison yielding inequality */
475  int jumpdone;
477 
478  /* for EEOP_ROWCOMPARE_FINAL */
479  struct
480  {
483 
484  /* for EEOP_MINMAX */
485  struct
486  {
487  /* workspace for argument values */
489  bool *nulls;
490  int nelems;
491  /* is it GREATEST or LEAST? */
493  /* lookup and call data for comparison function */
494  FmgrInfo *finfo;
497 
498  /* for EEOP_FIELDSELECT */
499  struct
500  {
501  AttrNumber fieldnum; /* field number to extract */
502  Oid resulttype; /* field's type */
503  /* cached descriptor for composite type - filled at runtime */
506 
507  /* for EEOP_FIELDSTORE_DEFORM / FIELDSTORE_FORM */
508  struct
509  {
510  /* original expression node */
512 
513  /* cached descriptor for composite type - filled at runtime */
514  /* note that a DEFORM and FORM pair share the same cache */
516 
517  /* workspace for column values */
518  Datum *values;
519  bool *nulls;
520  int ncolumns;
522 
523  /* for EEOP_SBSREF_SUBSCRIPTS */
524  struct
525  {
526  ExecEvalBoolSubroutine subscriptfunc; /* evaluation subroutine */
527  /* too big to have inline */
529  int jumpdone; /* jump here on null */
531 
532  /* for EEOP_SBSREF_OLD / ASSIGN / FETCH */
533  struct
534  {
535  ExecEvalSubroutine subscriptfunc; /* evaluation subroutine */
536  /* too big to have inline */
537  struct SubscriptingRefState *state;
539 
540  /* for EEOP_DOMAIN_NOTNULL / DOMAIN_CHECK */
541  struct
542  {
543  /* name of constraint */
545  /* where the result of a CHECK constraint will be stored */
547  bool *checknull;
548  /* OID of domain type */
549  Oid resulttype;
551 
552  /* for EEOP_CONVERT_ROWTYPE */
553  struct
554  {
555  Oid inputtype; /* input composite type */
556  Oid outputtype; /* output composite type */
557  /* these three fields are filled at runtime: */
558  ExprEvalRowtypeCache *incache; /* cache for input type */
559  ExprEvalRowtypeCache *outcache; /* cache for output type */
560  TupleConversionMap *map; /* column mapping */
562 
563  /* for EEOP_SCALARARRAYOP */
564  struct
565  {
566  /* element_type/typlen/typbyval/typalign are filled at runtime */
567  Oid element_type; /* InvalidOid if not yet filled */
568  bool useOr; /* use OR or AND semantics? */
569  int16 typlen; /* array element type storage info */
570  bool typbyval;
571  char typalign;
572  FmgrInfo *finfo; /* function's lookup data */
573  FunctionCallInfo fcinfo_data; /* arguments etc */
574  /* faster to access without additional indirection: */
575  PGFunction fn_addr; /* actual call address */
577 
578  /* for EEOP_HASHED_SCALARARRAYOP */
579  struct
580  {
581  bool has_nulls;
582  bool inclause; /* true for IN and false for NOT IN */
584  FmgrInfo *finfo; /* function's lookup data */
585  FunctionCallInfo fcinfo_data; /* arguments etc */
588 
589  /* for EEOP_XMLEXPR */
590  struct
591  {
592  XmlExpr *xexpr; /* original expression node */
593  /* workspace for evaluating named args, if any */
596  /* workspace for evaluating unnamed args, if any */
598  bool *argnull;
600 
601  /* for EEOP_JSON_CONSTRUCTOR */
602  struct
603  {
606 
607  /* for EEOP_AGGREF */
608  struct
609  {
610  int aggno;
612 
613  /* for EEOP_GROUPING_FUNC */
614  struct
615  {
616  List *clauses; /* integer list of column numbers */
618 
619  /* for EEOP_WINDOW_FUNC */
620  struct
621  {
622  /* out-of-line state, modified by nodeWindowAgg.c */
625 
626  /* for EEOP_SUBPLAN */
627  struct
628  {
629  /* out-of-line state, created by nodeSubplan.c */
632 
633  /* for EEOP_AGG_*DESERIALIZE */
634  struct
635  {
637  int jumpnull;
639 
640  /* for EEOP_AGG_STRICT_INPUT_CHECK_NULLS / STRICT_INPUT_CHECK_ARGS */
641  struct
642  {
643  /*
644  * For EEOP_AGG_STRICT_INPUT_CHECK_ARGS args contains pointers to
645  * the NullableDatums that need to be checked for NULLs.
646  *
647  * For EEOP_AGG_STRICT_INPUT_CHECK_NULLS nulls contains pointers
648  * to booleans that need to be checked for NULLs.
649  *
650  * Both cases currently need to exist because sometimes the
651  * to-be-checked nulls are in TupleTableSlot.isnull array, and
652  * sometimes in FunctionCallInfoBaseData.args[i].isnull.
653  */
655  bool *nulls;
656  int nargs;
657  int jumpnull;
659 
660  /* for EEOP_AGG_PLAIN_PERGROUP_NULLCHECK */
661  struct
662  {
663  int setoff;
664  int jumpnull;
666 
667  /* for EEOP_AGG_PRESORTED_DISTINCT_{SINGLE,MULTI} */
668  struct
669  {
674 
675  /* for EEOP_AGG_PLAIN_TRANS_[INIT_][STRICT_]{BYVAL,BYREF} */
676  /* for EEOP_AGG_ORDERED_TRANS_{DATUM,TUPLE} */
677  struct
678  {
681  int setno;
682  int transno;
683  int setoff;
685 
686  /* for EEOP_IS_JSON */
687  struct
688  {
689  JsonIsPredicate *pred; /* original expression node */
691 
692  } d;
694 
695 /* Enforce the size rule given in the comment above */
697  "size of ExprEvalStep exceeds 64 bytes");
698 
699 
700 /* Non-inline data for container operations */
701 typedef struct SubscriptingRefState
702 {
703  bool isassignment; /* is it assignment, or just fetch? */
704 
705  /* workspace for type-specific subscripting code */
706  void *workspace;
707 
708  /* numupper and upperprovided[] are filled at expression compile time */
709  /* at runtime, subscripts are computed in upperindex[]/upperindexnull[] */
710  int numupper;
711  bool *upperprovided; /* indicates if this position is supplied */
714 
715  /* similarly for lower indexes, if any */
716  int numlower;
720 
721  /* for assignment, new value to assign is evaluated into here */
724 
725  /* if we have a nested assignment, sbs_fetch_old puts old value here */
727  bool prevnull;
729 
730 /* Execution step methods used for SubscriptingRef */
731 typedef struct SubscriptExecSteps
732 {
733  /* See nodes/subscripting.h for more detail about these */
735  ExecEvalSubroutine sbs_fetch; /* fetch an element */
736  ExecEvalSubroutine sbs_assign; /* assign to an element */
737  ExecEvalSubroutine sbs_fetch_old; /* fetch old value for assignment */
739 
740 /* EEOP_JSON_CONSTRUCTOR state, too big to inline */
742 {
745  bool *arg_nulls;
747  struct
748  {
749  int category;
751  } *arg_type_cache; /* cache for datum_to_json[b]() */
752  int nargs;
754 
755 
756 /* functions in execExpr.c */
757 extern void ExprEvalPushStep(ExprState *es, const ExprEvalStep *s);
758 
759 /* functions in execExprInterp.c */
762 
763 extern Datum ExecInterpExprStillValid(ExprState *state, ExprContext *econtext, bool *isNull);
764 extern void CheckExprStillValid(ExprState *state, ExprContext *econtext);
765 
766 /*
767  * Non fast-path execution functions. These are externs instead of statics in
768  * execExprInterp.c, because that allows them to be used by other methods of
769  * expression evaluation, reducing code duplication.
770  */
772  ExprContext *econtext);
774  ExprContext *econtext);
776  ExprContext *econtext);
778  ExprContext *econtext);
782 extern void ExecEvalRowNull(ExprState *state, ExprEvalStep *op,
783  ExprContext *econtext);
785  ExprContext *econtext);
786 extern void ExecEvalArrayExpr(ExprState *state, ExprEvalStep *op);
788  ExprContext *econtext);
789 extern void ExecEvalRow(ExprState *state, ExprEvalStep *op);
790 extern void ExecEvalMinMax(ExprState *state, ExprEvalStep *op);
792  ExprContext *econtext);
794  ExprContext *econtext);
796  ExprContext *econtext);
798  ExprContext *econtext);
801  ExprContext *econtext);
804 extern void ExecEvalXmlExpr(ExprState *state, ExprEvalStep *op);
806  ExprContext *econtext);
809 extern void ExecEvalSubPlan(ExprState *state, ExprEvalStep *op,
810  ExprContext *econtext);
812  ExprContext *econtext);
813 extern void ExecEvalSysVar(ExprState *state, ExprEvalStep *op,
814  ExprContext *econtext, TupleTableSlot *slot);
815 
816 extern void ExecAggInitGroup(AggState *aggstate, AggStatePerTrans pertrans, AggStatePerGroup pergroup,
817  ExprContext *aggcontext);
818 extern Datum ExecAggCopyTransValue(AggState *aggstate, AggStatePerTrans pertrans,
819  Datum newValue, bool newValueIsNull,
820  Datum oldValue, bool oldValueIsNull);
821 extern bool ExecEvalPreOrderedDistinctSingle(AggState *aggstate,
822  AggStatePerTrans pertrans);
823 extern bool ExecEvalPreOrderedDistinctMulti(AggState *aggstate,
824  AggStatePerTrans pertrans);
826  ExprContext *econtext);
828  ExprContext *econtext);
829 
830 #endif /* EXEC_EXPR_H */
int16 AttrNumber
Definition: attnum.h:21
signed short int16
Definition: c.h:482
unsigned char bool
Definition: c.h:445
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 ExecEvalConvertRowtype(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
bool ExecEvalPreOrderedDistinctMulti(AggState *aggstate, AggStatePerTrans pertrans)
void ExecEvalFieldSelect(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalConstraintNotNull(ExprState *state, ExprEvalStep *op)
void ExprEvalPushStep(ExprState *es, const ExprEvalStep *s)
Definition: execExpr.c:2553
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
Datum ExecAggCopyTransValue(AggState *aggstate, AggStatePerTrans pertrans, Datum newValue, bool newValueIsNull, Datum oldValue, bool oldValueIsNull)
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:244
@ 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:241
@ EEOP_INNER_VAR
Definition: execExpr.h:76
@ EEOP_AGG_PLAIN_PERGROUP_NULLCHECK
Definition: execExpr.h:251
@ EEOP_ROWCOMPARE_FINAL
Definition: execExpr.h:188
@ EEOP_AGG_STRICT_DESERIALIZE
Definition: execExpr.h:247
@ EEOP_IOCOERCE
Definition: execExpr.h:170
@ EEOP_GROUPING_FUNC
Definition: execExpr.h:242
@ 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:257
@ EEOP_QUAL
Definition: execExpr.h:134
@ EEOP_AGG_PRESORTED_DISTINCT_MULTI
Definition: execExpr.h:259
@ EEOP_AGG_PLAIN_TRANS_BYVAL
Definition: execExpr.h:254
@ 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:243
@ 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_BOOL_OR_STEP_FIRST
Definition: execExpr.h:126
@ EEOP_XMLEXPR
Definition: execExpr.h:238
@ EEOP_AGG_STRICT_INPUT_CHECK_NULLS
Definition: execExpr.h:250
@ 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:249
@ 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:248
@ EEOP_LAST
Definition: execExpr.h:264
@ EEOP_DISTINCT
Definition: execExpr.h:171
@ EEOP_JUMP_IF_NOT_TRUE
Definition: execExpr.h:142
@ EEOP_FUNCEXPR_FUSAGE
Definition: execExpr.h:112
@ EEOP_AGG_PRESORTED_DISTINCT_SINGLE
Definition: execExpr.h:258
@ 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:260
@ 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:256
@ 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:252
@ EEOP_PARAM_EXEC
Definition: execExpr.h:159
@ EEOP_JSON_CONSTRUCTOR
Definition: execExpr.h:239
@ EEOP_AGG_PLAIN_TRANS_STRICT_BYVAL
Definition: execExpr.h:253
@ 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:255
@ EEOP_HASHED_SCALARARRAYOP
Definition: execExpr.h:237
@ EEOP_OUTER_VAR
Definition: execExpr.h:77
@ EEOP_AGG_ORDERED_TRANS_TUPLE
Definition: execExpr.h:261
@ EEOP_SCAN_FETCHSOME
Definition: execExpr.h:73
@ EEOP_IS_JSON
Definition: execExpr.h:240
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:64
unsigned int Oid
Definition: postgres_ext.h:31
MinMaxOp
Definition: primnodes.h:1428
RowCompareType
Definition: primnodes.h:1380
XmlExpr * xexpr
Definition: execExpr.h:592
JsonIsPredicate * pred
Definition: execExpr.h:689
struct ExprEvalStep::@51::@63 param
Datum * value
Definition: execExpr.h:400
struct ExprEvalStep::@51::@93 agg_presorted_distinctcheck
Var * var
Definition: execExpr.h:314
struct ExprEvalStep::@51::@66 make_readonly
void * paramarg
Definition: execExpr.h:392
struct ExprEvalStep::@51::@90 agg_deserialize
bool * anynull
Definition: execExpr.h:358
ExprState * elemexprstate
Definition: execExpr.h:451
MinMaxOp op
Definition: execExpr.h:492
bool typbyval
Definition: execExpr.h:570
char elemalign
Definition: execExpr.h:444
struct ExprEvalStep::@51::@92 agg_plain_pergroup_nullcheck
struct ExprEvalStep::@51::@52 fetch
struct ExprEvalStep::@51::@85 json_constructor
List * clauses
Definition: execExpr.h:616
WindowFuncExprState * wfstate
Definition: execExpr.h:623
union ExprEvalStep::@51 d
ExecEvalBoolSubroutine subscriptfunc
Definition: execExpr.h:526
TupleDesc tupdesc
Definition: execExpr.h:317
Oid seqtypid
Definition: execExpr.h:432
ExprEvalRowtypeCache * rowcache
Definition: execExpr.h:515
int last_var
Definition: execExpr.h:293
JunkFilter * junkFilter
Definition: execExpr.h:318
FmgrInfo * finfo_out
Definition: execExpr.h:415
AttrNumber fieldnum
Definition: execExpr.h:501
struct ExprEvalStep::@51::@68 sqlvaluefunction
struct ExprEvalStep::@51::@77 fieldstore
bool has_nulls
Definition: execExpr.h:581
struct ExprEvalStep::@51::@95 is_json
struct ExprEvalStep::@51::@57 constval
struct ExprEvalStep::@51::@71 arraycoerce
Datum * values
Definition: execExpr.h:488
struct ExprEvalStep::@51::@56 assign_tmp
bool * elemnulls
Definition: execExpr.h:439
bool * checknull
Definition: execExpr.h:547
struct ExprEvalStep::@51::@81 convert_rowtype
int ncolumns
Definition: execExpr.h:520
bool * named_argnull
Definition: execExpr.h:595
Oid outputtype
Definition: execExpr.h:556
struct ScalarArrayOpExprHashTable * elements_tab
Definition: execExpr.h:583
bool inclause
Definition: execExpr.h:582
struct SubscriptingRefState * state
Definition: execExpr.h:528
RowCompareType rctype
Definition: execExpr.h:481
SubPlanState * sstate
Definition: execExpr.h:630
bool multidims
Definition: execExpr.h:445
int16 elemlength
Definition: execExpr.h:442
AggStatePerTrans pertrans
Definition: execExpr.h:670
struct ExprEvalStep::@51::@84 xmlexpr
bool * isnull
Definition: execExpr.h:401
TupleConversionMap * map
Definition: execExpr.h:560
bool * argnull
Definition: execExpr.h:598
struct ExprEvalStep::@51::@88 window_func
struct ExprEvalStep::@51::@73 rowcompare_step
intptr_t opcode
Definition: execExpr.h:275
Oid inputtype
Definition: execExpr.h:555
char typalign
Definition: execExpr.h:571
ExecEvalSubroutine paramfunc
Definition: execExpr.h:391
FunctionCallInfo fcinfo_data_in
Definition: execExpr.h:419
struct ExprEvalStep::@51::@60 qualexpr
bool elembyval
Definition: execExpr.h:443
struct ExprEvalStep::@51::@54 wholerow
struct ExprEvalStep::@51::@64 cparam
PGFunction fn_addr
Definition: execExpr.h:351
struct ExprEvalStep::@51::@78 sbsref_subscript
TupleDesc known_desc
Definition: execExpr.h:297
NullableDatum * args
Definition: execExpr.h:654
int resultnum
Definition: execExpr.h:325
bool * nulls
Definition: execExpr.h:489
Datum * resvalue
Definition: execExpr.h:278
struct ExprEvalStep::@51::@65 casetest
Datum * elemvalues
Definition: execExpr.h:438
int jumpnull
Definition: execExpr.h:473
Oid resulttype
Definition: execExpr.h:502
ExprEvalRowtypeCache * incache
Definition: execExpr.h:558
ScalarArrayOpExpr * saop
Definition: execExpr.h:586
const TupleTableSlotOps * kind
Definition: execExpr.h:299
struct ExprEvalStep::@51::@55 assign_var
Oid resultelemtype
Definition: execExpr.h:452
FunctionCallInfo fcinfo_data
Definition: execExpr.h:349
int jumpdistinct
Definition: execExpr.h:672
Datum * checkvalue
Definition: execExpr.h:546
FmgrInfo * finfo_in
Definition: execExpr.h:418
struct ExprEvalStep::@51::@94 agg_trans
int jumpdone
Definition: execExpr.h:359
Datum * named_argvalue
Definition: execExpr.h:594
struct ExprEvalStep::@51::@89 subplan
struct ExprEvalStep::@51::@67 iocoerce
struct ExprEvalStep::@51::@61 jump
Oid paramtype
Definition: execExpr.h:385
struct ExprEvalStep::@51::@91 agg_strict_input_check
struct ExprEvalStep::@51::@53 var
bool fixed
Definition: execExpr.h:295
struct ExprEvalStep::@51::@72 row
Datum value
Definition: execExpr.h:341
struct ExprEvalStep::@51::@75 minmax
struct ExprEvalStep::@51::@82 scalararrayop
bool useOr
Definition: execExpr.h:568
struct ExprEvalStep::@51::@79 sbsref
struct ExprEvalStep::@51::@80 domaincheck
FieldStore * fstore
Definition: execExpr.h:511
bool * resnull
Definition: execExpr.h:279
struct ExprEvalStep::@51::@62 nulltest_row
FunctionCallInfo fcinfo_data_out
Definition: execExpr.h:416
ExecEvalSubroutine subscriptfunc
Definition: execExpr.h:535
ExprEvalRowtypeCache * outcache
Definition: execExpr.h:559
int16 typlen
Definition: execExpr.h:569
Datum * argvalue
Definition: execExpr.h:597
struct ExprEvalStep::@51::@87 grouping_func
struct ExprEvalStep::@51::@83 hashedscalararrayop
struct ExprEvalStep::@51::@70 arrayexpr
ExprEvalRowtypeCache rowcache
Definition: execExpr.h:378
struct JsonConstructorExprState * jcstate
Definition: execExpr.h:604
FmgrInfo * finfo
Definition: execExpr.h:348
struct ExprEvalStep::@51::@59 boolexpr
bool isnull
Definition: execExpr.h:342
ExprContext * aggcontext
Definition: execExpr.h:671
Oid elemtype
Definition: execExpr.h:441
struct ExprEvalStep::@51::@74 rowcompare_final
struct ExprEvalStep::@51::@86 aggref
struct ExprEvalStep::@51::@69 nextvalueexpr
char * constraintname
Definition: execExpr.h:544
struct ExprEvalStep::@51::@58 func
struct ExprEvalStep::@51::@76 fieldselect
Oid element_type
Definition: execExpr.h:567
bool first
Definition: execExpr.h:315
struct ArrayMapState * amstate
Definition: execExpr.h:453
SQLValueFunction * svf
Definition: execExpr.h:425
Definition: fmgr.h:57
JsonConstructorExpr * constructor
Definition: execExpr.h:743
struct JsonConstructorExprState::@96 * arg_type_cache
Definition: pg_list.h:54
ExecEvalSubroutine sbs_fetch_old
Definition: execExpr.h:737
ExecEvalBoolSubroutine sbs_check_subscripts
Definition: execExpr.h:734
ExecEvalSubroutine sbs_assign
Definition: execExpr.h:736
ExecEvalSubroutine sbs_fetch
Definition: execExpr.h:735
Definition: primnodes.h:226
Definition: regguts.h:323