PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
primnodes.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * primnodes.h
4  * Definitions for "primitive" node types, those that are used in more
5  * than one of the parse/plan/execute stages of the query pipeline.
6  * Currently, these are mostly nodes for executable expressions
7  * and join trees.
8  *
9  *
10  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
11  * Portions Copyright (c) 1994, Regents of the University of California
12  *
13  * src/include/nodes/primnodes.h
14  *
15  *-------------------------------------------------------------------------
16  */
17 #ifndef PRIMNODES_H
18 #define PRIMNODES_H
19 
20 #include "access/attnum.h"
21 #include "nodes/pg_list.h"
22 
23 
24 /* ----------------------------------------------------------------
25  * node definitions
26  * ----------------------------------------------------------------
27  */
28 
29 /*
30  * Alias -
31  * specifies an alias for a range variable; the alias might also
32  * specify renaming of columns within the table.
33  *
34  * Note: colnames is a list of Value nodes (always strings). In Alias structs
35  * associated with RTEs, there may be entries corresponding to dropped
36  * columns; these are normally empty strings (""). See parsenodes.h for info.
37  */
38 typedef struct Alias
39 {
41  char *aliasname; /* aliased rel name (never qualified) */
42  List *colnames; /* optional list of column aliases */
43 } Alias;
44 
45 /* What to do at commit time for temporary relations */
46 typedef enum OnCommitAction
47 {
48  ONCOMMIT_NOOP, /* No ON COMMIT clause (do nothing) */
49  ONCOMMIT_PRESERVE_ROWS, /* ON COMMIT PRESERVE ROWS (do nothing) */
50  ONCOMMIT_DELETE_ROWS, /* ON COMMIT DELETE ROWS */
51  ONCOMMIT_DROP /* ON COMMIT DROP */
53 
54 /*
55  * RangeVar - range variable, used in FROM clauses
56  *
57  * Also used to represent table names in utility statements; there, the alias
58  * field is not used, and inh tells whether to apply the operation
59  * recursively to child tables. In some contexts it is also useful to carry
60  * a TEMP table indication here.
61  */
62 typedef struct RangeVar
63 {
65  char *catalogname; /* the catalog (database) name, or NULL */
66  char *schemaname; /* the schema name, or NULL */
67  char *relname; /* the relation/sequence name */
68  bool inh; /* expand rel by inheritance? recursively act
69  * on children? */
70  char relpersistence; /* see RELPERSISTENCE_* in pg_class.h */
71  Alias *alias; /* table alias & optional column aliases */
72  int location; /* token location, or -1 if unknown */
73 } RangeVar;
74 
75 /*
76  * IntoClause - target information for SELECT INTO, CREATE TABLE AS, and
77  * CREATE MATERIALIZED VIEW
78  *
79  * For CREATE MATERIALIZED VIEW, viewQuery is the parsed-but-not-rewritten
80  * SELECT Query for the view; otherwise it's NULL. (Although it's actually
81  * Query*, we declare it as Node* to avoid a forward reference.)
82  */
83 typedef struct IntoClause
84 {
86 
87  RangeVar *rel; /* target relation name */
88  List *colNames; /* column names to assign, or NIL */
89  List *options; /* options from WITH clause */
90  OnCommitAction onCommit; /* what do we do at COMMIT? */
91  char *tableSpaceName; /* table space to use, or NULL */
92  Node *viewQuery; /* materialized view's SELECT query */
93  bool skipData; /* true for WITH NO DATA */
94 } IntoClause;
95 
96 
97 /* ----------------------------------------------------------------
98  * node types for executable expressions
99  * ----------------------------------------------------------------
100  */
101 
102 /*
103  * Expr - generic superclass for executable-expression nodes
104  *
105  * All node types that are used in executable expression trees should derive
106  * from Expr (that is, have Expr as their first field). Since Expr only
107  * contains NodeTag, this is a formality, but it is an easy form of
108  * documentation. See also the ExprState node types in execnodes.h.
109  */
110 typedef struct Expr
111 {
113 } Expr;
114 
115 /*
116  * Var - expression node representing a variable (ie, a table column)
117  *
118  * Note: during parsing/planning, varnoold/varoattno are always just copies
119  * of varno/varattno. At the tail end of planning, Var nodes appearing in
120  * upper-level plan nodes are reassigned to point to the outputs of their
121  * subplans; for example, in a join node varno becomes INNER_VAR or OUTER_VAR
122  * and varattno becomes the index of the proper element of that subplan's
123  * target list. Similarly, INDEX_VAR is used to identify Vars that reference
124  * an index column rather than a heap column. (In ForeignScan and CustomScan
125  * plan nodes, INDEX_VAR is abused to signify references to columns of a
126  * custom scan tuple type.) In all these cases, varnoold/varoattno hold the
127  * original values. The code doesn't really need varnoold/varoattno, but they
128  * are very useful for debugging and interpreting completed plans, so we keep
129  * them around.
130  */
131 #define INNER_VAR 65000 /* reference to inner subplan */
132 #define OUTER_VAR 65001 /* reference to outer subplan */
133 #define INDEX_VAR 65002 /* reference to index column */
134 
135 #define IS_SPECIAL_VARNO(varno) ((varno) >= INNER_VAR)
136 
137 /* Symbols for the indexes of the special RTE entries in rules */
138 #define PRS2_OLD_VARNO 1
139 #define PRS2_NEW_VARNO 2
140 
141 typedef struct Var
142 {
144  Index varno; /* index of this var's relation in the range
145  * table, or INNER_VAR/OUTER_VAR/INDEX_VAR */
146  AttrNumber varattno; /* attribute number of this var, or zero for
147  * all */
148  Oid vartype; /* pg_type OID for the type of this var */
149  int32 vartypmod; /* pg_attribute typmod value */
150  Oid varcollid; /* OID of collation, or InvalidOid if none */
151  Index varlevelsup; /* for subquery variables referencing outer
152  * relations; 0 in a normal var, >0 means N
153  * levels up */
154  Index varnoold; /* original value of varno, for debugging */
155  AttrNumber varoattno; /* original value of varattno */
156  int location; /* token location, or -1 if unknown */
157 } Var;
158 
159 /*
160  * Const
161  *
162  * Note: for varlena data types, we make a rule that a Const node's value
163  * must be in non-extended form (4-byte header, no compression or external
164  * references). This ensures that the Const node is self-contained and makes
165  * it more likely that equal() will see logically identical values as equal.
166  */
167 typedef struct Const
168 {
170  Oid consttype; /* pg_type OID of the constant's datatype */
171  int32 consttypmod; /* typmod value, if any */
172  Oid constcollid; /* OID of collation, or InvalidOid if none */
173  int constlen; /* typlen of the constant's datatype */
174  Datum constvalue; /* the constant's value */
175  bool constisnull; /* whether the constant is null (if true,
176  * constvalue is undefined) */
177  bool constbyval; /* whether this datatype is passed by value.
178  * If true, then all the information is stored
179  * in the Datum. If false, then the Datum
180  * contains a pointer to the information. */
181  int location; /* token location, or -1 if unknown */
182 } Const;
183 
184 /*
185  * Param
186  *
187  * paramkind specifies the kind of parameter. The possible values
188  * for this field are:
189  *
190  * PARAM_EXTERN: The parameter value is supplied from outside the plan.
191  * Such parameters are numbered from 1 to n.
192  *
193  * PARAM_EXEC: The parameter is an internal executor parameter, used
194  * for passing values into and out of sub-queries or from
195  * nestloop joins to their inner scans.
196  * For historical reasons, such parameters are numbered from 0.
197  * These numbers are independent of PARAM_EXTERN numbers.
198  *
199  * PARAM_SUBLINK: The parameter represents an output column of a SubLink
200  * node's sub-select. The column number is contained in the
201  * `paramid' field. (This type of Param is converted to
202  * PARAM_EXEC during planning.)
203  *
204  * PARAM_MULTIEXPR: Like PARAM_SUBLINK, the parameter represents an
205  * output column of a SubLink node's sub-select, but here, the
206  * SubLink is always a MULTIEXPR SubLink. The high-order 16 bits
207  * of the `paramid' field contain the SubLink's subLinkId, and
208  * the low-order 16 bits contain the column number. (This type
209  * of Param is also converted to PARAM_EXEC during planning.)
210  */
211 typedef enum ParamKind
212 {
217 } ParamKind;
218 
219 typedef struct Param
220 {
222  ParamKind paramkind; /* kind of parameter. See above */
223  int paramid; /* numeric ID for parameter */
224  Oid paramtype; /* pg_type OID of parameter's datatype */
225  int32 paramtypmod; /* typmod value, if known */
226  Oid paramcollid; /* OID of collation, or InvalidOid if none */
227  int location; /* token location, or -1 if unknown */
228 } Param;
229 
230 /*
231  * Aggref
232  *
233  * The aggregate's args list is a targetlist, ie, a list of TargetEntry nodes.
234  *
235  * For a normal (non-ordered-set) aggregate, the non-resjunk TargetEntries
236  * represent the aggregate's regular arguments (if any) and resjunk TLEs can
237  * be added at the end to represent ORDER BY expressions that are not also
238  * arguments. As in a top-level Query, the TLEs can be marked with
239  * ressortgroupref indexes to let them be referenced by SortGroupClause
240  * entries in the aggorder and/or aggdistinct lists. This represents ORDER BY
241  * and DISTINCT operations to be applied to the aggregate input rows before
242  * they are passed to the transition function. The grammar only allows a
243  * simple "DISTINCT" specifier for the arguments, but we use the full
244  * query-level representation to allow more code sharing.
245  *
246  * For an ordered-set aggregate, the args list represents the WITHIN GROUP
247  * (aggregated) arguments, all of which will be listed in the aggorder list.
248  * DISTINCT is not supported in this case, so aggdistinct will be NIL.
249  * The direct arguments appear in aggdirectargs (as a list of plain
250  * expressions, not TargetEntry nodes).
251  *
252  * aggtranstype is the data type of the state transition values for this
253  * aggregate (resolved to an actual type, if agg's transtype is polymorphic).
254  * This is determined during planning and is InvalidOid before that.
255  *
256  * aggargtypes is an OID list of the data types of the direct and regular
257  * arguments. Normally it's redundant with the aggdirectargs and args lists,
258  * but in a combining aggregate, it's not because the args list has been
259  * replaced with a single argument representing the partial-aggregate
260  * transition values.
261  *
262  * aggsplit indicates the expected partial-aggregation mode for the Aggref's
263  * parent plan node. It's always set to AGGSPLIT_SIMPLE in the parser, but
264  * the planner might change it to something else. We use this mainly as
265  * a crosscheck that the Aggrefs match the plan; but note that when aggsplit
266  * indicates a non-final mode, aggtype reflects the transition data type
267  * not the SQL-level output type of the aggregate.
268  */
269 typedef struct Aggref
270 {
272  Oid aggfnoid; /* pg_proc Oid of the aggregate */
273  Oid aggtype; /* type Oid of result of the aggregate */
274  Oid aggcollid; /* OID of collation of result */
275  Oid inputcollid; /* OID of collation that function should use */
276  Oid aggtranstype; /* type Oid of aggregate's transition value */
277  List *aggargtypes; /* type Oids of direct and aggregated args */
278  List *aggdirectargs; /* direct arguments, if an ordered-set agg */
279  List *args; /* aggregated arguments and sort expressions */
280  List *aggorder; /* ORDER BY (list of SortGroupClause) */
281  List *aggdistinct; /* DISTINCT (list of SortGroupClause) */
282  Expr *aggfilter; /* FILTER expression, if any */
283  bool aggstar; /* TRUE if argument list was really '*' */
284  bool aggvariadic; /* true if variadic arguments have been
285  * combined into an array last argument */
286  char aggkind; /* aggregate kind (see pg_aggregate.h) */
287  Index agglevelsup; /* > 0 if agg belongs to outer query */
288  AggSplit aggsplit; /* expected agg-splitting mode of parent Agg */
289  int location; /* token location, or -1 if unknown */
290 } Aggref;
291 
292 /*
293  * GroupingFunc
294  *
295  * A GroupingFunc is a GROUPING(...) expression, which behaves in many ways
296  * like an aggregate function (e.g. it "belongs" to a specific query level,
297  * which might not be the one immediately containing it), but also differs in
298  * an important respect: it never evaluates its arguments, they merely
299  * designate expressions from the GROUP BY clause of the query level to which
300  * it belongs.
301  *
302  * The spec defines the evaluation of GROUPING() purely by syntactic
303  * replacement, but we make it a real expression for optimization purposes so
304  * that one Agg node can handle multiple grouping sets at once. Evaluating the
305  * result only needs the column positions to check against the grouping set
306  * being projected. However, for EXPLAIN to produce meaningful output, we have
307  * to keep the original expressions around, since expression deparse does not
308  * give us any feasible way to get at the GROUP BY clause.
309  *
310  * Also, we treat two GroupingFunc nodes as equal if they have equal arguments
311  * lists and agglevelsup, without comparing the refs and cols annotations.
312  *
313  * In raw parse output we have only the args list; parse analysis fills in the
314  * refs list, and the planner fills in the cols list.
315  */
316 typedef struct GroupingFunc
317 {
319  List *args; /* arguments, not evaluated but kept for
320  * benefit of EXPLAIN etc. */
321  List *refs; /* ressortgrouprefs of arguments */
322  List *cols; /* actual column positions set by planner */
323  Index agglevelsup; /* same as Aggref.agglevelsup */
324  int location; /* token location */
325 } GroupingFunc;
326 
327 /*
328  * WindowFunc
329  */
330 typedef struct WindowFunc
331 {
333  Oid winfnoid; /* pg_proc Oid of the function */
334  Oid wintype; /* type Oid of result of the window function */
335  Oid wincollid; /* OID of collation of result */
336  Oid inputcollid; /* OID of collation that function should use */
337  List *args; /* arguments to the window function */
338  Expr *aggfilter; /* FILTER expression, if any */
339  Index winref; /* index of associated WindowClause */
340  bool winstar; /* TRUE if argument list was really '*' */
341  bool winagg; /* is function a simple aggregate? */
342  int location; /* token location, or -1 if unknown */
343 } WindowFunc;
344 
345 /* ----------------
346  * ArrayRef: describes an array subscripting operation
347  *
348  * An ArrayRef can describe fetching a single element from an array,
349  * fetching a subarray (array slice), storing a single element into
350  * an array, or storing a slice. The "store" cases work with an
351  * initial array value and a source value that is inserted into the
352  * appropriate part of the array; the result of the operation is an
353  * entire new modified array value.
354  *
355  * If reflowerindexpr = NIL, then we are fetching or storing a single array
356  * element at the subscripts given by refupperindexpr. Otherwise we are
357  * fetching or storing an array slice, that is a rectangular subarray
358  * with lower and upper bounds given by the index expressions.
359  * reflowerindexpr must be the same length as refupperindexpr when it
360  * is not NIL.
361  *
362  * In the slice case, individual expressions in the subscript lists can be
363  * NULL, meaning "substitute the array's current lower or upper bound".
364  *
365  * Note: the result datatype is the element type when fetching a single
366  * element; but it is the array type when doing subarray fetch or either
367  * type of store.
368  *
369  * Note: for the cases where an array is returned, if refexpr yields a R/W
370  * expanded array, then the implementation is allowed to modify that object
371  * in-place and return the same object.)
372  * ----------------
373  */
374 typedef struct ArrayRef
375 {
377  Oid refarraytype; /* type of the array proper */
378  Oid refelemtype; /* type of the array elements */
379  int32 reftypmod; /* typmod of the array (and elements too) */
380  Oid refcollid; /* OID of collation, or InvalidOid if none */
381  List *refupperindexpr;/* expressions that evaluate to upper array
382  * indexes */
383  List *reflowerindexpr;/* expressions that evaluate to lower array
384  * indexes, or NIL for single array element */
385  Expr *refexpr; /* the expression that evaluates to an array
386  * value */
387  Expr *refassgnexpr; /* expression for the source value, or NULL if
388  * fetch */
389 } ArrayRef;
390 
391 /*
392  * CoercionContext - distinguishes the allowed set of type casts
393  *
394  * NB: ordering of the alternatives is significant; later (larger) values
395  * allow more casts than earlier ones.
396  */
397 typedef enum CoercionContext
398 {
399  COERCION_IMPLICIT, /* coercion in context of expression */
400  COERCION_ASSIGNMENT, /* coercion in context of assignment */
401  COERCION_EXPLICIT /* explicit cast operation */
403 
404 /*
405  * CoercionForm - how to display a node that could have come from a cast
406  *
407  * NB: equal() ignores CoercionForm fields, therefore this *must* not carry
408  * any semantically significant information. We need that behavior so that
409  * the planner will consider equivalent implicit and explicit casts to be
410  * equivalent. In cases where those actually behave differently, the coercion
411  * function's arguments will be different.
412  */
413 typedef enum CoercionForm
414 {
415  COERCE_EXPLICIT_CALL, /* display as a function call */
416  COERCE_EXPLICIT_CAST, /* display as an explicit cast */
417  COERCE_IMPLICIT_CAST /* implicit cast, so hide it */
418 } CoercionForm;
419 
420 /*
421  * FuncExpr - expression node for a function call
422  */
423 typedef struct FuncExpr
424 {
426  Oid funcid; /* PG_PROC OID of the function */
427  Oid funcresulttype; /* PG_TYPE OID of result value */
428  bool funcretset; /* true if function returns set */
429  bool funcvariadic; /* true if variadic arguments have been
430  * combined into an array last argument */
431  CoercionForm funcformat; /* how to display this function call */
432  Oid funccollid; /* OID of collation of result */
433  Oid inputcollid; /* OID of collation that function should use */
434  List *args; /* arguments to the function */
435  int location; /* token location, or -1 if unknown */
436 } FuncExpr;
437 
438 /*
439  * NamedArgExpr - a named argument of a function
440  *
441  * This node type can only appear in the args list of a FuncCall or FuncExpr
442  * node. We support pure positional call notation (no named arguments),
443  * named notation (all arguments are named), and mixed notation (unnamed
444  * arguments followed by named ones).
445  *
446  * Parse analysis sets argnumber to the positional index of the argument,
447  * but doesn't rearrange the argument list.
448  *
449  * The planner will convert argument lists to pure positional notation
450  * during expression preprocessing, so execution never sees a NamedArgExpr.
451  */
452 typedef struct NamedArgExpr
453 {
455  Expr *arg; /* the argument expression */
456  char *name; /* the name */
457  int argnumber; /* argument's number in positional notation */
458  int location; /* argument name location, or -1 if unknown */
459 } NamedArgExpr;
460 
461 /*
462  * OpExpr - expression node for an operator invocation
463  *
464  * Semantically, this is essentially the same as a function call.
465  *
466  * Note that opfuncid is not necessarily filled in immediately on creation
467  * of the node. The planner makes sure it is valid before passing the node
468  * tree to the executor, but during parsing/planning opfuncid can be 0.
469  */
470 typedef struct OpExpr
471 {
473  Oid opno; /* PG_OPERATOR OID of the operator */
474  Oid opfuncid; /* PG_PROC OID of underlying function */
475  Oid opresulttype; /* PG_TYPE OID of result value */
476  bool opretset; /* true if operator returns set */
477  Oid opcollid; /* OID of collation of result */
478  Oid inputcollid; /* OID of collation that operator should use */
479  List *args; /* arguments to the operator (1 or 2) */
480  int location; /* token location, or -1 if unknown */
481 } OpExpr;
482 
483 /*
484  * DistinctExpr - expression node for "x IS DISTINCT FROM y"
485  *
486  * Except for the nodetag, this is represented identically to an OpExpr
487  * referencing the "=" operator for x and y.
488  * We use "=", not the more obvious "<>", because more datatypes have "="
489  * than "<>". This means the executor must invert the operator result.
490  * Note that the operator function won't be called at all if either input
491  * is NULL, since then the result can be determined directly.
492  */
494 
495 /*
496  * NullIfExpr - a NULLIF expression
497  *
498  * Like DistinctExpr, this is represented the same as an OpExpr referencing
499  * the "=" operator for x and y.
500  */
502 
503 /*
504  * ScalarArrayOpExpr - expression node for "scalar op ANY/ALL (array)"
505  *
506  * The operator must yield boolean. It is applied to the left operand
507  * and each element of the righthand array, and the results are combined
508  * with OR or AND (for ANY or ALL respectively). The node representation
509  * is almost the same as for the underlying operator, but we need a useOr
510  * flag to remember whether it's ANY or ALL, and we don't have to store
511  * the result type (or the collation) because it must be boolean.
512  */
513 typedef struct ScalarArrayOpExpr
514 {
516  Oid opno; /* PG_OPERATOR OID of the operator */
517  Oid opfuncid; /* PG_PROC OID of underlying function */
518  bool useOr; /* true for ANY, false for ALL */
519  Oid inputcollid; /* OID of collation that operator should use */
520  List *args; /* the scalar and array operands */
521  int location; /* token location, or -1 if unknown */
523 
524 /*
525  * BoolExpr - expression node for the basic Boolean operators AND, OR, NOT
526  *
527  * Notice the arguments are given as a List. For NOT, of course the list
528  * must always have exactly one element. For AND and OR, there can be two
529  * or more arguments.
530  */
531 typedef enum BoolExprType
532 {
534 } BoolExprType;
535 
536 typedef struct BoolExpr
537 {
540  List *args; /* arguments to this expression */
541  int location; /* token location, or -1 if unknown */
542 } BoolExpr;
543 
544 /*
545  * SubLink
546  *
547  * A SubLink represents a subselect appearing in an expression, and in some
548  * cases also the combining operator(s) just above it. The subLinkType
549  * indicates the form of the expression represented:
550  * EXISTS_SUBLINK EXISTS(SELECT ...)
551  * ALL_SUBLINK (lefthand) op ALL (SELECT ...)
552  * ANY_SUBLINK (lefthand) op ANY (SELECT ...)
553  * ROWCOMPARE_SUBLINK (lefthand) op (SELECT ...)
554  * EXPR_SUBLINK (SELECT with single targetlist item ...)
555  * MULTIEXPR_SUBLINK (SELECT with multiple targetlist items ...)
556  * ARRAY_SUBLINK ARRAY(SELECT with single targetlist item ...)
557  * CTE_SUBLINK WITH query (never actually part of an expression)
558  * For ALL, ANY, and ROWCOMPARE, the lefthand is a list of expressions of the
559  * same length as the subselect's targetlist. ROWCOMPARE will *always* have
560  * a list with more than one entry; if the subselect has just one target
561  * then the parser will create an EXPR_SUBLINK instead (and any operator
562  * above the subselect will be represented separately).
563  * ROWCOMPARE, EXPR, and MULTIEXPR require the subselect to deliver at most
564  * one row (if it returns no rows, the result is NULL).
565  * ALL, ANY, and ROWCOMPARE require the combining operators to deliver boolean
566  * results. ALL and ANY combine the per-row results using AND and OR
567  * semantics respectively.
568  * ARRAY requires just one target column, and creates an array of the target
569  * column's type using any number of rows resulting from the subselect.
570  *
571  * SubLink is classed as an Expr node, but it is not actually executable;
572  * it must be replaced in the expression tree by a SubPlan node during
573  * planning.
574  *
575  * NOTE: in the raw output of gram.y, testexpr contains just the raw form
576  * of the lefthand expression (if any), and operName is the String name of
577  * the combining operator. Also, subselect is a raw parsetree. During parse
578  * analysis, the parser transforms testexpr into a complete boolean expression
579  * that compares the lefthand value(s) to PARAM_SUBLINK nodes representing the
580  * output columns of the subselect. And subselect is transformed to a Query.
581  * This is the representation seen in saved rules and in the rewriter.
582  *
583  * In EXISTS, EXPR, MULTIEXPR, and ARRAY SubLinks, testexpr and operName
584  * are unused and are always null.
585  *
586  * subLinkId is currently used only for MULTIEXPR SubLinks, and is zero in
587  * other SubLinks. This number identifies different multiple-assignment
588  * subqueries within an UPDATE statement's SET list. It is unique only
589  * within a particular targetlist. The output column(s) of the MULTIEXPR
590  * are referenced by PARAM_MULTIEXPR Params appearing elsewhere in the tlist.
591  *
592  * The CTE_SUBLINK case never occurs in actual SubLink nodes, but it is used
593  * in SubPlans generated for WITH subqueries.
594  */
595 typedef enum SubLinkType
596 {
604  CTE_SUBLINK /* for SubPlans only */
605 } SubLinkType;
606 
607 
608 typedef struct SubLink
609 {
611  SubLinkType subLinkType; /* see above */
612  int subLinkId; /* ID (1..n); 0 if not MULTIEXPR */
613  Node *testexpr; /* outer-query test for ALL/ANY/ROWCOMPARE */
614  List *operName; /* originally specified operator name */
615  Node *subselect; /* subselect as Query* or raw parsetree */
616  int location; /* token location, or -1 if unknown */
617 } SubLink;
618 
619 /*
620  * SubPlan - executable expression node for a subplan (sub-SELECT)
621  *
622  * The planner replaces SubLink nodes in expression trees with SubPlan
623  * nodes after it has finished planning the subquery. SubPlan references
624  * a sub-plantree stored in the subplans list of the toplevel PlannedStmt.
625  * (We avoid a direct link to make it easier to copy expression trees
626  * without causing multiple processing of the subplan.)
627  *
628  * In an ordinary subplan, testexpr points to an executable expression
629  * (OpExpr, an AND/OR tree of OpExprs, or RowCompareExpr) for the combining
630  * operator(s); the left-hand arguments are the original lefthand expressions,
631  * and the right-hand arguments are PARAM_EXEC Param nodes representing the
632  * outputs of the sub-select. (NOTE: runtime coercion functions may be
633  * inserted as well.) This is just the same expression tree as testexpr in
634  * the original SubLink node, but the PARAM_SUBLINK nodes are replaced by
635  * suitably numbered PARAM_EXEC nodes.
636  *
637  * If the sub-select becomes an initplan rather than a subplan, the executable
638  * expression is part of the outer plan's expression tree (and the SubPlan
639  * node itself is not, but rather is found in the outer plan's initPlan
640  * list). In this case testexpr is NULL to avoid duplication.
641  *
642  * The planner also derives lists of the values that need to be passed into
643  * and out of the subplan. Input values are represented as a list "args" of
644  * expressions to be evaluated in the outer-query context (currently these
645  * args are always just Vars, but in principle they could be any expression).
646  * The values are assigned to the global PARAM_EXEC params indexed by parParam
647  * (the parParam and args lists must have the same ordering). setParam is a
648  * list of the PARAM_EXEC params that are computed by the sub-select, if it
649  * is an initplan; they are listed in order by sub-select output column
650  * position. (parParam and setParam are integer Lists, not Bitmapsets,
651  * because their ordering is significant.)
652  *
653  * Also, the planner computes startup and per-call costs for use of the
654  * SubPlan. Note that these include the cost of the subquery proper,
655  * evaluation of the testexpr if any, and any hashtable management overhead.
656  */
657 typedef struct SubPlan
658 {
660  /* Fields copied from original SubLink: */
661  SubLinkType subLinkType; /* see above */
662  /* The combining operators, transformed to an executable expression: */
663  Node *testexpr; /* OpExpr or RowCompareExpr expression tree */
664  List *paramIds; /* IDs of Params embedded in the above */
665  /* Identification of the Plan tree to use: */
666  int plan_id; /* Index (from 1) in PlannedStmt.subplans */
667  /* Identification of the SubPlan for EXPLAIN and debugging purposes: */
668  char *plan_name; /* A name assigned during planning */
669  /* Extra data useful for determining subplan's output type: */
670  Oid firstColType; /* Type of first column of subplan result */
671  int32 firstColTypmod; /* Typmod of first column of subplan result */
672  Oid firstColCollation; /* Collation of first column of
673  * subplan result */
674  /* Information about execution strategy: */
675  bool useHashTable; /* TRUE to store subselect output in a hash
676  * table (implies we are doing "IN") */
677  bool unknownEqFalse; /* TRUE if it's okay to return FALSE when the
678  * spec result is UNKNOWN; this allows much
679  * simpler handling of null values */
680  bool parallel_safe; /* OK to use as part of parallel plan? */
681  /* Information for passing params into and out of the subselect: */
682  /* setParam and parParam are lists of integers (param IDs) */
683  List *setParam; /* initplan subqueries have to set these
684  * Params for parent plan */
685  List *parParam; /* indices of input Params from parent plan */
686  List *args; /* exprs to pass as parParam values */
687  /* Estimated execution costs: */
688  Cost startup_cost; /* one-time setup cost */
689  Cost per_call_cost; /* cost for each subplan evaluation */
690 } SubPlan;
691 
692 /*
693  * AlternativeSubPlan - expression node for a choice among SubPlans
694  *
695  * The subplans are given as a List so that the node definition need not
696  * change if there's ever more than two alternatives. For the moment,
697  * though, there are always exactly two; and the first one is the fast-start
698  * plan.
699  */
700 typedef struct AlternativeSubPlan
701 {
703  List *subplans; /* SubPlan(s) with equivalent results */
705 
706 /* ----------------
707  * FieldSelect
708  *
709  * FieldSelect represents the operation of extracting one field from a tuple
710  * value. At runtime, the input expression is expected to yield a rowtype
711  * Datum. The specified field number is extracted and returned as a Datum.
712  * ----------------
713  */
714 
715 typedef struct FieldSelect
716 {
718  Expr *arg; /* input expression */
719  AttrNumber fieldnum; /* attribute number of field to extract */
720  Oid resulttype; /* type of the field (result type of this
721  * node) */
722  int32 resulttypmod; /* output typmod (usually -1) */
723  Oid resultcollid; /* OID of collation of the field */
724 } FieldSelect;
725 
726 /* ----------------
727  * FieldStore
728  *
729  * FieldStore represents the operation of modifying one field in a tuple
730  * value, yielding a new tuple value (the input is not touched!). Like
731  * the assign case of ArrayRef, this is used to implement UPDATE of a
732  * portion of a column.
733  *
734  * A single FieldStore can actually represent updates of several different
735  * fields. The parser only generates FieldStores with single-element lists,
736  * but the planner will collapse multiple updates of the same base column
737  * into one FieldStore.
738  * ----------------
739  */
740 
741 typedef struct FieldStore
742 {
744  Expr *arg; /* input tuple value */
745  List *newvals; /* new value(s) for field(s) */
746  List *fieldnums; /* integer list of field attnums */
747  Oid resulttype; /* type of result (same as type of arg) */
748  /* Like RowExpr, we deliberately omit a typmod and collation here */
749 } FieldStore;
750 
751 /* ----------------
752  * RelabelType
753  *
754  * RelabelType represents a "dummy" type coercion between two binary-
755  * compatible datatypes, such as reinterpreting the result of an OID
756  * expression as an int4. It is a no-op at runtime; we only need it
757  * to provide a place to store the correct type to be attributed to
758  * the expression result during type resolution. (We can't get away
759  * with just overwriting the type field of the input expression node,
760  * so we need a separate node to show the coercion's result type.)
761  * ----------------
762  */
763 
764 typedef struct RelabelType
765 {
767  Expr *arg; /* input expression */
768  Oid resulttype; /* output type of coercion expression */
769  int32 resulttypmod; /* output typmod (usually -1) */
770  Oid resultcollid; /* OID of collation, or InvalidOid if none */
771  CoercionForm relabelformat; /* how to display this node */
772  int location; /* token location, or -1 if unknown */
773 } RelabelType;
774 
775 /* ----------------
776  * CoerceViaIO
777  *
778  * CoerceViaIO represents a type coercion between two types whose textual
779  * representations are compatible, implemented by invoking the source type's
780  * typoutput function then the destination type's typinput function.
781  * ----------------
782  */
783 
784 typedef struct CoerceViaIO
785 {
787  Expr *arg; /* input expression */
788  Oid resulttype; /* output type of coercion */
789  /* output typmod is not stored, but is presumed -1 */
790  Oid resultcollid; /* OID of collation, or InvalidOid if none */
791  CoercionForm coerceformat; /* how to display this node */
792  int location; /* token location, or -1 if unknown */
793 } CoerceViaIO;
794 
795 /* ----------------
796  * ArrayCoerceExpr
797  *
798  * ArrayCoerceExpr represents a type coercion from one array type to another,
799  * which is implemented by applying the indicated element-type coercion
800  * function to each element of the source array. If elemfuncid is InvalidOid
801  * then the element types are binary-compatible, but the coercion still
802  * requires some effort (we have to fix the element type ID stored in the
803  * array header).
804  * ----------------
805  */
806 
807 typedef struct ArrayCoerceExpr
808 {
810  Expr *arg; /* input expression (yields an array) */
811  Oid elemfuncid; /* OID of element coercion function, or 0 */
812  Oid resulttype; /* output type of coercion (an array type) */
813  int32 resulttypmod; /* output typmod (also element typmod) */
814  Oid resultcollid; /* OID of collation, or InvalidOid if none */
815  bool isExplicit; /* conversion semantics flag to pass to func */
816  CoercionForm coerceformat; /* how to display this node */
817  int location; /* token location, or -1 if unknown */
819 
820 /* ----------------
821  * ConvertRowtypeExpr
822  *
823  * ConvertRowtypeExpr represents a type coercion from one composite type
824  * to another, where the source type is guaranteed to contain all the columns
825  * needed for the destination type plus possibly others; the columns need not
826  * be in the same positions, but are matched up by name. This is primarily
827  * used to convert a whole-row value of an inheritance child table into a
828  * valid whole-row value of its parent table's rowtype.
829  * ----------------
830  */
831 
832 typedef struct ConvertRowtypeExpr
833 {
835  Expr *arg; /* input expression */
836  Oid resulttype; /* output type (always a composite type) */
837  /* Like RowExpr, we deliberately omit a typmod and collation here */
838  CoercionForm convertformat; /* how to display this node */
839  int location; /* token location, or -1 if unknown */
841 
842 /*----------
843  * CollateExpr - COLLATE
844  *
845  * The planner replaces CollateExpr with RelabelType during expression
846  * preprocessing, so execution never sees a CollateExpr.
847  *----------
848  */
849 typedef struct CollateExpr
850 {
852  Expr *arg; /* input expression */
853  Oid collOid; /* collation's OID */
854  int location; /* token location, or -1 if unknown */
855 } CollateExpr;
856 
857 /*----------
858  * CaseExpr - a CASE expression
859  *
860  * We support two distinct forms of CASE expression:
861  * CASE WHEN boolexpr THEN expr [ WHEN boolexpr THEN expr ... ]
862  * CASE testexpr WHEN compexpr THEN expr [ WHEN compexpr THEN expr ... ]
863  * These are distinguishable by the "arg" field being NULL in the first case
864  * and the testexpr in the second case.
865  *
866  * In the raw grammar output for the second form, the condition expressions
867  * of the WHEN clauses are just the comparison values. Parse analysis
868  * converts these to valid boolean expressions of the form
869  * CaseTestExpr '=' compexpr
870  * where the CaseTestExpr node is a placeholder that emits the correct
871  * value at runtime. This structure is used so that the testexpr need be
872  * evaluated only once. Note that after parse analysis, the condition
873  * expressions always yield boolean.
874  *
875  * Note: we can test whether a CaseExpr has been through parse analysis
876  * yet by checking whether casetype is InvalidOid or not.
877  *----------
878  */
879 typedef struct CaseExpr
880 {
882  Oid casetype; /* type of expression result */
883  Oid casecollid; /* OID of collation, or InvalidOid if none */
884  Expr *arg; /* implicit equality comparison argument */
885  List *args; /* the arguments (list of WHEN clauses) */
886  Expr *defresult; /* the default result (ELSE clause) */
887  int location; /* token location, or -1 if unknown */
888 } CaseExpr;
889 
890 /*
891  * CaseWhen - one arm of a CASE expression
892  */
893 typedef struct CaseWhen
894 {
896  Expr *expr; /* condition expression */
897  Expr *result; /* substitution result */
898  int location; /* token location, or -1 if unknown */
899 } CaseWhen;
900 
901 /*
902  * Placeholder node for the test value to be processed by a CASE expression.
903  * This is effectively like a Param, but can be implemented more simply
904  * since we need only one replacement value at a time.
905  *
906  * We also use this in nested UPDATE expressions.
907  * See transformAssignmentIndirection().
908  */
909 typedef struct CaseTestExpr
910 {
912  Oid typeId; /* type for substituted value */
913  int32 typeMod; /* typemod for substituted value */
914  Oid collation; /* collation for the substituted value */
915 } CaseTestExpr;
916 
917 /*
918  * ArrayExpr - an ARRAY[] expression
919  *
920  * Note: if multidims is false, the constituent expressions all yield the
921  * scalar type identified by element_typeid. If multidims is true, the
922  * constituent expressions all yield arrays of element_typeid (ie, the same
923  * type as array_typeid); at runtime we must check for compatible subscripts.
924  */
925 typedef struct ArrayExpr
926 {
928  Oid array_typeid; /* type of expression result */
929  Oid array_collid; /* OID of collation, or InvalidOid if none */
930  Oid element_typeid; /* common type of array elements */
931  List *elements; /* the array elements or sub-arrays */
932  bool multidims; /* true if elements are sub-arrays */
933  int location; /* token location, or -1 if unknown */
934 } ArrayExpr;
935 
936 /*
937  * RowExpr - a ROW() expression
938  *
939  * Note: the list of fields must have a one-for-one correspondence with
940  * physical fields of the associated rowtype, although it is okay for it
941  * to be shorter than the rowtype. That is, the N'th list element must
942  * match up with the N'th physical field. When the N'th physical field
943  * is a dropped column (attisdropped) then the N'th list element can just
944  * be a NULL constant. (This case can only occur for named composite types,
945  * not RECORD types, since those are built from the RowExpr itself rather
946  * than vice versa.) It is important not to assume that length(args) is
947  * the same as the number of columns logically present in the rowtype.
948  *
949  * colnames provides field names in cases where the names can't easily be
950  * obtained otherwise. Names *must* be provided if row_typeid is RECORDOID.
951  * If row_typeid identifies a known composite type, colnames can be NIL to
952  * indicate the type's cataloged field names apply. Note that colnames can
953  * be non-NIL even for a composite type, and typically is when the RowExpr
954  * was created by expanding a whole-row Var. This is so that we can retain
955  * the column alias names of the RTE that the Var referenced (which would
956  * otherwise be very difficult to extract from the parsetree). Like the
957  * args list, colnames is one-for-one with physical fields of the rowtype.
958  */
959 typedef struct RowExpr
960 {
962  List *args; /* the fields */
963  Oid row_typeid; /* RECORDOID or a composite type's ID */
964 
965  /*
966  * Note: we deliberately do NOT store a typmod. Although a typmod will be
967  * associated with specific RECORD types at runtime, it will differ for
968  * different backends, and so cannot safely be stored in stored
969  * parsetrees. We must assume typmod -1 for a RowExpr node.
970  *
971  * We don't need to store a collation either. The result type is
972  * necessarily composite, and composite types never have a collation.
973  */
974  CoercionForm row_format; /* how to display this node */
975  List *colnames; /* list of String, or NIL */
976  int location; /* token location, or -1 if unknown */
977 } RowExpr;
978 
979 /*
980  * RowCompareExpr - row-wise comparison, such as (a, b) <= (1, 2)
981  *
982  * We support row comparison for any operator that can be determined to
983  * act like =, <>, <, <=, >, or >= (we determine this by looking for the
984  * operator in btree opfamilies). Note that the same operator name might
985  * map to a different operator for each pair of row elements, since the
986  * element datatypes can vary.
987  *
988  * A RowCompareExpr node is only generated for the < <= > >= cases;
989  * the = and <> cases are translated to simple AND or OR combinations
990  * of the pairwise comparisons. However, we include = and <> in the
991  * RowCompareType enum for the convenience of parser logic.
992  */
993 typedef enum RowCompareType
994 {
995  /* Values of this enum are chosen to match btree strategy numbers */
996  ROWCOMPARE_LT = 1, /* BTLessStrategyNumber */
997  ROWCOMPARE_LE = 2, /* BTLessEqualStrategyNumber */
998  ROWCOMPARE_EQ = 3, /* BTEqualStrategyNumber */
999  ROWCOMPARE_GE = 4, /* BTGreaterEqualStrategyNumber */
1000  ROWCOMPARE_GT = 5, /* BTGreaterStrategyNumber */
1001  ROWCOMPARE_NE = 6 /* no such btree strategy */
1002 } RowCompareType;
1003 
1004 typedef struct RowCompareExpr
1005 {
1007  RowCompareType rctype; /* LT LE GE or GT, never EQ or NE */
1008  List *opnos; /* OID list of pairwise comparison ops */
1009  List *opfamilies; /* OID list of containing operator families */
1010  List *inputcollids; /* OID list of collations for comparisons */
1011  List *largs; /* the left-hand input arguments */
1012  List *rargs; /* the right-hand input arguments */
1013 } RowCompareExpr;
1014 
1015 /*
1016  * CoalesceExpr - a COALESCE expression
1017  */
1018 typedef struct CoalesceExpr
1019 {
1021  Oid coalescetype; /* type of expression result */
1022  Oid coalescecollid; /* OID of collation, or InvalidOid if none */
1023  List *args; /* the arguments */
1024  int location; /* token location, or -1 if unknown */
1025 } CoalesceExpr;
1026 
1027 /*
1028  * MinMaxExpr - a GREATEST or LEAST function
1029  */
1030 typedef enum MinMaxOp
1031 {
1034 } MinMaxOp;
1035 
1036 typedef struct MinMaxExpr
1037 {
1039  Oid minmaxtype; /* common type of arguments and result */
1040  Oid minmaxcollid; /* OID of collation of result */
1041  Oid inputcollid; /* OID of collation that function should use */
1042  MinMaxOp op; /* function to execute */
1043  List *args; /* the arguments */
1044  int location; /* token location, or -1 if unknown */
1045 } MinMaxExpr;
1046 
1047 /*
1048  * SQLValueFunction - parameterless functions with special grammar productions
1049  *
1050  * The SQL standard categorizes some of these as <datetime value function>
1051  * and others as <general value specification>. We call 'em SQLValueFunctions
1052  * for lack of a better term. We store type and typmod of the result so that
1053  * some code doesn't need to know each function individually, and because
1054  * we would need to store typmod anyway for some of the datetime functions.
1055  * Note that currently, all variants return non-collating datatypes, so we do
1056  * not need a collation field; also, all these functions are stable.
1057  */
1059 {
1076 
1077 typedef struct SQLValueFunction
1078 {
1080  SQLValueFunctionOp op; /* which function this is */
1081  Oid type; /* result type/typmod */
1083  int location; /* token location, or -1 if unknown */
1085 
1086 /*
1087  * XmlExpr - various SQL/XML functions requiring special grammar productions
1088  *
1089  * 'name' carries the "NAME foo" argument (already XML-escaped).
1090  * 'named_args' and 'arg_names' represent an xml_attribute list.
1091  * 'args' carries all other arguments.
1092  *
1093  * Note: result type/typmod/collation are not stored, but can be deduced
1094  * from the XmlExprOp. The type/typmod fields are just used for display
1095  * purposes, and are NOT necessarily the true result type of the node.
1096  */
1097 typedef enum XmlExprOp
1098 {
1099  IS_XMLCONCAT, /* XMLCONCAT(args) */
1100  IS_XMLELEMENT, /* XMLELEMENT(name, xml_attributes, args) */
1101  IS_XMLFOREST, /* XMLFOREST(xml_attributes) */
1102  IS_XMLPARSE, /* XMLPARSE(text, is_doc, preserve_ws) */
1103  IS_XMLPI, /* XMLPI(name [, args]) */
1104  IS_XMLROOT, /* XMLROOT(xml, version, standalone) */
1105  IS_XMLSERIALIZE, /* XMLSERIALIZE(is_document, xmlval) */
1106  IS_DOCUMENT /* xmlval IS DOCUMENT */
1107 } XmlExprOp;
1108 
1109 typedef enum
1110 {
1113 } XmlOptionType;
1114 
1115 typedef struct XmlExpr
1116 {
1118  XmlExprOp op; /* xml function ID */
1119  char *name; /* name in xml(NAME foo ...) syntaxes */
1120  List *named_args; /* non-XML expressions for xml_attributes */
1121  List *arg_names; /* parallel list of Value strings */
1122  List *args; /* list of expressions */
1123  XmlOptionType xmloption; /* DOCUMENT or CONTENT */
1124  Oid type; /* target type/typmod for XMLSERIALIZE */
1126  int location; /* token location, or -1 if unknown */
1127 } XmlExpr;
1128 
1129 /* ----------------
1130  * NullTest
1131  *
1132  * NullTest represents the operation of testing a value for NULLness.
1133  * The appropriate test is performed and returned as a boolean Datum.
1134  *
1135  * When argisrow is false, this simply represents a test for the null value.
1136  *
1137  * When argisrow is true, the input expression must yield a rowtype, and
1138  * the node implements "row IS [NOT] NULL" per the SQL standard. This
1139  * includes checking individual fields for NULLness when the row datum
1140  * itself isn't NULL.
1141  *
1142  * NOTE: the combination of a rowtype input and argisrow==false does NOT
1143  * correspond to the SQL notation "row IS [NOT] NULL"; instead, this case
1144  * represents the SQL notation "row IS [NOT] DISTINCT FROM NULL".
1145  * ----------------
1146  */
1147 
1148 typedef enum NullTestType
1149 {
1151 } NullTestType;
1152 
1153 typedef struct NullTest
1154 {
1156  Expr *arg; /* input expression */
1157  NullTestType nulltesttype; /* IS NULL, IS NOT NULL */
1158  bool argisrow; /* T to perform field-by-field null checks */
1159  int location; /* token location, or -1 if unknown */
1160 } NullTest;
1161 
1162 /*
1163  * BooleanTest
1164  *
1165  * BooleanTest represents the operation of determining whether a boolean
1166  * is TRUE, FALSE, or UNKNOWN (ie, NULL). All six meaningful combinations
1167  * are supported. Note that a NULL input does *not* cause a NULL result.
1168  * The appropriate test is performed and returned as a boolean Datum.
1169  */
1170 
1171 typedef enum BoolTestType
1172 {
1174 } BoolTestType;
1175 
1176 typedef struct BooleanTest
1177 {
1179  Expr *arg; /* input expression */
1180  BoolTestType booltesttype; /* test type */
1181  int location; /* token location, or -1 if unknown */
1182 } BooleanTest;
1183 
1184 /*
1185  * CoerceToDomain
1186  *
1187  * CoerceToDomain represents the operation of coercing a value to a domain
1188  * type. At runtime (and not before) the precise set of constraints to be
1189  * checked will be determined. If the value passes, it is returned as the
1190  * result; if not, an error is raised. Note that this is equivalent to
1191  * RelabelType in the scenario where no constraints are applied.
1192  */
1193 typedef struct CoerceToDomain
1194 {
1196  Expr *arg; /* input expression */
1197  Oid resulttype; /* domain type ID (result type) */
1198  int32 resulttypmod; /* output typmod (currently always -1) */
1199  Oid resultcollid; /* OID of collation, or InvalidOid if none */
1200  CoercionForm coercionformat; /* how to display this node */
1201  int location; /* token location, or -1 if unknown */
1202 } CoerceToDomain;
1203 
1204 /*
1205  * Placeholder node for the value to be processed by a domain's check
1206  * constraint. This is effectively like a Param, but can be implemented more
1207  * simply since we need only one replacement value at a time.
1208  *
1209  * Note: the typeId/typeMod/collation will be set from the domain's base type,
1210  * not the domain itself. This is because we shouldn't consider the value
1211  * to be a member of the domain if we haven't yet checked its constraints.
1212  */
1213 typedef struct CoerceToDomainValue
1214 {
1216  Oid typeId; /* type for substituted value */
1217  int32 typeMod; /* typemod for substituted value */
1218  Oid collation; /* collation for the substituted value */
1219  int location; /* token location, or -1 if unknown */
1221 
1222 /*
1223  * Placeholder node for a DEFAULT marker in an INSERT or UPDATE command.
1224  *
1225  * This is not an executable expression: it must be replaced by the actual
1226  * column default expression during rewriting. But it is convenient to
1227  * treat it as an expression node during parsing and rewriting.
1228  */
1229 typedef struct SetToDefault
1230 {
1232  Oid typeId; /* type for substituted value */
1233  int32 typeMod; /* typemod for substituted value */
1234  Oid collation; /* collation for the substituted value */
1235  int location; /* token location, or -1 if unknown */
1236 } SetToDefault;
1237 
1238 /*
1239  * Node representing [WHERE] CURRENT OF cursor_name
1240  *
1241  * CURRENT OF is a bit like a Var, in that it carries the rangetable index
1242  * of the target relation being constrained; this aids placing the expression
1243  * correctly during planning. We can assume however that its "levelsup" is
1244  * always zero, due to the syntactic constraints on where it can appear.
1245  *
1246  * The referenced cursor can be represented either as a hardwired string
1247  * or as a reference to a run-time parameter of type REFCURSOR. The latter
1248  * case is for the convenience of plpgsql.
1249  */
1250 typedef struct CurrentOfExpr
1251 {
1253  Index cvarno; /* RT index of target relation */
1254  char *cursor_name; /* name of referenced cursor, or NULL */
1255  int cursor_param; /* refcursor parameter number, or 0 */
1256 } CurrentOfExpr;
1257 
1258 /*
1259  * InferenceElem - an element of a unique index inference specification
1260  *
1261  * This mostly matches the structure of IndexElems, but having a dedicated
1262  * primnode allows for a clean separation between the use of index parameters
1263  * by utility commands, and this node.
1264  */
1265 typedef struct InferenceElem
1266 {
1268  Node *expr; /* expression to infer from, or NULL */
1269  Oid infercollid; /* OID of collation, or InvalidOid */
1270  Oid inferopclass; /* OID of att opclass, or InvalidOid */
1271 } InferenceElem;
1272 
1273 /*--------------------
1274  * TargetEntry -
1275  * a target entry (used in query target lists)
1276  *
1277  * Strictly speaking, a TargetEntry isn't an expression node (since it can't
1278  * be evaluated by ExecEvalExpr). But we treat it as one anyway, since in
1279  * very many places it's convenient to process a whole query targetlist as a
1280  * single expression tree.
1281  *
1282  * In a SELECT's targetlist, resno should always be equal to the item's
1283  * ordinal position (counting from 1). However, in an INSERT or UPDATE
1284  * targetlist, resno represents the attribute number of the destination
1285  * column for the item; so there may be missing or out-of-order resnos.
1286  * It is even legal to have duplicated resnos; consider
1287  * UPDATE table SET arraycol[1] = ..., arraycol[2] = ..., ...
1288  * The two meanings come together in the executor, because the planner
1289  * transforms INSERT/UPDATE tlists into a normalized form with exactly
1290  * one entry for each column of the destination table. Before that's
1291  * happened, however, it is risky to assume that resno == position.
1292  * Generally get_tle_by_resno() should be used rather than list_nth()
1293  * to fetch tlist entries by resno, and only in SELECT should you assume
1294  * that resno is a unique identifier.
1295  *
1296  * resname is required to represent the correct column name in non-resjunk
1297  * entries of top-level SELECT targetlists, since it will be used as the
1298  * column title sent to the frontend. In most other contexts it is only
1299  * a debugging aid, and may be wrong or even NULL. (In particular, it may
1300  * be wrong in a tlist from a stored rule, if the referenced column has been
1301  * renamed by ALTER TABLE since the rule was made. Also, the planner tends
1302  * to store NULL rather than look up a valid name for tlist entries in
1303  * non-toplevel plan nodes.) In resjunk entries, resname should be either
1304  * a specific system-generated name (such as "ctid") or NULL; anything else
1305  * risks confusing ExecGetJunkAttribute!
1306  *
1307  * ressortgroupref is used in the representation of ORDER BY, GROUP BY, and
1308  * DISTINCT items. Targetlist entries with ressortgroupref=0 are not
1309  * sort/group items. If ressortgroupref>0, then this item is an ORDER BY,
1310  * GROUP BY, and/or DISTINCT target value. No two entries in a targetlist
1311  * may have the same nonzero ressortgroupref --- but there is no particular
1312  * meaning to the nonzero values, except as tags. (For example, one must
1313  * not assume that lower ressortgroupref means a more significant sort key.)
1314  * The order of the associated SortGroupClause lists determine the semantics.
1315  *
1316  * resorigtbl/resorigcol identify the source of the column, if it is a
1317  * simple reference to a column of a base table (or view). If it is not
1318  * a simple reference, these fields are zeroes.
1319  *
1320  * If resjunk is true then the column is a working column (such as a sort key)
1321  * that should be removed from the final output of the query. Resjunk columns
1322  * must have resnos that cannot duplicate any regular column's resno. Also
1323  * note that there are places that assume resjunk columns come after non-junk
1324  * columns.
1325  *--------------------
1326  */
1327 typedef struct TargetEntry
1328 {
1330  Expr *expr; /* expression to evaluate */
1331  AttrNumber resno; /* attribute number (see notes above) */
1332  char *resname; /* name of the column (could be NULL) */
1333  Index ressortgroupref;/* nonzero if referenced by a sort/group
1334  * clause */
1335  Oid resorigtbl; /* OID of column's source table */
1336  AttrNumber resorigcol; /* column's number in source table */
1337  bool resjunk; /* set to true to eliminate the attribute from
1338  * final target list */
1339 } TargetEntry;
1340 
1341 
1342 /* ----------------------------------------------------------------
1343  * node types for join trees
1344  *
1345  * The leaves of a join tree structure are RangeTblRef nodes. Above
1346  * these, JoinExpr nodes can appear to denote a specific kind of join
1347  * or qualified join. Also, FromExpr nodes can appear to denote an
1348  * ordinary cross-product join ("FROM foo, bar, baz WHERE ...").
1349  * FromExpr is like a JoinExpr of jointype JOIN_INNER, except that it
1350  * may have any number of child nodes, not just two.
1351  *
1352  * NOTE: the top level of a Query's jointree is always a FromExpr.
1353  * Even if the jointree contains no rels, there will be a FromExpr.
1354  *
1355  * NOTE: the qualification expressions present in JoinExpr nodes are
1356  * *in addition to* the query's main WHERE clause, which appears as the
1357  * qual of the top-level FromExpr. The reason for associating quals with
1358  * specific nodes in the jointree is that the position of a qual is critical
1359  * when outer joins are present. (If we enforce a qual too soon or too late,
1360  * that may cause the outer join to produce the wrong set of NULL-extended
1361  * rows.) If all joins are inner joins then all the qual positions are
1362  * semantically interchangeable.
1363  *
1364  * NOTE: in the raw output of gram.y, a join tree contains RangeVar,
1365  * RangeSubselect, and RangeFunction nodes, which are all replaced by
1366  * RangeTblRef nodes during the parse analysis phase. Also, the top-level
1367  * FromExpr is added during parse analysis; the grammar regards FROM and
1368  * WHERE as separate.
1369  * ----------------------------------------------------------------
1370  */
1371 
1372 /*
1373  * RangeTblRef - reference to an entry in the query's rangetable
1374  *
1375  * We could use direct pointers to the RT entries and skip having these
1376  * nodes, but multiple pointers to the same node in a querytree cause
1377  * lots of headaches, so it seems better to store an index into the RT.
1378  */
1379 typedef struct RangeTblRef
1380 {
1382  int rtindex;
1383 } RangeTblRef;
1384 
1385 /*----------
1386  * JoinExpr - for SQL JOIN expressions
1387  *
1388  * isNatural, usingClause, and quals are interdependent. The user can write
1389  * only one of NATURAL, USING(), or ON() (this is enforced by the grammar).
1390  * If he writes NATURAL then parse analysis generates the equivalent USING()
1391  * list, and from that fills in "quals" with the right equality comparisons.
1392  * If he writes USING() then "quals" is filled with equality comparisons.
1393  * If he writes ON() then only "quals" is set. Note that NATURAL/USING
1394  * are not equivalent to ON() since they also affect the output column list.
1395  *
1396  * alias is an Alias node representing the AS alias-clause attached to the
1397  * join expression, or NULL if no clause. NB: presence or absence of the
1398  * alias has a critical impact on semantics, because a join with an alias
1399  * restricts visibility of the tables/columns inside it.
1400  *
1401  * During parse analysis, an RTE is created for the Join, and its index
1402  * is filled into rtindex. This RTE is present mainly so that Vars can
1403  * be created that refer to the outputs of the join. The planner sometimes
1404  * generates JoinExprs internally; these can have rtindex = 0 if there are
1405  * no join alias variables referencing such joins.
1406  *----------
1407  */
1408 typedef struct JoinExpr
1409 {
1411  JoinType jointype; /* type of join */
1412  bool isNatural; /* Natural join? Will need to shape table */
1413  Node *larg; /* left subtree */
1414  Node *rarg; /* right subtree */
1415  List *usingClause; /* USING clause, if any (list of String) */
1416  Node *quals; /* qualifiers on join, if any */
1417  Alias *alias; /* user-written alias clause, if any */
1418  int rtindex; /* RT index assigned for join, or 0 */
1419 } JoinExpr;
1420 
1421 /*----------
1422  * FromExpr - represents a FROM ... WHERE ... construct
1423  *
1424  * This is both more flexible than a JoinExpr (it can have any number of
1425  * children, including zero) and less so --- we don't need to deal with
1426  * aliases and so on. The output column set is implicitly just the union
1427  * of the outputs of the children.
1428  *----------
1429  */
1430 typedef struct FromExpr
1431 {
1433  List *fromlist; /* List of join subtrees */
1434  Node *quals; /* qualifiers on join, if any */
1435 } FromExpr;
1436 
1437 /*----------
1438  * OnConflictExpr - represents an ON CONFLICT DO ... expression
1439  *
1440  * The optimizer requires a list of inference elements, and optionally a WHERE
1441  * clause to infer a unique index. The unique index (or, occasionally,
1442  * indexes) inferred are used to arbitrate whether or not the alternative ON
1443  * CONFLICT path is taken.
1444  *----------
1445  */
1446 typedef struct OnConflictExpr
1447 {
1449  OnConflictAction action; /* DO NOTHING or UPDATE? */
1450 
1451  /* Arbiter */
1452  List *arbiterElems; /* unique index arbiter list (of
1453  * InferenceElem's) */
1454  Node *arbiterWhere; /* unique index arbiter WHERE clause */
1455  Oid constraint; /* pg_constraint OID for arbiter */
1456 
1457  /* ON CONFLICT UPDATE */
1458  List *onConflictSet; /* List of ON CONFLICT SET TargetEntrys */
1459  Node *onConflictWhere; /* qualifiers to restrict UPDATE to */
1460  int exclRelIndex; /* RT index of 'excluded' relation */
1461  List *exclRelTlist; /* tlist of the EXCLUDED pseudo relation */
1462 } OnConflictExpr;
1463 
1464 #endif /* PRIMNODES_H */
Datum constvalue
Definition: primnodes.h:174
NodeTag type
Definition: primnodes.h:40
List * aggdistinct
Definition: primnodes.h:281
Oid funcresulttype
Definition: primnodes.h:427
Oid minmaxtype
Definition: primnodes.h:1039
bool multidims
Definition: primnodes.h:932
Expr xpr
Definition: primnodes.h:332
struct CaseWhen CaseWhen
struct OpExpr OpExpr
Oid firstColType
Definition: primnodes.h:670
struct FieldSelect FieldSelect
Expr * refassgnexpr
Definition: primnodes.h:387
List * args
Definition: primnodes.h:1043
Expr xpr
Definition: primnodes.h:881
bool aggvariadic
Definition: primnodes.h:284
List * args
Definition: primnodes.h:962
Expr xpr
Definition: primnodes.h:1155
struct CoerceToDomain CoerceToDomain
NodeTag type
Definition: primnodes.h:1448
Expr * arg
Definition: primnodes.h:744
Index varlevelsup
Definition: primnodes.h:151
OnCommitAction onCommit
Definition: primnodes.h:90
int plan_id
Definition: primnodes.h:666
List * args
Definition: primnodes.h:319
ParamKind
Definition: primnodes.h:211
char * name
Definition: primnodes.h:1119
List * refs
Definition: primnodes.h:321
struct FromExpr FromExpr
bool constbyval
Definition: primnodes.h:177
List * args
Definition: primnodes.h:337
List * args
Definition: primnodes.h:434
Oid wincollid
Definition: primnodes.h:335
int32 resulttypmod
Definition: primnodes.h:1198
List * colnames
Definition: primnodes.h:42
Oid resulttype
Definition: primnodes.h:720
char * tableSpaceName
Definition: primnodes.h:91
struct CoerceToDomainValue CoerceToDomainValue
struct Alias Alias
BoolTestType
Definition: primnodes.h:1171
Expr xpr
Definition: primnodes.h:376
Oid funccollid
Definition: primnodes.h:432
int location
Definition: primnodes.h:1126
Oid resulttype
Definition: primnodes.h:788
XmlExprOp
Definition: primnodes.h:1097
OpExpr NullIfExpr
Definition: primnodes.h:501
RowCompareType rctype
Definition: primnodes.h:1007
List * opfamilies
Definition: primnodes.h:1009
Oid type
Definition: primnodes.h:1124
struct JoinExpr JoinExpr
Oid casecollid
Definition: primnodes.h:883
SubLinkType subLinkType
Definition: primnodes.h:661
Expr * arg
Definition: primnodes.h:767
Oid inputcollid
Definition: primnodes.h:275
ParamKind paramkind
Definition: primnodes.h:222
struct FuncExpr FuncExpr
struct CollateExpr CollateExpr
Definition: nodes.h:508
CoercionForm coercionformat
Definition: primnodes.h:1200
NodeTag type
Definition: primnodes.h:64
struct AlternativeSubPlan AlternativeSubPlan
Oid resorigtbl
Definition: primnodes.h:1335
List * args
Definition: primnodes.h:279
AttrNumber varattno
Definition: primnodes.h:146
Oid array_typeid
Definition: primnodes.h:928
Expr * arg
Definition: primnodes.h:718
List * paramIds
Definition: primnodes.h:664
bool funcretset
Definition: primnodes.h:428
struct SubPlan SubPlan
struct Expr Expr
struct ArrayRef ArrayRef
List * fromlist
Definition: primnodes.h:1433
Expr xpr
Definition: primnodes.h:1117
NullTestType
Definition: primnodes.h:1148
bool skipData
Definition: primnodes.h:93
Oid casetype
Definition: primnodes.h:882
bool aggstar
Definition: primnodes.h:283
Expr xpr
Definition: primnodes.h:961
unsigned int Oid
Definition: postgres_ext.h:31
Expr xpr
Definition: primnodes.h:143
NodeTag
Definition: nodes.h:26
Index winref
Definition: primnodes.h:339
char * resname
Definition: primnodes.h:1332
List * arg_names
Definition: primnodes.h:1121
Definition: primnodes.h:141
CoercionContext
Definition: primnodes.h:397
Node * quals
Definition: primnodes.h:1434
struct Var Var
int32 typeMod
Definition: primnodes.h:913
int location
Definition: primnodes.h:541
int location
Definition: primnodes.h:898
OnCommitAction
Definition: primnodes.h:46
SQLValueFunctionOp op
Definition: primnodes.h:1080
NodeTag type
Definition: primnodes.h:1432
signed int int32
Definition: c.h:253
struct RelabelType RelabelType
JoinType
Definition: nodes.h:665
List * arbiterElems
Definition: primnodes.h:1452
Expr xpr
Definition: primnodes.h:221
struct ConvertRowtypeExpr ConvertRowtypeExpr
char * schemaname
Definition: primnodes.h:66
Node * larg
Definition: primnodes.h:1413
int location
Definition: primnodes.h:72
int constlen
Definition: primnodes.h:173
Expr xpr
Definition: primnodes.h:472
char * relname
Definition: primnodes.h:67
Oid consttype
Definition: primnodes.h:170
List * aggargtypes
Definition: primnodes.h:277
struct RangeTblRef RangeTblRef
CoercionForm funcformat
Definition: primnodes.h:431
struct WindowFunc WindowFunc
struct RangeVar RangeVar
Index varnoold
Definition: primnodes.h:154
Oid opresulttype
Definition: primnodes.h:475
MinMaxOp
Definition: primnodes.h:1030
bool resjunk
Definition: primnodes.h:1337
struct FieldStore FieldStore
Oid funcid
Definition: primnodes.h:426
List * colnames
Definition: primnodes.h:975
Node * viewQuery
Definition: primnodes.h:92
struct RowExpr RowExpr
Oid paramcollid
Definition: primnodes.h:226
int location
Definition: primnodes.h:227
Oid vartype
Definition: primnodes.h:148
List * args
Definition: primnodes.h:1023
BoolExprType boolop
Definition: primnodes.h:539
struct XmlExpr XmlExpr
Expr * arg
Definition: primnodes.h:1156
int location
Definition: primnodes.h:289
Oid constcollid
Definition: primnodes.h:172
Oid resultcollid
Definition: primnodes.h:723
struct CoerceViaIO CoerceViaIO
int location
Definition: primnodes.h:156
int location
Definition: primnodes.h:976
struct Const Const
int32 typeMod
Definition: primnodes.h:1233
int location
Definition: primnodes.h:1044
List * exclRelTlist
Definition: primnodes.h:1461
List * refupperindexpr
Definition: primnodes.h:381
int location
Definition: primnodes.h:480
List * reflowerindexpr
Definition: primnodes.h:383
struct BoolExpr BoolExpr
List * aggorder
Definition: primnodes.h:280
Expr * arg
Definition: primnodes.h:1179
AttrNumber resno
Definition: primnodes.h:1331
Index agglevelsup
Definition: primnodes.h:287
char * name
Definition: primnodes.h:456
Expr xpr
Definition: primnodes.h:169
char * cursor_name
Definition: primnodes.h:1254
List * aggdirectargs
Definition: primnodes.h:278
Oid resulttype
Definition: primnodes.h:747
Oid winfnoid
Definition: primnodes.h:333
Expr * arg
Definition: primnodes.h:787
List * elements
Definition: primnodes.h:931
struct BooleanTest BooleanTest
struct TargetEntry TargetEntry
Expr xpr
Definition: primnodes.h:927
int32 reftypmod
Definition: primnodes.h:379
struct MinMaxExpr MinMaxExpr
Oid opcollid
Definition: primnodes.h:477
struct InferenceElem InferenceElem
SQLValueFunctionOp
Definition: primnodes.h:1058
List * options
Definition: primnodes.h:89
List * newvals
Definition: primnodes.h:745
bool inh
Definition: primnodes.h:68
List * cols
Definition: primnodes.h:322
SubLinkType
Definition: primnodes.h:595
OnConflictAction action
Definition: primnodes.h:1449
bool isNatural
Definition: primnodes.h:1412
struct CurrentOfExpr CurrentOfExpr
List * usingClause
Definition: primnodes.h:1415
Expr xpr
Definition: primnodes.h:659
Index varno
Definition: primnodes.h:144
XmlExprOp op
Definition: primnodes.h:1118
List * args
Definition: primnodes.h:885
Oid refelemtype
Definition: primnodes.h:378
struct IntoClause IntoClause
CoercionForm coerceformat
Definition: primnodes.h:816
int location
Definition: primnodes.h:181
Node * quals
Definition: primnodes.h:1416
int location
Definition: primnodes.h:933
BoolTestType booltesttype
Definition: primnodes.h:1180
Index agglevelsup
Definition: primnodes.h:323
uintptr_t Datum
Definition: postgres.h:374
CoercionForm convertformat
Definition: primnodes.h:838
struct CaseTestExpr CaseTestExpr
Oid resultcollid
Definition: primnodes.h:790
Oid opfuncid
Definition: primnodes.h:474
Oid resulttype
Definition: primnodes.h:768
Node * testexpr
Definition: primnodes.h:663
unsigned int Index
Definition: c.h:362
NullTestType nulltesttype
Definition: primnodes.h:1157
int32 typmod
Definition: primnodes.h:1125
struct SQLValueFunction SQLValueFunction
Cost per_call_cost
Definition: primnodes.h:689
Oid resultcollid
Definition: primnodes.h:770
Oid aggfnoid
Definition: primnodes.h:272
List * named_args
Definition: primnodes.h:1120
int32 firstColTypmod
Definition: primnodes.h:671
struct ArrayExpr ArrayExpr
RowCompareType
Definition: primnodes.h:993
List * args
Definition: primnodes.h:1122
struct ArrayCoerceExpr ArrayCoerceExpr
int32 paramtypmod
Definition: primnodes.h:225
char * plan_name
Definition: primnodes.h:668
int location
Definition: primnodes.h:792
Node * rarg
Definition: primnodes.h:1414
Alias * alias
Definition: primnodes.h:1417
Expr * arg
Definition: primnodes.h:455
struct NullTest NullTest
int location
Definition: primnodes.h:342
Oid inputcollid
Definition: primnodes.h:433
JoinType jointype
Definition: primnodes.h:1411
char * aliasname
Definition: primnodes.h:41
NodeTag type
Definition: primnodes.h:1381
NodeTag type
Definition: primnodes.h:1410
List * setParam
Definition: primnodes.h:683
Expr * aggfilter
Definition: primnodes.h:338
struct ScalarArrayOpExpr ScalarArrayOpExpr
Expr * expr
Definition: primnodes.h:1330
AggSplit aggsplit
Definition: primnodes.h:288
XmlOptionType xmloption
Definition: primnodes.h:1123
int paramid
Definition: primnodes.h:223
XmlOptionType
Definition: primnodes.h:1109
Oid array_collid
Definition: primnodes.h:929
bool unknownEqFalse
Definition: primnodes.h:677
int location
Definition: primnodes.h:1159
AggSplit
Definition: nodes.h:748
struct GroupingFunc GroupingFunc
Oid row_typeid
Definition: primnodes.h:963
struct RowCompareExpr RowCompareExpr
Oid refcollid
Definition: primnodes.h:380
Oid inputcollid
Definition: primnodes.h:1041
Expr * arg
Definition: primnodes.h:852
Expr xpr
Definition: primnodes.h:538
Expr * aggfilter
Definition: primnodes.h:282
int location
Definition: primnodes.h:887
List * parParam
Definition: primnodes.h:685
Oid inputcollid
Definition: primnodes.h:478
struct OnConflictExpr OnConflictExpr
Oid inputcollid
Definition: primnodes.h:336
List * args
Definition: primnodes.h:540
Expr xpr
Definition: primnodes.h:271
bool parallel_safe
Definition: primnodes.h:680
struct Param Param
NodeTag type
Definition: primnodes.h:85
int32 consttypmod
Definition: primnodes.h:171
Oid element_typeid
Definition: primnodes.h:930
char relpersistence
Definition: primnodes.h:70
Oid wintype
Definition: primnodes.h:334
CoercionForm coerceformat
Definition: primnodes.h:791
AttrNumber varoattno
Definition: primnodes.h:155
Oid refarraytype
Definition: primnodes.h:377
struct SubLink SubLink
Node * arbiterWhere
Definition: primnodes.h:1454
Expr xpr
Definition: primnodes.h:895
AttrNumber resorigcol
Definition: primnodes.h:1336
Oid aggcollid
Definition: primnodes.h:274
Expr xpr
Definition: primnodes.h:425
RangeVar * rel
Definition: primnodes.h:87
struct Aggref Aggref
List * fieldnums
Definition: primnodes.h:746
bool winagg
Definition: primnodes.h:341
Oid coalescetype
Definition: primnodes.h:1021
Expr xpr
Definition: primnodes.h:743
Oid aggtranstype
Definition: primnodes.h:276
List * onConflictSet
Definition: primnodes.h:1458
Oid varcollid
Definition: primnodes.h:150
Index ressortgroupref
Definition: primnodes.h:1333
Oid aggtype
Definition: primnodes.h:273
Alias * alias
Definition: primnodes.h:71
OpExpr DistinctExpr
Definition: primnodes.h:493
NodeTag type
Definition: primnodes.h:112
bool useHashTable
Definition: primnodes.h:675
bool argisrow
Definition: primnodes.h:1158
MinMaxOp op
Definition: primnodes.h:1042
Oid minmaxcollid
Definition: primnodes.h:1040
Oid firstColCollation
Definition: primnodes.h:672
struct SetToDefault SetToDefault
char aggkind
Definition: primnodes.h:286
Cost startup_cost
Definition: primnodes.h:688
int32 resulttypmod
Definition: primnodes.h:769
Expr * arg
Definition: primnodes.h:884
int location
Definition: primnodes.h:435
Oid opno
Definition: primnodes.h:473
struct CoalesceExpr CoalesceExpr
int32 resulttypmod
Definition: primnodes.h:813
Expr * result
Definition: primnodes.h:897
List * colNames
Definition: primnodes.h:88
List * args
Definition: primnodes.h:479
List * inputcollids
Definition: primnodes.h:1010
CoercionForm relabelformat
Definition: primnodes.h:771
Expr * defresult
Definition: primnodes.h:886
Expr * expr
Definition: primnodes.h:896
int location
Definition: primnodes.h:854
CoercionForm row_format
Definition: primnodes.h:974
CoercionForm
Definition: primnodes.h:413
Node * onConflictWhere
Definition: primnodes.h:1459
int rtindex
Definition: primnodes.h:1418
Definition: pg_list.h:45
OnConflictAction
Definition: nodes.h:790
int16 AttrNumber
Definition: attnum.h:21
Oid paramtype
Definition: primnodes.h:224
int location
Definition: primnodes.h:772
char * catalogname
Definition: primnodes.h:65
bool constisnull
Definition: primnodes.h:175
Oid coalescecollid
Definition: primnodes.h:1022
bool funcvariadic
Definition: primnodes.h:429
double Cost
Definition: nodes.h:632
struct CaseExpr CaseExpr
Expr * refexpr
Definition: primnodes.h:385
bool opretset
Definition: primnodes.h:476
struct NamedArgExpr NamedArgExpr
int32 resulttypmod
Definition: primnodes.h:722
bool winstar
Definition: primnodes.h:340
AttrNumber fieldnum
Definition: primnodes.h:719
BoolExprType
Definition: primnodes.h:531
int32 vartypmod
Definition: primnodes.h:149
List * args
Definition: primnodes.h:686