PostgreSQL Source Code  git master
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-2023, 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/bitmapset.h"
22 #include "nodes/pg_list.h"
23 
24 
25 /* ----------------------------------------------------------------
26  * node definitions
27  * ----------------------------------------------------------------
28  */
29 
30 /*
31  * Alias -
32  * specifies an alias for a range variable; the alias might also
33  * specify renaming of columns within the table.
34  *
35  * Note: colnames is a list of String nodes. In Alias structs
36  * associated with RTEs, there may be entries corresponding to dropped
37  * columns; these are normally empty strings (""). See parsenodes.h for info.
38  */
39 typedef struct Alias
40 {
42  char *aliasname; /* aliased rel name (never qualified) */
43  List *colnames; /* optional list of column aliases */
45 
46 /* What to do at commit time for temporary relations */
47 typedef enum OnCommitAction
48 {
49  ONCOMMIT_NOOP, /* No ON COMMIT clause (do nothing) */
50  ONCOMMIT_PRESERVE_ROWS, /* ON COMMIT PRESERVE ROWS (do nothing) */
51  ONCOMMIT_DELETE_ROWS, /* ON COMMIT DELETE ROWS */
52  ONCOMMIT_DROP /* ON COMMIT DROP */
54 
55 /*
56  * RangeVar - range variable, used in FROM clauses
57  *
58  * Also used to represent table names in utility statements; there, the alias
59  * field is not used, and inh tells whether to apply the operation
60  * recursively to child tables. In some contexts it is also useful to carry
61  * a TEMP table indication here.
62  */
63 typedef struct RangeVar
64 {
66 
67  /* the catalog (database) name, or NULL */
68  char *catalogname;
69 
70  /* the schema name, or NULL */
71  char *schemaname;
72 
73  /* the relation/sequence name */
74  char *relname;
75 
76  /* expand rel by inheritance? recursively act on children? */
77  bool inh;
78 
79  /* see RELPERSISTENCE_* in pg_class.h */
81 
82  /* table alias & optional column aliases */
84 
85  /* token location, or -1 if unknown */
86  int location;
88 
89 /*
90  * TableFunc - node for a table function, such as XMLTABLE.
91  *
92  * Entries in the ns_names list are either String nodes containing
93  * literal namespace names, or NULL pointers to represent DEFAULT.
94  */
95 typedef struct TableFunc
96 {
98  /* list of namespace URI expressions */
99  List *ns_uris pg_node_attr(query_jumble_ignore);
100  /* list of namespace names or NULL */
101  List *ns_names pg_node_attr(query_jumble_ignore);
102  /* input document expression */
104  /* row filter expression */
106  /* column names (list of String) */
107  List *colnames pg_node_attr(query_jumble_ignore);
108  /* OID list of column type OIDs */
109  List *coltypes pg_node_attr(query_jumble_ignore);
110  /* integer list of column typmods */
111  List *coltypmods pg_node_attr(query_jumble_ignore);
112  /* OID list of column collation OIDs */
113  List *colcollations pg_node_attr(query_jumble_ignore);
114  /* list of column filter expressions */
116  /* list of column default expressions */
117  List *coldefexprs pg_node_attr(query_jumble_ignore);
118  /* nullability flag for each output column */
119  Bitmapset *notnulls pg_node_attr(query_jumble_ignore);
120  /* counts from 0; -1 if none specified */
121  int ordinalitycol pg_node_attr(query_jumble_ignore);
122  /* token location, or -1 if unknown */
123  int location;
125 
126 /*
127  * IntoClause - target information for SELECT INTO, CREATE TABLE AS, and
128  * CREATE MATERIALIZED VIEW
129  *
130  * For CREATE MATERIALIZED VIEW, viewQuery is the parsed-but-not-rewritten
131  * SELECT Query for the view; otherwise it's NULL. This is irrelevant in
132  * the query jumbling as CreateTableAsStmt already includes a reference to
133  * its own Query, so ignore it. (Although it's actually Query*, we declare
134  * it as Node* to avoid a forward reference.)
135  */
136 typedef struct IntoClause
137 {
139 
140  RangeVar *rel; /* target relation name */
141  List *colNames; /* column names to assign, or NIL */
142  char *accessMethod; /* table access method */
143  List *options; /* options from WITH clause */
144  OnCommitAction onCommit; /* what do we do at COMMIT? */
145  char *tableSpaceName; /* table space to use, or NULL */
146  /* materialized view's SELECT query */
147  Node *viewQuery pg_node_attr(query_jumble_ignore);
148  bool skipData; /* true for WITH NO DATA */
150 
151 
152 /* ----------------------------------------------------------------
153  * node types for executable expressions
154  * ----------------------------------------------------------------
155  */
156 
157 /*
158  * Expr - generic superclass for executable-expression nodes
159  *
160  * All node types that are used in executable expression trees should derive
161  * from Expr (that is, have Expr as their first field). Since Expr only
162  * contains NodeTag, this is a formality, but it is an easy form of
163  * documentation. See also the ExprState node types in execnodes.h.
164  */
165 typedef struct Expr
166 {
167  pg_node_attr(abstract)
168 
169  NodeTag type;
171 
172 /*
173  * Var - expression node representing a variable (ie, a table column)
174  *
175  * In the parser and planner, varno and varattno identify the semantic
176  * referent, which is a base-relation column unless the reference is to a join
177  * USING column that isn't semantically equivalent to either join input column
178  * (because it is a FULL join or the input column requires a type coercion).
179  * In those cases varno and varattno refer to the JOIN RTE. (Early in the
180  * planner, we replace such join references by the implied expression; but up
181  * till then we want join reference Vars to keep their original identity for
182  * query-printing purposes.)
183  *
184  * At the end of planning, Var nodes appearing in upper-level plan nodes are
185  * reassigned to point to the outputs of their subplans; for example, in a
186  * join node varno becomes INNER_VAR or OUTER_VAR and varattno becomes the
187  * index of the proper element of that subplan's target list. Similarly,
188  * INDEX_VAR is used to identify Vars that reference an index column rather
189  * than a heap column. (In ForeignScan and CustomScan plan nodes, INDEX_VAR
190  * is abused to signify references to columns of a custom scan tuple type.)
191  *
192  * ROWID_VAR is used in the planner to identify nonce variables that carry
193  * row identity information during UPDATE/DELETE/MERGE. This value should
194  * never be seen outside the planner.
195  *
196  * varnullingrels is the set of RT indexes of outer joins that can force
197  * the Var's value to null (at the point where it appears in the query).
198  * See optimizer/README for discussion of that.
199  *
200  * varlevelsup is greater than zero in Vars that represent outer references.
201  * Note that it affects the meaning of all of varno, varnullingrels, and
202  * varnosyn, all of which refer to the range table of that query level.
203  *
204  * In the parser, varnosyn and varattnosyn are either identical to
205  * varno/varattno, or they specify the column's position in an aliased JOIN
206  * RTE that hides the semantic referent RTE's refname. This is a syntactic
207  * identifier as opposed to the semantic identifier; it tells ruleutils.c
208  * how to print the Var properly. varnosyn/varattnosyn retain their values
209  * throughout planning and execution, so they are particularly helpful to
210  * identify Vars when debugging. Note, however, that a Var that is generated
211  * in the planner and doesn't correspond to any simple relation column may
212  * have varnosyn = varattnosyn = 0.
213  */
214 #define INNER_VAR (-1) /* reference to inner subplan */
215 #define OUTER_VAR (-2) /* reference to outer subplan */
216 #define INDEX_VAR (-3) /* reference to index column */
217 #define ROWID_VAR (-4) /* row identity column during planning */
218 
219 #define IS_SPECIAL_VARNO(varno) ((int) (varno) < 0)
220 
221 /* Symbols for the indexes of the special RTE entries in rules */
222 #define PRS2_OLD_VARNO 1
223 #define PRS2_NEW_VARNO 2
224 
225 typedef struct Var
226 {
228 
229  /*
230  * index of this var's relation in the range table, or
231  * INNER_VAR/OUTER_VAR/etc
232  */
233  int varno;
234 
235  /*
236  * attribute number of this var, or zero for all attrs ("whole-row Var")
237  */
239 
240  /* pg_type OID for the type of this var */
241  Oid vartype pg_node_attr(query_jumble_ignore);
242  /* pg_attribute typmod value */
243  int32 vartypmod pg_node_attr(query_jumble_ignore);
244  /* OID of collation, or InvalidOid if none */
245  Oid varcollid pg_node_attr(query_jumble_ignore);
246 
247  /*
248  * RT indexes of outer joins that can replace the Var's value with null.
249  * We can omit varnullingrels in the query jumble, because it's fully
250  * determined by varno/varlevelsup plus the Var's query location.
251  */
252  Bitmapset *varnullingrels pg_node_attr(query_jumble_ignore);
253 
254  /*
255  * for subquery variables referencing outer relations; 0 in a normal var,
256  * >0 means N levels up
257  */
259 
260  /*
261  * varnosyn/varattnosyn are ignored for equality, because Vars with
262  * different syntactic identifiers are semantically the same as long as
263  * their varno/varattno match.
264  */
265  /* syntactic relation index (0 if unknown) */
266  Index varnosyn pg_node_attr(equal_ignore, query_jumble_ignore);
267  /* syntactic attribute number */
268  AttrNumber varattnosyn pg_node_attr(equal_ignore, query_jumble_ignore);
269 
270  /* token location, or -1 if unknown */
271  int location;
272 } Var;
273 
274 /*
275  * Const
276  *
277  * Note: for varlena data types, we make a rule that a Const node's value
278  * must be in non-extended form (4-byte header, no compression or external
279  * references). This ensures that the Const node is self-contained and makes
280  * it more likely that equal() will see logically identical values as equal.
281  *
282  * Only the constant type OID is relevant for the query jumbling.
283  */
284 typedef struct Const
285 {
286  pg_node_attr(custom_copy_equal, custom_read_write)
287 
288  Expr xpr;
289  /* pg_type OID of the constant's datatype */
291  /* typmod value, if any */
292  int32 consttypmod pg_node_attr(query_jumble_ignore);
293  /* OID of collation, or InvalidOid if none */
294  Oid constcollid pg_node_attr(query_jumble_ignore);
295  /* typlen of the constant's datatype */
296  int constlen pg_node_attr(query_jumble_ignore);
297  /* the constant's value */
298  Datum constvalue pg_node_attr(query_jumble_ignore);
299  /* whether the constant is null (if true, constvalue is undefined) */
300  bool constisnull pg_node_attr(query_jumble_ignore);
301 
302  /*
303  * Whether this datatype is passed by value. If true, then all the
304  * information is stored in the Datum. If false, then the Datum contains
305  * a pointer to the information.
306  */
307  bool constbyval pg_node_attr(query_jumble_ignore);
308 
309  /*
310  * token location, or -1 if unknown. All constants are tracked as
311  * locations in query jumbling, to be marked as parameters.
312  */
313  int location pg_node_attr(query_jumble_location);
315 
316 /*
317  * Param
318  *
319  * paramkind specifies the kind of parameter. The possible values
320  * for this field are:
321  *
322  * PARAM_EXTERN: The parameter value is supplied from outside the plan.
323  * Such parameters are numbered from 1 to n.
324  *
325  * PARAM_EXEC: The parameter is an internal executor parameter, used
326  * for passing values into and out of sub-queries or from
327  * nestloop joins to their inner scans.
328  * For historical reasons, such parameters are numbered from 0.
329  * These numbers are independent of PARAM_EXTERN numbers.
330  *
331  * PARAM_SUBLINK: The parameter represents an output column of a SubLink
332  * node's sub-select. The column number is contained in the
333  * `paramid' field. (This type of Param is converted to
334  * PARAM_EXEC during planning.)
335  *
336  * PARAM_MULTIEXPR: Like PARAM_SUBLINK, the parameter represents an
337  * output column of a SubLink node's sub-select, but here, the
338  * SubLink is always a MULTIEXPR SubLink. The high-order 16 bits
339  * of the `paramid' field contain the SubLink's subLinkId, and
340  * the low-order 16 bits contain the column number. (This type
341  * of Param is also converted to PARAM_EXEC during planning.)
342  */
343 typedef enum ParamKind
344 {
350 
351 typedef struct Param
352 {
354  ParamKind paramkind; /* kind of parameter. See above */
355  int paramid; /* numeric ID for parameter */
356  Oid paramtype; /* pg_type OID of parameter's datatype */
357  /* typmod value, if known */
358  int32 paramtypmod pg_node_attr(query_jumble_ignore);
359  /* OID of collation, or InvalidOid if none */
360  Oid paramcollid pg_node_attr(query_jumble_ignore);
361  /* token location, or -1 if unknown */
362  int location;
364 
365 /*
366  * Aggref
367  *
368  * The aggregate's args list is a targetlist, ie, a list of TargetEntry nodes.
369  *
370  * For a normal (non-ordered-set) aggregate, the non-resjunk TargetEntries
371  * represent the aggregate's regular arguments (if any) and resjunk TLEs can
372  * be added at the end to represent ORDER BY expressions that are not also
373  * arguments. As in a top-level Query, the TLEs can be marked with
374  * ressortgroupref indexes to let them be referenced by SortGroupClause
375  * entries in the aggorder and/or aggdistinct lists. This represents ORDER BY
376  * and DISTINCT operations to be applied to the aggregate input rows before
377  * they are passed to the transition function. The grammar only allows a
378  * simple "DISTINCT" specifier for the arguments, but we use the full
379  * query-level representation to allow more code sharing.
380  *
381  * For an ordered-set aggregate, the args list represents the WITHIN GROUP
382  * (aggregated) arguments, all of which will be listed in the aggorder list.
383  * DISTINCT is not supported in this case, so aggdistinct will be NIL.
384  * The direct arguments appear in aggdirectargs (as a list of plain
385  * expressions, not TargetEntry nodes).
386  *
387  * aggtranstype is the data type of the state transition values for this
388  * aggregate (resolved to an actual type, if agg's transtype is polymorphic).
389  * This is determined during planning and is InvalidOid before that.
390  *
391  * aggargtypes is an OID list of the data types of the direct and regular
392  * arguments. Normally it's redundant with the aggdirectargs and args lists,
393  * but in a combining aggregate, it's not because the args list has been
394  * replaced with a single argument representing the partial-aggregate
395  * transition values.
396  *
397  * aggpresorted is set by the query planner for ORDER BY and DISTINCT
398  * aggregates where the chosen plan provides presorted input for this
399  * aggregate during execution.
400  *
401  * aggsplit indicates the expected partial-aggregation mode for the Aggref's
402  * parent plan node. It's always set to AGGSPLIT_SIMPLE in the parser, but
403  * the planner might change it to something else. We use this mainly as
404  * a crosscheck that the Aggrefs match the plan; but note that when aggsplit
405  * indicates a non-final mode, aggtype reflects the transition data type
406  * not the SQL-level output type of the aggregate.
407  *
408  * aggno and aggtransno are -1 in the parse stage, and are set in planning.
409  * Aggregates with the same 'aggno' represent the same aggregate expression,
410  * and can share the result. Aggregates with same 'transno' but different
411  * 'aggno' can share the same transition state, only the final function needs
412  * to be called separately.
413  *
414  * Information related to collations, transition types and internal states
415  * are irrelevant for the query jumbling.
416  */
417 typedef struct Aggref
418 {
420 
421  /* pg_proc Oid of the aggregate */
423 
424  /* type Oid of result of the aggregate */
425  Oid aggtype pg_node_attr(query_jumble_ignore);
426 
427  /* OID of collation of result */
428  Oid aggcollid pg_node_attr(query_jumble_ignore);
429 
430  /* OID of collation that function should use */
431  Oid inputcollid pg_node_attr(query_jumble_ignore);
432 
433  /*
434  * type Oid of aggregate's transition value; ignored for equal since it
435  * might not be set yet
436  */
437  Oid aggtranstype pg_node_attr(equal_ignore, query_jumble_ignore);
438 
439  /* type Oids of direct and aggregated args */
440  List *aggargtypes pg_node_attr(query_jumble_ignore);
441 
442  /* direct arguments, if an ordered-set agg */
444 
445  /* aggregated arguments and sort expressions */
447 
448  /* ORDER BY (list of SortGroupClause) */
450 
451  /* DISTINCT (list of SortGroupClause) */
453 
454  /* FILTER expression, if any */
456 
457  /* true if argument list was really '*' */
458  bool aggstar pg_node_attr(query_jumble_ignore);
459 
460  /*
461  * true if variadic arguments have been combined into an array last
462  * argument
463  */
464  bool aggvariadic pg_node_attr(query_jumble_ignore);
465 
466  /* aggregate kind (see pg_aggregate.h) */
467  char aggkind pg_node_attr(query_jumble_ignore);
468 
469  /* aggregate input already sorted */
470  bool aggpresorted pg_node_attr(equal_ignore, query_jumble_ignore);
471 
472  /* > 0 if agg belongs to outer query */
473  Index agglevelsup pg_node_attr(query_jumble_ignore);
474 
475  /* expected agg-splitting mode of parent Agg */
476  AggSplit aggsplit pg_node_attr(query_jumble_ignore);
477 
478  /* unique ID within the Agg node */
479  int aggno pg_node_attr(query_jumble_ignore);
480 
481  /* unique ID of transition state in the Agg */
482  int aggtransno pg_node_attr(query_jumble_ignore);
483 
484  /* token location, or -1 if unknown */
485  int location;
487 
488 /*
489  * GroupingFunc
490  *
491  * A GroupingFunc is a GROUPING(...) expression, which behaves in many ways
492  * like an aggregate function (e.g. it "belongs" to a specific query level,
493  * which might not be the one immediately containing it), but also differs in
494  * an important respect: it never evaluates its arguments, they merely
495  * designate expressions from the GROUP BY clause of the query level to which
496  * it belongs.
497  *
498  * The spec defines the evaluation of GROUPING() purely by syntactic
499  * replacement, but we make it a real expression for optimization purposes so
500  * that one Agg node can handle multiple grouping sets at once. Evaluating the
501  * result only needs the column positions to check against the grouping set
502  * being projected. However, for EXPLAIN to produce meaningful output, we have
503  * to keep the original expressions around, since expression deparse does not
504  * give us any feasible way to get at the GROUP BY clause.
505  *
506  * Also, we treat two GroupingFunc nodes as equal if they have equal arguments
507  * lists and agglevelsup, without comparing the refs and cols annotations.
508  *
509  * In raw parse output we have only the args list; parse analysis fills in the
510  * refs list, and the planner fills in the cols list.
511  *
512  * All the fields used as information for an internal state are irrelevant
513  * for the query jumbling.
514  */
515 typedef struct GroupingFunc
516 {
518 
519  /* arguments, not evaluated but kept for benefit of EXPLAIN etc. */
520  List *args pg_node_attr(query_jumble_ignore);
521 
522  /* ressortgrouprefs of arguments */
523  List *refs pg_node_attr(equal_ignore);
524 
525  /* actual column positions set by planner */
526  List *cols pg_node_attr(equal_ignore, query_jumble_ignore);
527 
528  /* same as Aggref.agglevelsup */
530 
531  /* token location */
532  int location;
534 
535 /*
536  * WindowFunc
537  *
538  * Collation information is irrelevant for the query jumbling, as is the
539  * internal state information of the node like "winstar" and "winagg".
540  */
541 typedef struct WindowFunc
542 {
544  /* pg_proc Oid of the function */
546  /* type Oid of result of the window function */
547  Oid wintype pg_node_attr(query_jumble_ignore);
548  /* OID of collation of result */
549  Oid wincollid pg_node_attr(query_jumble_ignore);
550  /* OID of collation that function should use */
551  Oid inputcollid pg_node_attr(query_jumble_ignore);
552  /* arguments to the window function */
554  /* FILTER expression, if any */
556  /* index of associated WindowClause */
558  /* true if argument list was really '*' */
559  bool winstar pg_node_attr(query_jumble_ignore);
560  /* is function a simple aggregate? */
561  bool winagg pg_node_attr(query_jumble_ignore);
562  /* token location, or -1 if unknown */
563  int location;
565 
566 /*
567  * SubscriptingRef: describes a subscripting operation over a container
568  * (array, etc).
569  *
570  * A SubscriptingRef can describe fetching a single element from a container,
571  * fetching a part of a container (e.g. an array slice), storing a single
572  * element into a container, or storing a slice. The "store" cases work with
573  * an initial container value and a source value that is inserted into the
574  * appropriate part of the container; the result of the operation is an
575  * entire new modified container value.
576  *
577  * If reflowerindexpr = NIL, then we are fetching or storing a single container
578  * element at the subscripts given by refupperindexpr. Otherwise we are
579  * fetching or storing a container slice, that is a rectangular subcontainer
580  * with lower and upper bounds given by the index expressions.
581  * reflowerindexpr must be the same length as refupperindexpr when it
582  * is not NIL.
583  *
584  * In the slice case, individual expressions in the subscript lists can be
585  * NULL, meaning "substitute the array's current lower or upper bound".
586  * (Non-array containers may or may not support this.)
587  *
588  * refcontainertype is the actual container type that determines the
589  * subscripting semantics. (This will generally be either the exposed type of
590  * refexpr, or the base type if that is a domain.) refelemtype is the type of
591  * the container's elements; this is saved for the use of the subscripting
592  * functions, but is not used by the core code. refrestype, reftypmod, and
593  * refcollid describe the type of the SubscriptingRef's result. In a store
594  * expression, refrestype will always match refcontainertype; in a fetch,
595  * it could be refelemtype for an element fetch, or refcontainertype for a
596  * slice fetch, or possibly something else as determined by type-specific
597  * subscripting logic. Likewise, reftypmod and refcollid will match the
598  * container's properties in a store, but could be different in a fetch.
599  *
600  * Any internal state data is ignored for the query jumbling.
601  *
602  * Note: for the cases where a container is returned, if refexpr yields a R/W
603  * expanded container, then the implementation is allowed to modify that
604  * object in-place and return the same object.
605  */
606 typedef struct SubscriptingRef
607 {
609  /* type of the container proper */
610  Oid refcontainertype pg_node_attr(query_jumble_ignore);
611  /* the container type's pg_type.typelem */
612  Oid refelemtype pg_node_attr(query_jumble_ignore);
613  /* type of the SubscriptingRef's result */
614  Oid refrestype pg_node_attr(query_jumble_ignore);
615  /* typmod of the result */
616  int32 reftypmod pg_node_attr(query_jumble_ignore);
617  /* collation of result, or InvalidOid if none */
618  Oid refcollid pg_node_attr(query_jumble_ignore);
619  /* expressions that evaluate to upper container indexes */
621 
622  /*
623  * expressions that evaluate to lower container indexes, or NIL for single
624  * container element.
625  */
627  /* the expression that evaluates to a container value */
629  /* expression for the source value, or NULL if fetch */
632 
633 /*
634  * CoercionContext - distinguishes the allowed set of type casts
635  *
636  * NB: ordering of the alternatives is significant; later (larger) values
637  * allow more casts than earlier ones.
638  */
639 typedef enum CoercionContext
640 {
641  COERCION_IMPLICIT, /* coercion in context of expression */
642  COERCION_ASSIGNMENT, /* coercion in context of assignment */
643  COERCION_PLPGSQL, /* if no assignment cast, use CoerceViaIO */
644  COERCION_EXPLICIT /* explicit cast operation */
646 
647 /*
648  * CoercionForm - how to display a FuncExpr or related node
649  *
650  * "Coercion" is a bit of a misnomer, since this value records other
651  * special syntaxes besides casts, but for now we'll keep this naming.
652  *
653  * NB: equal() ignores CoercionForm fields, therefore this *must* not carry
654  * any semantically significant information. We need that behavior so that
655  * the planner will consider equivalent implicit and explicit casts to be
656  * equivalent. In cases where those actually behave differently, the coercion
657  * function's arguments will be different.
658  */
659 typedef enum CoercionForm
660 {
661  COERCE_EXPLICIT_CALL, /* display as a function call */
662  COERCE_EXPLICIT_CAST, /* display as an explicit cast */
663  COERCE_IMPLICIT_CAST, /* implicit cast, so hide it */
664  COERCE_SQL_SYNTAX /* display with SQL-mandated special syntax */
666 
667 /*
668  * FuncExpr - expression node for a function call
669  *
670  * Collation information is irrelevant for the query jumbling, only the
671  * arguments and the function OID matter.
672  */
673 typedef struct FuncExpr
674 {
676  /* PG_PROC OID of the function */
678  /* PG_TYPE OID of result value */
679  Oid funcresulttype pg_node_attr(query_jumble_ignore);
680  /* true if function returns set */
681  bool funcretset pg_node_attr(query_jumble_ignore);
682 
683  /*
684  * true if variadic arguments have been combined into an array last
685  * argument
686  */
687  bool funcvariadic pg_node_attr(query_jumble_ignore);
688  /* how to display this function call */
689  CoercionForm funcformat pg_node_attr(query_jumble_ignore);
690  /* OID of collation of result */
691  Oid funccollid pg_node_attr(query_jumble_ignore);
692  /* OID of collation that function should use */
693  Oid inputcollid pg_node_attr(query_jumble_ignore);
694  /* arguments to the function */
696  /* token location, or -1 if unknown */
697  int location;
699 
700 /*
701  * NamedArgExpr - a named argument of a function
702  *
703  * This node type can only appear in the args list of a FuncCall or FuncExpr
704  * node. We support pure positional call notation (no named arguments),
705  * named notation (all arguments are named), and mixed notation (unnamed
706  * arguments followed by named ones).
707  *
708  * Parse analysis sets argnumber to the positional index of the argument,
709  * but doesn't rearrange the argument list.
710  *
711  * The planner will convert argument lists to pure positional notation
712  * during expression preprocessing, so execution never sees a NamedArgExpr.
713  */
714 typedef struct NamedArgExpr
715 {
717  /* the argument expression */
719  /* the name */
720  char *name pg_node_attr(query_jumble_ignore);
721  /* argument's number in positional notation */
723  /* argument name location, or -1 if unknown */
724  int location;
726 
727 /*
728  * OpExpr - expression node for an operator invocation
729  *
730  * Semantically, this is essentially the same as a function call.
731  *
732  * Note that opfuncid is not necessarily filled in immediately on creation
733  * of the node. The planner makes sure it is valid before passing the node
734  * tree to the executor, but during parsing/planning opfuncid can be 0.
735  * Therefore, equal() will accept a zero value as being equal to other values.
736  *
737  * Internal state information and collation data is irrelevant for the query
738  * jumbling.
739  */
740 typedef struct OpExpr
741 {
743 
744  /* PG_OPERATOR OID of the operator */
746 
747  /* PG_PROC OID of underlying function */
748  Oid opfuncid pg_node_attr(equal_ignore_if_zero, query_jumble_ignore);
749 
750  /* PG_TYPE OID of result value */
751  Oid opresulttype pg_node_attr(query_jumble_ignore);
752 
753  /* true if operator returns set */
754  bool opretset pg_node_attr(query_jumble_ignore);
755 
756  /* OID of collation of result */
757  Oid opcollid pg_node_attr(query_jumble_ignore);
758 
759  /* OID of collation that operator should use */
760  Oid inputcollid pg_node_attr(query_jumble_ignore);
761 
762  /* arguments to the operator (1 or 2) */
764 
765  /* token location, or -1 if unknown */
766  int location;
768 
769 /*
770  * DistinctExpr - expression node for "x IS DISTINCT FROM y"
771  *
772  * Except for the nodetag, this is represented identically to an OpExpr
773  * referencing the "=" operator for x and y.
774  * We use "=", not the more obvious "<>", because more datatypes have "="
775  * than "<>". This means the executor must invert the operator result.
776  * Note that the operator function won't be called at all if either input
777  * is NULL, since then the result can be determined directly.
778  */
780 
781 /*
782  * NullIfExpr - a NULLIF expression
783  *
784  * Like DistinctExpr, this is represented the same as an OpExpr referencing
785  * the "=" operator for x and y.
786  */
788 
789 /*
790  * ScalarArrayOpExpr - expression node for "scalar op ANY/ALL (array)"
791  *
792  * The operator must yield boolean. It is applied to the left operand
793  * and each element of the righthand array, and the results are combined
794  * with OR or AND (for ANY or ALL respectively). The node representation
795  * is almost the same as for the underlying operator, but we need a useOr
796  * flag to remember whether it's ANY or ALL, and we don't have to store
797  * the result type (or the collation) because it must be boolean.
798  *
799  * A ScalarArrayOpExpr with a valid hashfuncid is evaluated during execution
800  * by building a hash table containing the Const values from the RHS arg.
801  * This table is probed during expression evaluation. The planner will set
802  * hashfuncid to the hash function which must be used to build and probe the
803  * hash table. The executor determines if it should use hash-based checks or
804  * the more traditional means based on if the hashfuncid is set or not.
805  *
806  * When performing hashed NOT IN, the negfuncid will also be set to the
807  * equality function which the hash table must use to build and probe the hash
808  * table. opno and opfuncid will remain set to the <> operator and its
809  * corresponding function and won't be used during execution. For
810  * non-hashtable based NOT INs, negfuncid will be set to InvalidOid. See
811  * convert_saop_to_hashed_saop().
812  *
813  * Similar to OpExpr, opfuncid, hashfuncid, and negfuncid are not necessarily
814  * filled in right away, so will be ignored for equality if they are not set
815  * yet.
816  *
817  * OID entries of the internal function types are irrelevant for the query
818  * jumbling, but the operator OID and the arguments are.
819  */
820 typedef struct ScalarArrayOpExpr
821 {
823 
824  /* PG_OPERATOR OID of the operator */
826 
827  /* PG_PROC OID of comparison function */
828  Oid opfuncid pg_node_attr(equal_ignore_if_zero, query_jumble_ignore);
829 
830  /* PG_PROC OID of hash func or InvalidOid */
831  Oid hashfuncid pg_node_attr(equal_ignore_if_zero, query_jumble_ignore);
832 
833  /* PG_PROC OID of negator of opfuncid function or InvalidOid. See above */
834  Oid negfuncid pg_node_attr(equal_ignore_if_zero, query_jumble_ignore);
835 
836  /* true for ANY, false for ALL */
837  bool useOr;
838 
839  /* OID of collation that operator should use */
840  Oid inputcollid pg_node_attr(query_jumble_ignore);
841 
842  /* the scalar and array operands */
844 
845  /* token location, or -1 if unknown */
846  int location;
848 
849 /*
850  * BoolExpr - expression node for the basic Boolean operators AND, OR, NOT
851  *
852  * Notice the arguments are given as a List. For NOT, of course the list
853  * must always have exactly one element. For AND and OR, there can be two
854  * or more arguments.
855  */
856 typedef enum BoolExprType
857 {
860 
861 typedef struct BoolExpr
862 {
863  pg_node_attr(custom_read_write)
864 
865  Expr xpr;
867  List *args; /* arguments to this expression */
868  int location; /* token location, or -1 if unknown */
870 
871 /*
872  * SubLink
873  *
874  * A SubLink represents a subselect appearing in an expression, and in some
875  * cases also the combining operator(s) just above it. The subLinkType
876  * indicates the form of the expression represented:
877  * EXISTS_SUBLINK EXISTS(SELECT ...)
878  * ALL_SUBLINK (lefthand) op ALL (SELECT ...)
879  * ANY_SUBLINK (lefthand) op ANY (SELECT ...)
880  * ROWCOMPARE_SUBLINK (lefthand) op (SELECT ...)
881  * EXPR_SUBLINK (SELECT with single targetlist item ...)
882  * MULTIEXPR_SUBLINK (SELECT with multiple targetlist items ...)
883  * ARRAY_SUBLINK ARRAY(SELECT with single targetlist item ...)
884  * CTE_SUBLINK WITH query (never actually part of an expression)
885  * For ALL, ANY, and ROWCOMPARE, the lefthand is a list of expressions of the
886  * same length as the subselect's targetlist. ROWCOMPARE will *always* have
887  * a list with more than one entry; if the subselect has just one target
888  * then the parser will create an EXPR_SUBLINK instead (and any operator
889  * above the subselect will be represented separately).
890  * ROWCOMPARE, EXPR, and MULTIEXPR require the subselect to deliver at most
891  * one row (if it returns no rows, the result is NULL).
892  * ALL, ANY, and ROWCOMPARE require the combining operators to deliver boolean
893  * results. ALL and ANY combine the per-row results using AND and OR
894  * semantics respectively.
895  * ARRAY requires just one target column, and creates an array of the target
896  * column's type using any number of rows resulting from the subselect.
897  *
898  * SubLink is classed as an Expr node, but it is not actually executable;
899  * it must be replaced in the expression tree by a SubPlan node during
900  * planning.
901  *
902  * NOTE: in the raw output of gram.y, testexpr contains just the raw form
903  * of the lefthand expression (if any), and operName is the String name of
904  * the combining operator. Also, subselect is a raw parsetree. During parse
905  * analysis, the parser transforms testexpr into a complete boolean expression
906  * that compares the lefthand value(s) to PARAM_SUBLINK nodes representing the
907  * output columns of the subselect. And subselect is transformed to a Query.
908  * This is the representation seen in saved rules and in the rewriter.
909  *
910  * In EXISTS, EXPR, MULTIEXPR, and ARRAY SubLinks, testexpr and operName
911  * are unused and are always null.
912  *
913  * subLinkId is currently used only for MULTIEXPR SubLinks, and is zero in
914  * other SubLinks. This number identifies different multiple-assignment
915  * subqueries within an UPDATE statement's SET list. It is unique only
916  * within a particular targetlist. The output column(s) of the MULTIEXPR
917  * are referenced by PARAM_MULTIEXPR Params appearing elsewhere in the tlist.
918  *
919  * The CTE_SUBLINK case never occurs in actual SubLink nodes, but it is used
920  * in SubPlans generated for WITH subqueries.
921  */
922 typedef enum SubLinkType
923 {
931  CTE_SUBLINK /* for SubPlans only */
933 
934 
935 typedef struct SubLink
936 {
938  SubLinkType subLinkType; /* see above */
939  int subLinkId; /* ID (1..n); 0 if not MULTIEXPR */
940  Node *testexpr; /* outer-query test for ALL/ANY/ROWCOMPARE */
941  /* originally specified operator name */
942  List *operName pg_node_attr(query_jumble_ignore);
943  /* subselect as Query* or raw parsetree */
945  int location; /* token location, or -1 if unknown */
947 
948 /*
949  * SubPlan - executable expression node for a subplan (sub-SELECT)
950  *
951  * The planner replaces SubLink nodes in expression trees with SubPlan
952  * nodes after it has finished planning the subquery. SubPlan references
953  * a sub-plantree stored in the subplans list of the toplevel PlannedStmt.
954  * (We avoid a direct link to make it easier to copy expression trees
955  * without causing multiple processing of the subplan.)
956  *
957  * In an ordinary subplan, testexpr points to an executable expression
958  * (OpExpr, an AND/OR tree of OpExprs, or RowCompareExpr) for the combining
959  * operator(s); the left-hand arguments are the original lefthand expressions,
960  * and the right-hand arguments are PARAM_EXEC Param nodes representing the
961  * outputs of the sub-select. (NOTE: runtime coercion functions may be
962  * inserted as well.) This is just the same expression tree as testexpr in
963  * the original SubLink node, but the PARAM_SUBLINK nodes are replaced by
964  * suitably numbered PARAM_EXEC nodes.
965  *
966  * If the sub-select becomes an initplan rather than a subplan, the executable
967  * expression is part of the outer plan's expression tree (and the SubPlan
968  * node itself is not, but rather is found in the outer plan's initPlan
969  * list). In this case testexpr is NULL to avoid duplication.
970  *
971  * The planner also derives lists of the values that need to be passed into
972  * and out of the subplan. Input values are represented as a list "args" of
973  * expressions to be evaluated in the outer-query context (currently these
974  * args are always just Vars, but in principle they could be any expression).
975  * The values are assigned to the global PARAM_EXEC params indexed by parParam
976  * (the parParam and args lists must have the same ordering). setParam is a
977  * list of the PARAM_EXEC params that are computed by the sub-select, if it
978  * is an initplan or MULTIEXPR plan; they are listed in order by sub-select
979  * output column position. (parParam and setParam are integer Lists, not
980  * Bitmapsets, because their ordering is significant.)
981  *
982  * Also, the planner computes startup and per-call costs for use of the
983  * SubPlan. Note that these include the cost of the subquery proper,
984  * evaluation of the testexpr if any, and any hashtable management overhead.
985  */
986 typedef struct SubPlan
987 {
988  pg_node_attr(no_query_jumble)
989 
990  Expr xpr;
991  /* Fields copied from original SubLink: */
992  SubLinkType subLinkType; /* see above */
993  /* The combining operators, transformed to an executable expression: */
994  Node *testexpr; /* OpExpr or RowCompareExpr expression tree */
995  List *paramIds; /* IDs of Params embedded in the above */
996  /* Identification of the Plan tree to use: */
997  int plan_id; /* Index (from 1) in PlannedStmt.subplans */
998  /* Identification of the SubPlan for EXPLAIN and debugging purposes: */
999  char *plan_name; /* A name assigned during planning */
1000  /* Extra data useful for determining subplan's output type: */
1001  Oid firstColType; /* Type of first column of subplan result */
1002  int32 firstColTypmod; /* Typmod of first column of subplan result */
1003  Oid firstColCollation; /* Collation of first column of subplan
1004  * result */
1005  /* Information about execution strategy: */
1006  bool useHashTable; /* true to store subselect output in a hash
1007  * table (implies we are doing "IN") */
1008  bool unknownEqFalse; /* true if it's okay to return FALSE when the
1009  * spec result is UNKNOWN; this allows much
1010  * simpler handling of null values */
1011  bool parallel_safe; /* is the subplan parallel-safe? */
1012  /* Note: parallel_safe does not consider contents of testexpr or args */
1013  /* Information for passing params into and out of the subselect: */
1014  /* setParam and parParam are lists of integers (param IDs) */
1015  List *setParam; /* initplan and MULTIEXPR subqueries have to
1016  * set these Params for parent plan */
1017  List *parParam; /* indices of input Params from parent plan */
1018  List *args; /* exprs to pass as parParam values */
1019  /* Estimated execution costs: */
1020  Cost startup_cost; /* one-time setup cost */
1021  Cost per_call_cost; /* cost for each subplan evaluation */
1023 
1024 /*
1025  * AlternativeSubPlan - expression node for a choice among SubPlans
1026  *
1027  * This is used only transiently during planning: by the time the plan
1028  * reaches the executor, all AlternativeSubPlan nodes have been removed.
1029  *
1030  * The subplans are given as a List so that the node definition need not
1031  * change if there's ever more than two alternatives. For the moment,
1032  * though, there are always exactly two; and the first one is the fast-start
1033  * plan.
1034  */
1035 typedef struct AlternativeSubPlan
1036 {
1037  pg_node_attr(no_query_jumble)
1038 
1039  Expr xpr;
1040  List *subplans; /* SubPlan(s) with equivalent results */
1042 
1043 /* ----------------
1044  * FieldSelect
1045  *
1046  * FieldSelect represents the operation of extracting one field from a tuple
1047  * value. At runtime, the input expression is expected to yield a rowtype
1048  * Datum. The specified field number is extracted and returned as a Datum.
1049  * ----------------
1050  */
1051 
1052 typedef struct FieldSelect
1053 {
1055  Expr *arg; /* input expression */
1056  AttrNumber fieldnum; /* attribute number of field to extract */
1057  /* type of the field (result type of this node) */
1058  Oid resulttype pg_node_attr(query_jumble_ignore);
1059  /* output typmod (usually -1) */
1060  int32 resulttypmod pg_node_attr(query_jumble_ignore);
1061  /* OID of collation of the field */
1062  Oid resultcollid pg_node_attr(query_jumble_ignore);
1064 
1065 /* ----------------
1066  * FieldStore
1067  *
1068  * FieldStore represents the operation of modifying one field in a tuple
1069  * value, yielding a new tuple value (the input is not touched!). Like
1070  * the assign case of SubscriptingRef, this is used to implement UPDATE of a
1071  * portion of a column.
1072  *
1073  * resulttype is always a named composite type (not a domain). To update
1074  * a composite domain value, apply CoerceToDomain to the FieldStore.
1075  *
1076  * A single FieldStore can actually represent updates of several different
1077  * fields. The parser only generates FieldStores with single-element lists,
1078  * but the planner will collapse multiple updates of the same base column
1079  * into one FieldStore.
1080  * ----------------
1081  */
1082 
1083 typedef struct FieldStore
1084 {
1086  Expr *arg; /* input tuple value */
1087  List *newvals; /* new value(s) for field(s) */
1088  /* integer list of field attnums */
1089  List *fieldnums pg_node_attr(query_jumble_ignore);
1090  /* type of result (same as type of arg) */
1091  Oid resulttype pg_node_attr(query_jumble_ignore);
1092  /* Like RowExpr, we deliberately omit a typmod and collation here */
1094 
1095 /* ----------------
1096  * RelabelType
1097  *
1098  * RelabelType represents a "dummy" type coercion between two binary-
1099  * compatible datatypes, such as reinterpreting the result of an OID
1100  * expression as an int4. It is a no-op at runtime; we only need it
1101  * to provide a place to store the correct type to be attributed to
1102  * the expression result during type resolution. (We can't get away
1103  * with just overwriting the type field of the input expression node,
1104  * so we need a separate node to show the coercion's result type.)
1105  * ----------------
1106  */
1107 
1108 typedef struct RelabelType
1109 {
1111  Expr *arg; /* input expression */
1112  Oid resulttype; /* output type of coercion expression */
1113  /* output typmod (usually -1) */
1114  int32 resulttypmod pg_node_attr(query_jumble_ignore);
1115  /* OID of collation, or InvalidOid if none */
1116  Oid resultcollid pg_node_attr(query_jumble_ignore);
1117  /* how to display this node */
1118  CoercionForm relabelformat pg_node_attr(query_jumble_ignore);
1119  int location; /* token location, or -1 if unknown */
1121 
1122 /* ----------------
1123  * CoerceViaIO
1124  *
1125  * CoerceViaIO represents a type coercion between two types whose textual
1126  * representations are compatible, implemented by invoking the source type's
1127  * typoutput function then the destination type's typinput function.
1128  * ----------------
1129  */
1130 
1131 typedef struct CoerceViaIO
1132 {
1134  Expr *arg; /* input expression */
1135  Oid resulttype; /* output type of coercion */
1136  /* output typmod is not stored, but is presumed -1 */
1137  /* OID of collation, or InvalidOid if none */
1138  Oid resultcollid pg_node_attr(query_jumble_ignore);
1139  /* how to display this node */
1140  CoercionForm coerceformat pg_node_attr(query_jumble_ignore);
1141  int location; /* token location, or -1 if unknown */
1143 
1144 /* ----------------
1145  * ArrayCoerceExpr
1146  *
1147  * ArrayCoerceExpr represents a type coercion from one array type to another,
1148  * which is implemented by applying the per-element coercion expression
1149  * "elemexpr" to each element of the source array. Within elemexpr, the
1150  * source element is represented by a CaseTestExpr node. Note that even if
1151  * elemexpr is a no-op (that is, just CaseTestExpr + RelabelType), the
1152  * coercion still requires some effort: we have to fix the element type OID
1153  * stored in the array header.
1154  * ----------------
1155  */
1156 
1157 typedef struct ArrayCoerceExpr
1158 {
1160  Expr *arg; /* input expression (yields an array) */
1161  Expr *elemexpr; /* expression representing per-element work */
1162  Oid resulttype; /* output type of coercion (an array type) */
1163  /* output typmod (also element typmod) */
1164  int32 resulttypmod pg_node_attr(query_jumble_ignore);
1165  /* OID of collation, or InvalidOid if none */
1166  Oid resultcollid pg_node_attr(query_jumble_ignore);
1167  /* how to display this node */
1168  CoercionForm coerceformat pg_node_attr(query_jumble_ignore);
1169  int location; /* token location, or -1 if unknown */
1171 
1172 /* ----------------
1173  * ConvertRowtypeExpr
1174  *
1175  * ConvertRowtypeExpr represents a type coercion from one composite type
1176  * to another, where the source type is guaranteed to contain all the columns
1177  * needed for the destination type plus possibly others; the columns need not
1178  * be in the same positions, but are matched up by name. This is primarily
1179  * used to convert a whole-row value of an inheritance child table into a
1180  * valid whole-row value of its parent table's rowtype. Both resulttype
1181  * and the exposed type of "arg" must be named composite types (not domains).
1182  * ----------------
1183  */
1184 
1185 typedef struct ConvertRowtypeExpr
1186 {
1188  Expr *arg; /* input expression */
1189  Oid resulttype; /* output type (always a composite type) */
1190  /* Like RowExpr, we deliberately omit a typmod and collation here */
1191  /* how to display this node */
1192  CoercionForm convertformat pg_node_attr(query_jumble_ignore);
1193  int location; /* token location, or -1 if unknown */
1195 
1196 /*----------
1197  * CollateExpr - COLLATE
1198  *
1199  * The planner replaces CollateExpr with RelabelType during expression
1200  * preprocessing, so execution never sees a CollateExpr.
1201  *----------
1202  */
1203 typedef struct CollateExpr
1204 {
1206  Expr *arg; /* input expression */
1207  Oid collOid; /* collation's OID */
1208  int location; /* token location, or -1 if unknown */
1210 
1211 /*----------
1212  * CaseExpr - a CASE expression
1213  *
1214  * We support two distinct forms of CASE expression:
1215  * CASE WHEN boolexpr THEN expr [ WHEN boolexpr THEN expr ... ]
1216  * CASE testexpr WHEN compexpr THEN expr [ WHEN compexpr THEN expr ... ]
1217  * These are distinguishable by the "arg" field being NULL in the first case
1218  * and the testexpr in the second case.
1219  *
1220  * In the raw grammar output for the second form, the condition expressions
1221  * of the WHEN clauses are just the comparison values. Parse analysis
1222  * converts these to valid boolean expressions of the form
1223  * CaseTestExpr '=' compexpr
1224  * where the CaseTestExpr node is a placeholder that emits the correct
1225  * value at runtime. This structure is used so that the testexpr need be
1226  * evaluated only once. Note that after parse analysis, the condition
1227  * expressions always yield boolean.
1228  *
1229  * Note: we can test whether a CaseExpr has been through parse analysis
1230  * yet by checking whether casetype is InvalidOid or not.
1231  *----------
1232  */
1233 typedef struct CaseExpr
1234 {
1236  /* type of expression result */
1237  Oid casetype pg_node_attr(query_jumble_ignore);
1238  /* OID of collation, or InvalidOid if none */
1239  Oid casecollid pg_node_attr(query_jumble_ignore);
1240  Expr *arg; /* implicit equality comparison argument */
1241  List *args; /* the arguments (list of WHEN clauses) */
1242  Expr *defresult; /* the default result (ELSE clause) */
1243  int location; /* token location, or -1 if unknown */
1245 
1246 /*
1247  * CaseWhen - one arm of a CASE expression
1248  */
1249 typedef struct CaseWhen
1250 {
1252  Expr *expr; /* condition expression */
1253  Expr *result; /* substitution result */
1254  int location; /* token location, or -1 if unknown */
1256 
1257 /*
1258  * Placeholder node for the test value to be processed by a CASE expression.
1259  * This is effectively like a Param, but can be implemented more simply
1260  * since we need only one replacement value at a time.
1261  *
1262  * We also abuse this node type for some other purposes, including:
1263  * * Placeholder for the current array element value in ArrayCoerceExpr;
1264  * see build_coercion_expression().
1265  * * Nested FieldStore/SubscriptingRef assignment expressions in INSERT/UPDATE;
1266  * see transformAssignmentIndirection().
1267  * * Placeholder for intermediate results in some SQL/JSON expression nodes,
1268  * such as JsonConstructorExpr.
1269  *
1270  * The uses in CaseExpr and ArrayCoerceExpr are safe only to the extent that
1271  * there is not any other CaseExpr or ArrayCoerceExpr between the value source
1272  * node and its child CaseTestExpr(s). This is true in the parse analysis
1273  * output, but the planner's function-inlining logic has to be careful not to
1274  * break it.
1275  *
1276  * The nested-assignment-expression case is safe because the only node types
1277  * that can be above such CaseTestExprs are FieldStore and SubscriptingRef.
1278  */
1279 typedef struct CaseTestExpr
1280 {
1282  Oid typeId; /* type for substituted value */
1283  /* typemod for substituted value */
1284  int32 typeMod pg_node_attr(query_jumble_ignore);
1285  /* collation for the substituted value */
1286  Oid collation pg_node_attr(query_jumble_ignore);
1288 
1289 /*
1290  * ArrayExpr - an ARRAY[] expression
1291  *
1292  * Note: if multidims is false, the constituent expressions all yield the
1293  * scalar type identified by element_typeid. If multidims is true, the
1294  * constituent expressions all yield arrays of element_typeid (ie, the same
1295  * type as array_typeid); at runtime we must check for compatible subscripts.
1296  */
1297 typedef struct ArrayExpr
1298 {
1300  /* type of expression result */
1301  Oid array_typeid pg_node_attr(query_jumble_ignore);
1302  /* OID of collation, or InvalidOid if none */
1303  Oid array_collid pg_node_attr(query_jumble_ignore);
1304  /* common type of array elements */
1305  Oid element_typeid pg_node_attr(query_jumble_ignore);
1306  /* the array elements or sub-arrays */
1308  /* true if elements are sub-arrays */
1309  bool multidims pg_node_attr(query_jumble_ignore);
1310  /* token location, or -1 if unknown */
1313 
1314 /*
1315  * RowExpr - a ROW() expression
1316  *
1317  * Note: the list of fields must have a one-for-one correspondence with
1318  * physical fields of the associated rowtype, although it is okay for it
1319  * to be shorter than the rowtype. That is, the N'th list element must
1320  * match up with the N'th physical field. When the N'th physical field
1321  * is a dropped column (attisdropped) then the N'th list element can just
1322  * be a NULL constant. (This case can only occur for named composite types,
1323  * not RECORD types, since those are built from the RowExpr itself rather
1324  * than vice versa.) It is important not to assume that length(args) is
1325  * the same as the number of columns logically present in the rowtype.
1326  *
1327  * colnames provides field names if the ROW() result is of type RECORD.
1328  * Names *must* be provided if row_typeid is RECORDOID; but if it is a
1329  * named composite type, colnames will be ignored in favor of using the
1330  * type's cataloged field names, so colnames should be NIL. Like the
1331  * args list, colnames is defined to be one-for-one with physical fields
1332  * of the rowtype (although dropped columns shouldn't appear in the
1333  * RECORD case, so this fine point is currently moot).
1334  */
1335 typedef struct RowExpr
1336 {
1338  List *args; /* the fields */
1339 
1340  /* RECORDOID or a composite type's ID */
1341  Oid row_typeid pg_node_attr(query_jumble_ignore);
1342 
1343  /*
1344  * row_typeid cannot be a domain over composite, only plain composite. To
1345  * create a composite domain value, apply CoerceToDomain to the RowExpr.
1346  *
1347  * Note: we deliberately do NOT store a typmod. Although a typmod will be
1348  * associated with specific RECORD types at runtime, it will differ for
1349  * different backends, and so cannot safely be stored in stored
1350  * parsetrees. We must assume typmod -1 for a RowExpr node.
1351  *
1352  * We don't need to store a collation either. The result type is
1353  * necessarily composite, and composite types never have a collation.
1354  */
1355 
1356  /* how to display this node */
1357  CoercionForm row_format pg_node_attr(query_jumble_ignore);
1358 
1359  /* list of String, or NIL */
1360  List *colnames pg_node_attr(query_jumble_ignore);
1361 
1362  int location; /* token location, or -1 if unknown */
1364 
1365 /*
1366  * RowCompareExpr - row-wise comparison, such as (a, b) <= (1, 2)
1367  *
1368  * We support row comparison for any operator that can be determined to
1369  * act like =, <>, <, <=, >, or >= (we determine this by looking for the
1370  * operator in btree opfamilies). Note that the same operator name might
1371  * map to a different operator for each pair of row elements, since the
1372  * element datatypes can vary.
1373  *
1374  * A RowCompareExpr node is only generated for the < <= > >= cases;
1375  * the = and <> cases are translated to simple AND or OR combinations
1376  * of the pairwise comparisons. However, we include = and <> in the
1377  * RowCompareType enum for the convenience of parser logic.
1378  */
1379 typedef enum RowCompareType
1380 {
1381  /* Values of this enum are chosen to match btree strategy numbers */
1382  ROWCOMPARE_LT = 1, /* BTLessStrategyNumber */
1383  ROWCOMPARE_LE = 2, /* BTLessEqualStrategyNumber */
1384  ROWCOMPARE_EQ = 3, /* BTEqualStrategyNumber */
1385  ROWCOMPARE_GE = 4, /* BTGreaterEqualStrategyNumber */
1386  ROWCOMPARE_GT = 5, /* BTGreaterStrategyNumber */
1387  ROWCOMPARE_NE = 6 /* no such btree strategy */
1389 
1390 typedef struct RowCompareExpr
1391 {
1393 
1394  /* LT LE GE or GT, never EQ or NE */
1396  /* OID list of pairwise comparison ops */
1397  List *opnos pg_node_attr(query_jumble_ignore);
1398  /* OID list of containing operator families */
1399  List *opfamilies pg_node_attr(query_jumble_ignore);
1400  /* OID list of collations for comparisons */
1401  List *inputcollids pg_node_attr(query_jumble_ignore);
1402  /* the left-hand input arguments */
1404  /* the right-hand input arguments */
1407 
1408 /*
1409  * CoalesceExpr - a COALESCE expression
1410  */
1411 typedef struct CoalesceExpr
1412 {
1414  /* type of expression result */
1415  Oid coalescetype pg_node_attr(query_jumble_ignore);
1416  /* OID of collation, or InvalidOid if none */
1417  Oid coalescecollid pg_node_attr(query_jumble_ignore);
1418  /* the arguments */
1420  /* token location, or -1 if unknown */
1423 
1424 /*
1425  * MinMaxExpr - a GREATEST or LEAST function
1426  */
1427 typedef enum MinMaxOp
1428 {
1430  IS_LEAST
1432 
1433 typedef struct MinMaxExpr
1434 {
1436  /* common type of arguments and result */
1437  Oid minmaxtype pg_node_attr(query_jumble_ignore);
1438  /* OID of collation of result */
1439  Oid minmaxcollid pg_node_attr(query_jumble_ignore);
1440  /* OID of collation that function should use */
1441  Oid inputcollid pg_node_attr(query_jumble_ignore);
1442  /* function to execute */
1444  /* the arguments */
1446  /* token location, or -1 if unknown */
1449 
1450 /*
1451  * SQLValueFunction - parameterless functions with special grammar productions
1452  *
1453  * The SQL standard categorizes some of these as <datetime value function>
1454  * and others as <general value specification>. We call 'em SQLValueFunctions
1455  * for lack of a better term. We store type and typmod of the result so that
1456  * some code doesn't need to know each function individually, and because
1457  * we would need to store typmod anyway for some of the datetime functions.
1458  * Note that currently, all variants return non-collating datatypes, so we do
1459  * not need a collation field; also, all these functions are stable.
1460  */
1462 {
1479 
1480 typedef struct SQLValueFunction
1481 {
1483  SQLValueFunctionOp op; /* which function this is */
1484 
1485  /*
1486  * Result type/typmod. Type is fully determined by "op", so no need to
1487  * include this Oid in the query jumbling.
1488  */
1489  Oid type pg_node_attr(query_jumble_ignore);
1491  int location; /* token location, or -1 if unknown */
1493 
1494 /*
1495  * XmlExpr - various SQL/XML functions requiring special grammar productions
1496  *
1497  * 'name' carries the "NAME foo" argument (already XML-escaped).
1498  * 'named_args' and 'arg_names' represent an xml_attribute list.
1499  * 'args' carries all other arguments.
1500  *
1501  * Note: result type/typmod/collation are not stored, but can be deduced
1502  * from the XmlExprOp. The type/typmod fields are just used for display
1503  * purposes, and are NOT necessarily the true result type of the node.
1504  */
1505 typedef enum XmlExprOp
1506 {
1507  IS_XMLCONCAT, /* XMLCONCAT(args) */
1508  IS_XMLELEMENT, /* XMLELEMENT(name, xml_attributes, args) */
1509  IS_XMLFOREST, /* XMLFOREST(xml_attributes) */
1510  IS_XMLPARSE, /* XMLPARSE(text, is_doc, preserve_ws) */
1511  IS_XMLPI, /* XMLPI(name [, args]) */
1512  IS_XMLROOT, /* XMLROOT(xml, version, standalone) */
1513  IS_XMLSERIALIZE, /* XMLSERIALIZE(is_document, xmlval, indent) */
1514  IS_DOCUMENT /* xmlval IS DOCUMENT */
1516 
1517 typedef enum XmlOptionType
1518 {
1522 
1523 typedef struct XmlExpr
1524 {
1526  /* xml function ID */
1528  /* name in xml(NAME foo ...) syntaxes */
1529  char *name pg_node_attr(query_jumble_ignore);
1530  /* non-XML expressions for xml_attributes */
1532  /* parallel list of String values */
1533  List *arg_names pg_node_attr(query_jumble_ignore);
1534  /* list of expressions */
1536  /* DOCUMENT or CONTENT */
1537  XmlOptionType xmloption pg_node_attr(query_jumble_ignore);
1538  /* INDENT option for XMLSERIALIZE */
1539  bool indent;
1540  /* target type/typmod for XMLSERIALIZE */
1541  Oid type pg_node_attr(query_jumble_ignore);
1542  int32 typmod pg_node_attr(query_jumble_ignore);
1543  /* token location, or -1 if unknown */
1546 
1547 /*
1548  * JsonEncoding -
1549  * representation of JSON ENCODING clause
1550  */
1551 typedef enum JsonEncoding
1552 {
1553  JS_ENC_DEFAULT, /* unspecified */
1558 
1559 /*
1560  * JsonFormatType -
1561  * enumeration of JSON formats used in JSON FORMAT clause
1562  */
1563 typedef enum JsonFormatType
1564 {
1565  JS_FORMAT_DEFAULT, /* unspecified */
1566  JS_FORMAT_JSON, /* FORMAT JSON [ENCODING ...] */
1567  JS_FORMAT_JSONB /* implicit internal format for RETURNING
1568  * jsonb */
1570 
1571 /*
1572  * JsonFormat -
1573  * representation of JSON FORMAT clause
1574  */
1575 typedef struct JsonFormat
1576 {
1578  JsonFormatType format_type; /* format type */
1579  JsonEncoding encoding; /* JSON encoding */
1580  int location; /* token location, or -1 if unknown */
1582 
1583 /*
1584  * JsonReturning -
1585  * transformed representation of JSON RETURNING clause
1586  */
1587 typedef struct JsonReturning
1588 {
1590  JsonFormat *format; /* output JSON format */
1591  Oid typid; /* target type Oid */
1592  int32 typmod; /* target type modifier */
1594 
1595 /*
1596  * JsonValueExpr -
1597  * representation of JSON value expression (expr [FORMAT JsonFormat])
1598  *
1599  * The actual value is obtained by evaluating formatted_expr. raw_expr is
1600  * only there for displaying the original user-written expression and is not
1601  * evaluated by ExecInterpExpr() and eval_const_exprs_mutator().
1602  */
1603 typedef struct JsonValueExpr
1604 {
1606  Expr *raw_expr; /* raw expression */
1607  Expr *formatted_expr; /* formatted expression */
1608  JsonFormat *format; /* FORMAT clause, if specified */
1610 
1612 {
1621 
1622 /*
1623  * JsonConstructorExpr -
1624  * wrapper over FuncExpr/Aggref/WindowFunc for SQL/JSON constructors
1625  */
1626 typedef struct JsonConstructorExpr
1627 {
1629  JsonConstructorType type; /* constructor type */
1631  Expr *func; /* underlying json[b]_xxx() function call */
1632  Expr *coercion; /* coercion to RETURNING type */
1633  JsonReturning *returning; /* RETURNING clause */
1634  bool absent_on_null; /* ABSENT ON NULL? */
1635  bool unique; /* WITH UNIQUE KEYS? (JSON_OBJECT[AGG] only) */
1638 
1639 /*
1640  * JsonValueType -
1641  * representation of JSON item type in IS JSON predicate
1642  */
1643 typedef enum JsonValueType
1644 {
1645  JS_TYPE_ANY, /* IS JSON [VALUE] */
1646  JS_TYPE_OBJECT, /* IS JSON OBJECT */
1647  JS_TYPE_ARRAY, /* IS JSON ARRAY */
1648  JS_TYPE_SCALAR /* IS JSON SCALAR */
1650 
1651 /*
1652  * JsonIsPredicate -
1653  * representation of IS JSON predicate
1654  */
1655 typedef struct JsonIsPredicate
1656 {
1658  Node *expr; /* subject expression */
1659  JsonFormat *format; /* FORMAT clause, if specified */
1660  JsonValueType item_type; /* JSON item type */
1661  bool unique_keys; /* check key uniqueness? */
1662  int location; /* token location, or -1 if unknown */
1664 
1665 /* ----------------
1666  * NullTest
1667  *
1668  * NullTest represents the operation of testing a value for NULLness.
1669  * The appropriate test is performed and returned as a boolean Datum.
1670  *
1671  * When argisrow is false, this simply represents a test for the null value.
1672  *
1673  * When argisrow is true, the input expression must yield a rowtype, and
1674  * the node implements "row IS [NOT] NULL" per the SQL standard. This
1675  * includes checking individual fields for NULLness when the row datum
1676  * itself isn't NULL.
1677  *
1678  * NOTE: the combination of a rowtype input and argisrow==false does NOT
1679  * correspond to the SQL notation "row IS [NOT] NULL"; instead, this case
1680  * represents the SQL notation "row IS [NOT] DISTINCT FROM NULL".
1681  * ----------------
1682  */
1683 
1684 typedef enum NullTestType
1685 {
1688 
1689 typedef struct NullTest
1690 {
1692  Expr *arg; /* input expression */
1693  NullTestType nulltesttype; /* IS NULL, IS NOT NULL */
1694  /* T to perform field-by-field null checks */
1695  bool argisrow pg_node_attr(query_jumble_ignore);
1696  int location; /* token location, or -1 if unknown */
1698 
1699 /*
1700  * BooleanTest
1701  *
1702  * BooleanTest represents the operation of determining whether a boolean
1703  * is TRUE, FALSE, or UNKNOWN (ie, NULL). All six meaningful combinations
1704  * are supported. Note that a NULL input does *not* cause a NULL result.
1705  * The appropriate test is performed and returned as a boolean Datum.
1706  */
1707 
1708 typedef enum BoolTestType
1709 {
1712 
1713 typedef struct BooleanTest
1714 {
1716  Expr *arg; /* input expression */
1717  BoolTestType booltesttype; /* test type */
1718  int location; /* token location, or -1 if unknown */
1720 
1721 /*
1722  * CoerceToDomain
1723  *
1724  * CoerceToDomain represents the operation of coercing a value to a domain
1725  * type. At runtime (and not before) the precise set of constraints to be
1726  * checked will be determined. If the value passes, it is returned as the
1727  * result; if not, an error is raised. Note that this is equivalent to
1728  * RelabelType in the scenario where no constraints are applied.
1729  */
1730 typedef struct CoerceToDomain
1731 {
1733  Expr *arg; /* input expression */
1734  Oid resulttype; /* domain type ID (result type) */
1735  /* output typmod (currently always -1) */
1736  int32 resulttypmod pg_node_attr(query_jumble_ignore);
1737  /* OID of collation, or InvalidOid if none */
1738  Oid resultcollid pg_node_attr(query_jumble_ignore);
1739  /* how to display this node */
1740  CoercionForm coercionformat pg_node_attr(query_jumble_ignore);
1741  int location; /* token location, or -1 if unknown */
1743 
1744 /*
1745  * Placeholder node for the value to be processed by a domain's check
1746  * constraint. This is effectively like a Param, but can be implemented more
1747  * simply since we need only one replacement value at a time.
1748  *
1749  * Note: the typeId/typeMod/collation will be set from the domain's base type,
1750  * not the domain itself. This is because we shouldn't consider the value
1751  * to be a member of the domain if we haven't yet checked its constraints.
1752  */
1753 typedef struct CoerceToDomainValue
1754 {
1756  /* type for substituted value */
1758  /* typemod for substituted value */
1759  int32 typeMod pg_node_attr(query_jumble_ignore);
1760  /* collation for the substituted value */
1761  Oid collation pg_node_attr(query_jumble_ignore);
1762  /* token location, or -1 if unknown */
1765 
1766 /*
1767  * Placeholder node for a DEFAULT marker in an INSERT or UPDATE command.
1768  *
1769  * This is not an executable expression: it must be replaced by the actual
1770  * column default expression during rewriting. But it is convenient to
1771  * treat it as an expression node during parsing and rewriting.
1772  */
1773 typedef struct SetToDefault
1774 {
1776  /* type for substituted value */
1778  /* typemod for substituted value */
1779  int32 typeMod pg_node_attr(query_jumble_ignore);
1780  /* collation for the substituted value */
1781  Oid collation pg_node_attr(query_jumble_ignore);
1782  /* token location, or -1 if unknown */
1785 
1786 /*
1787  * Node representing [WHERE] CURRENT OF cursor_name
1788  *
1789  * CURRENT OF is a bit like a Var, in that it carries the rangetable index
1790  * of the target relation being constrained; this aids placing the expression
1791  * correctly during planning. We can assume however that its "levelsup" is
1792  * always zero, due to the syntactic constraints on where it can appear.
1793  * Also, cvarno will always be a true RT index, never INNER_VAR etc.
1794  *
1795  * The referenced cursor can be represented either as a hardwired string
1796  * or as a reference to a run-time parameter of type REFCURSOR. The latter
1797  * case is for the convenience of plpgsql.
1798  */
1799 typedef struct CurrentOfExpr
1800 {
1802  Index cvarno; /* RT index of target relation */
1803  char *cursor_name; /* name of referenced cursor, or NULL */
1804  int cursor_param; /* refcursor parameter number, or 0 */
1806 
1807 /*
1808  * NextValueExpr - get next value from sequence
1809  *
1810  * This has the same effect as calling the nextval() function, but it does not
1811  * check permissions on the sequence. This is used for identity columns,
1812  * where the sequence is an implicit dependency without its own permissions.
1813  */
1814 typedef struct NextValueExpr
1815 {
1820 
1821 /*
1822  * InferenceElem - an element of a unique index inference specification
1823  *
1824  * This mostly matches the structure of IndexElems, but having a dedicated
1825  * primnode allows for a clean separation between the use of index parameters
1826  * by utility commands, and this node.
1827  */
1828 typedef struct InferenceElem
1829 {
1831  Node *expr; /* expression to infer from, or NULL */
1832  Oid infercollid; /* OID of collation, or InvalidOid */
1833  Oid inferopclass; /* OID of att opclass, or InvalidOid */
1835 
1836 /*--------------------
1837  * TargetEntry -
1838  * a target entry (used in query target lists)
1839  *
1840  * Strictly speaking, a TargetEntry isn't an expression node (since it can't
1841  * be evaluated by ExecEvalExpr). But we treat it as one anyway, since in
1842  * very many places it's convenient to process a whole query targetlist as a
1843  * single expression tree.
1844  *
1845  * In a SELECT's targetlist, resno should always be equal to the item's
1846  * ordinal position (counting from 1). However, in an INSERT or UPDATE
1847  * targetlist, resno represents the attribute number of the destination
1848  * column for the item; so there may be missing or out-of-order resnos.
1849  * It is even legal to have duplicated resnos; consider
1850  * UPDATE table SET arraycol[1] = ..., arraycol[2] = ..., ...
1851  * In an INSERT, the rewriter and planner will normalize the tlist by
1852  * reordering it into physical column order and filling in default values
1853  * for any columns not assigned values by the original query. In an UPDATE,
1854  * after the rewriter merges multiple assignments for the same column, the
1855  * planner extracts the target-column numbers into a separate "update_colnos"
1856  * list, and then renumbers the tlist elements serially. Thus, tlist resnos
1857  * match ordinal position in all tlists seen by the executor; but it is wrong
1858  * to assume that before planning has happened.
1859  *
1860  * resname is required to represent the correct column name in non-resjunk
1861  * entries of top-level SELECT targetlists, since it will be used as the
1862  * column title sent to the frontend. In most other contexts it is only
1863  * a debugging aid, and may be wrong or even NULL. (In particular, it may
1864  * be wrong in a tlist from a stored rule, if the referenced column has been
1865  * renamed by ALTER TABLE since the rule was made. Also, the planner tends
1866  * to store NULL rather than look up a valid name for tlist entries in
1867  * non-toplevel plan nodes.) In resjunk entries, resname should be either
1868  * a specific system-generated name (such as "ctid") or NULL; anything else
1869  * risks confusing ExecGetJunkAttribute!
1870  *
1871  * ressortgroupref is used in the representation of ORDER BY, GROUP BY, and
1872  * DISTINCT items. Targetlist entries with ressortgroupref=0 are not
1873  * sort/group items. If ressortgroupref>0, then this item is an ORDER BY,
1874  * GROUP BY, and/or DISTINCT target value. No two entries in a targetlist
1875  * may have the same nonzero ressortgroupref --- but there is no particular
1876  * meaning to the nonzero values, except as tags. (For example, one must
1877  * not assume that lower ressortgroupref means a more significant sort key.)
1878  * The order of the associated SortGroupClause lists determine the semantics.
1879  *
1880  * resorigtbl/resorigcol identify the source of the column, if it is a
1881  * simple reference to a column of a base table (or view). If it is not
1882  * a simple reference, these fields are zeroes.
1883  *
1884  * If resjunk is true then the column is a working column (such as a sort key)
1885  * that should be removed from the final output of the query. Resjunk columns
1886  * must have resnos that cannot duplicate any regular column's resno. Also
1887  * note that there are places that assume resjunk columns come after non-junk
1888  * columns.
1889  *--------------------
1890  */
1891 typedef struct TargetEntry
1892 {
1894  /* expression to evaluate */
1896  /* attribute number (see notes above) */
1898  /* name of the column (could be NULL) */
1899  char *resname pg_node_attr(query_jumble_ignore);
1900  /* nonzero if referenced by a sort/group clause */
1902  /* OID of column's source table */
1903  Oid resorigtbl pg_node_attr(query_jumble_ignore);
1904  /* column's number in source table */
1905  AttrNumber resorigcol pg_node_attr(query_jumble_ignore);
1906  /* set to true to eliminate the attribute from final target list */
1907  bool resjunk pg_node_attr(query_jumble_ignore);
1909 
1910 
1911 /* ----------------------------------------------------------------
1912  * node types for join trees
1913  *
1914  * The leaves of a join tree structure are RangeTblRef nodes. Above
1915  * these, JoinExpr nodes can appear to denote a specific kind of join
1916  * or qualified join. Also, FromExpr nodes can appear to denote an
1917  * ordinary cross-product join ("FROM foo, bar, baz WHERE ...").
1918  * FromExpr is like a JoinExpr of jointype JOIN_INNER, except that it
1919  * may have any number of child nodes, not just two.
1920  *
1921  * NOTE: the top level of a Query's jointree is always a FromExpr.
1922  * Even if the jointree contains no rels, there will be a FromExpr.
1923  *
1924  * NOTE: the qualification expressions present in JoinExpr nodes are
1925  * *in addition to* the query's main WHERE clause, which appears as the
1926  * qual of the top-level FromExpr. The reason for associating quals with
1927  * specific nodes in the jointree is that the position of a qual is critical
1928  * when outer joins are present. (If we enforce a qual too soon or too late,
1929  * that may cause the outer join to produce the wrong set of NULL-extended
1930  * rows.) If all joins are inner joins then all the qual positions are
1931  * semantically interchangeable.
1932  *
1933  * NOTE: in the raw output of gram.y, a join tree contains RangeVar,
1934  * RangeSubselect, and RangeFunction nodes, which are all replaced by
1935  * RangeTblRef nodes during the parse analysis phase. Also, the top-level
1936  * FromExpr is added during parse analysis; the grammar regards FROM and
1937  * WHERE as separate.
1938  * ----------------------------------------------------------------
1939  */
1940 
1941 /*
1942  * RangeTblRef - reference to an entry in the query's rangetable
1943  *
1944  * We could use direct pointers to the RT entries and skip having these
1945  * nodes, but multiple pointers to the same node in a querytree cause
1946  * lots of headaches, so it seems better to store an index into the RT.
1947  */
1948 typedef struct RangeTblRef
1949 {
1951  int rtindex;
1953 
1954 /*----------
1955  * JoinExpr - for SQL JOIN expressions
1956  *
1957  * isNatural, usingClause, and quals are interdependent. The user can write
1958  * only one of NATURAL, USING(), or ON() (this is enforced by the grammar).
1959  * If he writes NATURAL then parse analysis generates the equivalent USING()
1960  * list, and from that fills in "quals" with the right equality comparisons.
1961  * If he writes USING() then "quals" is filled with equality comparisons.
1962  * If he writes ON() then only "quals" is set. Note that NATURAL/USING
1963  * are not equivalent to ON() since they also affect the output column list.
1964  *
1965  * alias is an Alias node representing the AS alias-clause attached to the
1966  * join expression, or NULL if no clause. NB: presence or absence of the
1967  * alias has a critical impact on semantics, because a join with an alias
1968  * restricts visibility of the tables/columns inside it.
1969  *
1970  * join_using_alias is an Alias node representing the join correlation
1971  * name that SQL:2016 and later allow to be attached to JOIN/USING.
1972  * Its column alias list includes only the common column names from USING,
1973  * and it does not restrict visibility of the join's input tables.
1974  *
1975  * During parse analysis, an RTE is created for the Join, and its index
1976  * is filled into rtindex. This RTE is present mainly so that Vars can
1977  * be created that refer to the outputs of the join. The planner sometimes
1978  * generates JoinExprs internally; these can have rtindex = 0 if there are
1979  * no join alias variables referencing such joins.
1980  *----------
1981  */
1982 typedef struct JoinExpr
1983 {
1985  JoinType jointype; /* type of join */
1986  bool isNatural; /* Natural join? Will need to shape table */
1987  Node *larg; /* left subtree */
1988  Node *rarg; /* right subtree */
1989  /* USING clause, if any (list of String) */
1990  List *usingClause pg_node_attr(query_jumble_ignore);
1991  /* alias attached to USING clause, if any */
1992  Alias *join_using_alias pg_node_attr(query_jumble_ignore);
1993  /* qualifiers on join, if any */
1995  /* user-written alias clause, if any */
1996  Alias *alias pg_node_attr(query_jumble_ignore);
1997  /* RT index assigned for join, or 0 */
1998  int rtindex;
2000 
2001 /*----------
2002  * FromExpr - represents a FROM ... WHERE ... construct
2003  *
2004  * This is both more flexible than a JoinExpr (it can have any number of
2005  * children, including zero) and less so --- we don't need to deal with
2006  * aliases and so on. The output column set is implicitly just the union
2007  * of the outputs of the children.
2008  *----------
2009  */
2010 typedef struct FromExpr
2011 {
2013  List *fromlist; /* List of join subtrees */
2014  Node *quals; /* qualifiers on join, if any */
2016 
2017 /*----------
2018  * OnConflictExpr - represents an ON CONFLICT DO ... expression
2019  *
2020  * The optimizer requires a list of inference elements, and optionally a WHERE
2021  * clause to infer a unique index. The unique index (or, occasionally,
2022  * indexes) inferred are used to arbitrate whether or not the alternative ON
2023  * CONFLICT path is taken.
2024  *----------
2025  */
2026 typedef struct OnConflictExpr
2027 {
2029  OnConflictAction action; /* DO NOTHING or UPDATE? */
2030 
2031  /* Arbiter */
2032  List *arbiterElems; /* unique index arbiter list (of
2033  * InferenceElem's) */
2034  Node *arbiterWhere; /* unique index arbiter WHERE clause */
2035  Oid constraint; /* pg_constraint OID for arbiter */
2036 
2037  /* ON CONFLICT UPDATE */
2038  List *onConflictSet; /* List of ON CONFLICT SET TargetEntrys */
2039  Node *onConflictWhere; /* qualifiers to restrict UPDATE to */
2040  int exclRelIndex; /* RT index of 'excluded' relation */
2041  List *exclRelTlist; /* tlist of the EXCLUDED pseudo relation */
2043 
2044 #endif /* PRIMNODES_H */
int16 AttrNumber
Definition: attnum.h:21
signed int int32
Definition: c.h:483
unsigned int Index
Definition: c.h:603
double Cost
Definition: nodes.h:262
OnConflictAction
Definition: nodes.h:427
NodeTag
Definition: nodes.h:27
AggSplit
Definition: nodes.h:385
JoinType
Definition: nodes.h:299
uintptr_t Datum
Definition: postgres.h:64
unsigned int Oid
Definition: postgres_ext.h:31
BoolTestType
Definition: primnodes.h:1709
@ IS_NOT_TRUE
Definition: primnodes.h:1710
@ IS_NOT_FALSE
Definition: primnodes.h:1710
@ IS_NOT_UNKNOWN
Definition: primnodes.h:1710
@ IS_TRUE
Definition: primnodes.h:1710
@ IS_UNKNOWN
Definition: primnodes.h:1710
@ IS_FALSE
Definition: primnodes.h:1710
struct ArrayExpr ArrayExpr
struct FieldSelect FieldSelect
struct CoalesceExpr CoalesceExpr
struct Aggref Aggref
SubLinkType
Definition: primnodes.h:923
@ ARRAY_SUBLINK
Definition: primnodes.h:930
@ ANY_SUBLINK
Definition: primnodes.h:926
@ MULTIEXPR_SUBLINK
Definition: primnodes.h:929
@ CTE_SUBLINK
Definition: primnodes.h:931
@ EXPR_SUBLINK
Definition: primnodes.h:928
@ ROWCOMPARE_SUBLINK
Definition: primnodes.h:927
@ ALL_SUBLINK
Definition: primnodes.h:925
@ EXISTS_SUBLINK
Definition: primnodes.h:924
struct AlternativeSubPlan AlternativeSubPlan
JsonFormatType
Definition: primnodes.h:1564
@ JS_FORMAT_JSONB
Definition: primnodes.h:1567
@ JS_FORMAT_DEFAULT
Definition: primnodes.h:1565
@ JS_FORMAT_JSON
Definition: primnodes.h:1566
struct InferenceElem InferenceElem
struct ArrayCoerceExpr ArrayCoerceExpr
struct TargetEntry TargetEntry
MinMaxOp
Definition: primnodes.h:1428
@ IS_LEAST
Definition: primnodes.h:1430
@ IS_GREATEST
Definition: primnodes.h:1429
struct CaseWhen CaseWhen
BoolExprType
Definition: primnodes.h:857
@ AND_EXPR
Definition: primnodes.h:858
@ OR_EXPR
Definition: primnodes.h:858
@ NOT_EXPR
Definition: primnodes.h:858
struct SetToDefault SetToDefault
JsonEncoding
Definition: primnodes.h:1552
@ JS_ENC_DEFAULT
Definition: primnodes.h:1553
@ JS_ENC_UTF32
Definition: primnodes.h:1556
@ JS_ENC_UTF8
Definition: primnodes.h:1554
@ JS_ENC_UTF16
Definition: primnodes.h:1555
struct JsonReturning JsonReturning
struct CaseExpr CaseExpr
struct WindowFunc WindowFunc
XmlOptionType
Definition: primnodes.h:1518
@ XMLOPTION_CONTENT
Definition: primnodes.h:1520
@ XMLOPTION_DOCUMENT
Definition: primnodes.h:1519
SQLValueFunctionOp
Definition: primnodes.h:1462
@ SVFOP_CURRENT_CATALOG
Definition: primnodes.h:1476
@ SVFOP_LOCALTIME_N
Definition: primnodes.h:1469
@ SVFOP_CURRENT_TIMESTAMP
Definition: primnodes.h:1466
@ SVFOP_LOCALTIME
Definition: primnodes.h:1468
@ SVFOP_CURRENT_TIMESTAMP_N
Definition: primnodes.h:1467
@ SVFOP_CURRENT_ROLE
Definition: primnodes.h:1472
@ SVFOP_USER
Definition: primnodes.h:1474
@ SVFOP_CURRENT_SCHEMA
Definition: primnodes.h:1477
@ SVFOP_LOCALTIMESTAMP_N
Definition: primnodes.h:1471
@ SVFOP_CURRENT_DATE
Definition: primnodes.h:1463
@ SVFOP_CURRENT_TIME_N
Definition: primnodes.h:1465
@ SVFOP_CURRENT_TIME
Definition: primnodes.h:1464
@ SVFOP_LOCALTIMESTAMP
Definition: primnodes.h:1470
@ SVFOP_CURRENT_USER
Definition: primnodes.h:1473
@ SVFOP_SESSION_USER
Definition: primnodes.h:1475
ParamKind
Definition: primnodes.h:344
@ PARAM_MULTIEXPR
Definition: primnodes.h:348
@ PARAM_EXTERN
Definition: primnodes.h:345
@ PARAM_SUBLINK
Definition: primnodes.h:347
@ PARAM_EXEC
Definition: primnodes.h:346
struct CoerceToDomainValue CoerceToDomainValue
struct Var Var
struct IntoClause IntoClause
struct MinMaxExpr MinMaxExpr
OpExpr DistinctExpr
Definition: primnodes.h:779
struct NamedArgExpr NamedArgExpr
XmlExprOp
Definition: primnodes.h:1506
@ IS_DOCUMENT
Definition: primnodes.h:1514
@ IS_XMLFOREST
Definition: primnodes.h:1509
@ IS_XMLCONCAT
Definition: primnodes.h:1507
@ IS_XMLPI
Definition: primnodes.h:1511
@ IS_XMLPARSE
Definition: primnodes.h:1510
@ IS_XMLSERIALIZE
Definition: primnodes.h:1513
@ IS_XMLROOT
Definition: primnodes.h:1512
@ IS_XMLELEMENT
Definition: primnodes.h:1508
struct JsonIsPredicate JsonIsPredicate
struct JoinExpr JoinExpr
struct CoerceToDomain CoerceToDomain
struct SubLink SubLink
struct NextValueExpr NextValueExpr
struct BoolExpr BoolExpr
struct OpExpr OpExpr
RowCompareType
Definition: primnodes.h:1380
@ ROWCOMPARE_GT
Definition: primnodes.h:1386
@ ROWCOMPARE_LT
Definition: primnodes.h:1382
@ ROWCOMPARE_NE
Definition: primnodes.h:1387
@ ROWCOMPARE_LE
Definition: primnodes.h:1383
@ ROWCOMPARE_EQ
Definition: primnodes.h:1384
@ ROWCOMPARE_GE
Definition: primnodes.h:1385
struct OnConflictExpr OnConflictExpr
struct FuncExpr FuncExpr
OnCommitAction
Definition: primnodes.h:48
@ ONCOMMIT_DELETE_ROWS
Definition: primnodes.h:51
@ ONCOMMIT_NOOP
Definition: primnodes.h:49
@ ONCOMMIT_PRESERVE_ROWS
Definition: primnodes.h:50
@ ONCOMMIT_DROP
Definition: primnodes.h:52
struct GroupingFunc GroupingFunc
struct XmlExpr XmlExpr
struct SubPlan SubPlan
struct CollateExpr CollateExpr
struct ConvertRowtypeExpr ConvertRowtypeExpr
struct RowExpr RowExpr
struct RangeTblRef RangeTblRef
struct BooleanTest BooleanTest
CoercionForm
Definition: primnodes.h:660
@ COERCE_SQL_SYNTAX
Definition: primnodes.h:664
@ COERCE_IMPLICIT_CAST
Definition: primnodes.h:663
@ COERCE_EXPLICIT_CAST
Definition: primnodes.h:662
@ COERCE_EXPLICIT_CALL
Definition: primnodes.h:661
struct CaseTestExpr CaseTestExpr
struct SQLValueFunction SQLValueFunction
NullTestType
Definition: primnodes.h:1685
@ IS_NULL
Definition: primnodes.h:1686
@ IS_NOT_NULL
Definition: primnodes.h:1686
struct JsonConstructorExpr JsonConstructorExpr
struct CurrentOfExpr CurrentOfExpr
JsonValueType
Definition: primnodes.h:1644
@ JS_TYPE_ANY
Definition: primnodes.h:1645
@ JS_TYPE_ARRAY
Definition: primnodes.h:1647
@ JS_TYPE_OBJECT
Definition: primnodes.h:1646
@ JS_TYPE_SCALAR
Definition: primnodes.h:1648
struct NullTest NullTest
struct RowCompareExpr RowCompareExpr
struct TableFunc TableFunc
struct ScalarArrayOpExpr ScalarArrayOpExpr
struct JsonFormat JsonFormat
struct Param Param
struct Alias Alias
CoercionContext
Definition: primnodes.h:640
@ COERCION_PLPGSQL
Definition: primnodes.h:643
@ COERCION_ASSIGNMENT
Definition: primnodes.h:642
@ COERCION_EXPLICIT
Definition: primnodes.h:644
@ COERCION_IMPLICIT
Definition: primnodes.h:641
struct RelabelType RelabelType
struct CoerceViaIO CoerceViaIO
struct RangeVar RangeVar
JsonConstructorType
Definition: primnodes.h:1612
@ JSCTOR_JSON_SERIALIZE
Definition: primnodes.h:1619
@ JSCTOR_JSON_ARRAYAGG
Definition: primnodes.h:1616
@ JSCTOR_JSON_PARSE
Definition: primnodes.h:1617
@ JSCTOR_JSON_OBJECT
Definition: primnodes.h:1613
@ JSCTOR_JSON_SCALAR
Definition: primnodes.h:1618
@ JSCTOR_JSON_ARRAY
Definition: primnodes.h:1614
@ JSCTOR_JSON_OBJECTAGG
Definition: primnodes.h:1615
OpExpr NullIfExpr
Definition: primnodes.h:787
struct Const Const
struct SubscriptingRef SubscriptingRef
struct JsonValueExpr JsonValueExpr
struct FromExpr FromExpr
struct FieldStore FieldStore
int aggtransno pg_node_attr(query_jumble_ignore)
Index agglevelsup pg_node_attr(query_jumble_ignore)
char aggkind pg_node_attr(query_jumble_ignore)
Oid inputcollid pg_node_attr(query_jumble_ignore)
Oid aggfnoid
Definition: primnodes.h:422
Expr xpr
Definition: primnodes.h:419
List * aggdistinct
Definition: primnodes.h:452
AggSplit aggsplit pg_node_attr(query_jumble_ignore)
List * aggdirectargs
Definition: primnodes.h:443
bool aggstar pg_node_attr(query_jumble_ignore)
Oid aggtranstype pg_node_attr(equal_ignore, query_jumble_ignore)
Oid aggcollid pg_node_attr(query_jumble_ignore)
List * args
Definition: primnodes.h:446
Expr * aggfilter
Definition: primnodes.h:455
int aggno pg_node_attr(query_jumble_ignore)
Oid aggtype pg_node_attr(query_jumble_ignore)
bool aggvariadic pg_node_attr(query_jumble_ignore)
List *aggargtypes pg_node_attr(query_jumble_ignore)
int location
Definition: primnodes.h:485
List * aggorder
Definition: primnodes.h:449
bool aggpresorted pg_node_attr(equal_ignore, query_jumble_ignore)
char * aliasname
Definition: primnodes.h:42
NodeTag type
Definition: primnodes.h:41
List * colnames
Definition: primnodes.h:43
pg_node_attr(no_query_jumble) Expr xpr
Oid resultcollid pg_node_attr(query_jumble_ignore)
CoercionForm coerceformat pg_node_attr(query_jumble_ignore)
int32 resulttypmod pg_node_attr(query_jumble_ignore)
Oid element_typeid pg_node_attr(query_jumble_ignore)
int location
Definition: primnodes.h:1311
Oid array_collid pg_node_attr(query_jumble_ignore)
List * elements
Definition: primnodes.h:1307
Expr xpr
Definition: primnodes.h:1299
bool multidims pg_node_attr(query_jumble_ignore)
Oid array_typeid pg_node_attr(query_jumble_ignore)
int location
Definition: primnodes.h:868
pg_node_attr(custom_read_write) Expr xpr
BoolExprType boolop
Definition: primnodes.h:866
List * args
Definition: primnodes.h:867
BoolTestType booltesttype
Definition: primnodes.h:1717
Expr * arg
Definition: primnodes.h:1716
Expr * arg
Definition: primnodes.h:1240
int location
Definition: primnodes.h:1243
Oid casecollid pg_node_attr(query_jumble_ignore)
Expr xpr
Definition: primnodes.h:1235
Oid casetype pg_node_attr(query_jumble_ignore)
Expr * defresult
Definition: primnodes.h:1242
List * args
Definition: primnodes.h:1241
int32 typeMod pg_node_attr(query_jumble_ignore)
Oid collation pg_node_attr(query_jumble_ignore)
Expr * result
Definition: primnodes.h:1253
Expr * expr
Definition: primnodes.h:1252
Expr xpr
Definition: primnodes.h:1251
int location
Definition: primnodes.h:1254
Oid coalescetype pg_node_attr(query_jumble_ignore)
List * args
Definition: primnodes.h:1419
Oid coalescecollid pg_node_attr(query_jumble_ignore)
Oid collation pg_node_attr(query_jumble_ignore)
int32 typeMod pg_node_attr(query_jumble_ignore)
int32 resulttypmod pg_node_attr(query_jumble_ignore)
CoercionForm coercionformat pg_node_attr(query_jumble_ignore)
Oid resultcollid pg_node_attr(query_jumble_ignore)
Expr * arg
Definition: primnodes.h:1134
CoercionForm coerceformat pg_node_attr(query_jumble_ignore)
Oid resulttype
Definition: primnodes.h:1135
Oid resultcollid pg_node_attr(query_jumble_ignore)
Expr * arg
Definition: primnodes.h:1206
Oid consttype
Definition: primnodes.h:290
Datum constvalue pg_node_attr(query_jumble_ignore)
bool constbyval pg_node_attr(query_jumble_ignore)
pg_node_attr(custom_copy_equal, custom_read_write) Expr xpr
bool constisnull pg_node_attr(query_jumble_ignore)
int location pg_node_attr(query_jumble_location)
int constlen pg_node_attr(query_jumble_ignore)
int32 consttypmod pg_node_attr(query_jumble_ignore)
Oid constcollid pg_node_attr(query_jumble_ignore)
CoercionForm convertformat pg_node_attr(query_jumble_ignore)
char * cursor_name
Definition: primnodes.h:1803
pg_node_attr(abstract) NodeTag type
int32 resulttypmod pg_node_attr(query_jumble_ignore)
AttrNumber fieldnum
Definition: primnodes.h:1056
Oid resulttype pg_node_attr(query_jumble_ignore)
Expr * arg
Definition: primnodes.h:1055
Oid resultcollid pg_node_attr(query_jumble_ignore)
Oid resulttype pg_node_attr(query_jumble_ignore)
List *fieldnums pg_node_attr(query_jumble_ignore)
List * newvals
Definition: primnodes.h:1087
Expr * arg
Definition: primnodes.h:1086
Node * quals
Definition: primnodes.h:2014
NodeTag type
Definition: primnodes.h:2012
List * fromlist
Definition: primnodes.h:2013
bool funcvariadic pg_node_attr(query_jumble_ignore)
Oid inputcollid pg_node_attr(query_jumble_ignore)
Oid funccollid pg_node_attr(query_jumble_ignore)
Expr xpr
Definition: primnodes.h:675
bool funcretset pg_node_attr(query_jumble_ignore)
Oid funcid
Definition: primnodes.h:677
List * args
Definition: primnodes.h:695
CoercionForm funcformat pg_node_attr(query_jumble_ignore)
int location
Definition: primnodes.h:697
Oid funcresulttype pg_node_attr(query_jumble_ignore)
List *args pg_node_attr(query_jumble_ignore)
List *refs pg_node_attr(equal_ignore)
Index agglevelsup
Definition: primnodes.h:529
List *cols pg_node_attr(equal_ignore, query_jumble_ignore)
Node *viewQuery pg_node_attr(query_jumble_ignore)
List * colNames
Definition: primnodes.h:141
char * tableSpaceName
Definition: primnodes.h:145
bool skipData
Definition: primnodes.h:148
OnCommitAction onCommit
Definition: primnodes.h:144
NodeTag type
Definition: primnodes.h:138
List * options
Definition: primnodes.h:143
char * accessMethod
Definition: primnodes.h:142
RangeVar * rel
Definition: primnodes.h:140
Node * quals
Definition: primnodes.h:1994
List *usingClause pg_node_attr(query_jumble_ignore)
Alias *join_using_alias pg_node_attr(query_jumble_ignore)
Alias *alias pg_node_attr(query_jumble_ignore)
JoinType jointype
Definition: primnodes.h:1985
int rtindex
Definition: primnodes.h:1998
Node * larg
Definition: primnodes.h:1987
bool isNatural
Definition: primnodes.h:1986
NodeTag type
Definition: primnodes.h:1984
Node * rarg
Definition: primnodes.h:1988
JsonReturning * returning
Definition: primnodes.h:1633
JsonConstructorType type
Definition: primnodes.h:1629
int location
Definition: primnodes.h:1580
NodeTag type
Definition: primnodes.h:1577
JsonEncoding encoding
Definition: primnodes.h:1579
JsonFormatType format_type
Definition: primnodes.h:1578
JsonFormat * format
Definition: primnodes.h:1659
JsonValueType item_type
Definition: primnodes.h:1660
JsonFormat * format
Definition: primnodes.h:1590
NodeTag type
Definition: primnodes.h:1589
Expr * formatted_expr
Definition: primnodes.h:1607
JsonFormat * format
Definition: primnodes.h:1608
NodeTag type
Definition: primnodes.h:1605
Expr * raw_expr
Definition: primnodes.h:1606
Definition: pg_list.h:54
List * args
Definition: primnodes.h:1445
int location
Definition: primnodes.h:1447
Oid minmaxcollid pg_node_attr(query_jumble_ignore)
Oid inputcollid pg_node_attr(query_jumble_ignore)
Oid minmaxtype pg_node_attr(query_jumble_ignore)
MinMaxOp op
Definition: primnodes.h:1443
Expr * arg
Definition: primnodes.h:718
char *name pg_node_attr(query_jumble_ignore)
Definition: nodes.h:129
NullTestType nulltesttype
Definition: primnodes.h:1693
Expr xpr
Definition: primnodes.h:1691
int location
Definition: primnodes.h:1696
bool argisrow pg_node_attr(query_jumble_ignore)
Expr * arg
Definition: primnodes.h:1692
List * arbiterElems
Definition: primnodes.h:2032
OnConflictAction action
Definition: primnodes.h:2029
List * onConflictSet
Definition: primnodes.h:2038
List * exclRelTlist
Definition: primnodes.h:2041
NodeTag type
Definition: primnodes.h:2028
Node * onConflictWhere
Definition: primnodes.h:2039
Node * arbiterWhere
Definition: primnodes.h:2034
Oid opfuncid pg_node_attr(equal_ignore_if_zero, query_jumble_ignore)
Oid opcollid pg_node_attr(query_jumble_ignore)
Oid opresulttype pg_node_attr(query_jumble_ignore)
Oid inputcollid pg_node_attr(query_jumble_ignore)
int location
Definition: primnodes.h:766
bool opretset pg_node_attr(query_jumble_ignore)
Oid opno
Definition: primnodes.h:745
List * args
Definition: primnodes.h:763
Expr xpr
Definition: primnodes.h:742
Expr xpr
Definition: primnodes.h:353
int paramid
Definition: primnodes.h:355
Oid paramtype
Definition: primnodes.h:356
ParamKind paramkind
Definition: primnodes.h:354
int32 paramtypmod pg_node_attr(query_jumble_ignore)
int location
Definition: primnodes.h:362
Oid paramcollid pg_node_attr(query_jumble_ignore)
NodeTag type
Definition: primnodes.h:1950
int location
Definition: primnodes.h:86
char * relname
Definition: primnodes.h:74
bool inh
Definition: primnodes.h:77
Alias * alias
Definition: primnodes.h:83
char relpersistence
Definition: primnodes.h:80
char * catalogname
Definition: primnodes.h:68
char * schemaname
Definition: primnodes.h:71
NodeTag type
Definition: primnodes.h:65
int32 resulttypmod pg_node_attr(query_jumble_ignore)
Oid resulttype
Definition: primnodes.h:1112
Oid resultcollid pg_node_attr(query_jumble_ignore)
CoercionForm relabelformat pg_node_attr(query_jumble_ignore)
Expr * arg
Definition: primnodes.h:1111
List *inputcollids pg_node_attr(query_jumble_ignore)
RowCompareType rctype
Definition: primnodes.h:1395
List *opfamilies pg_node_attr(query_jumble_ignore)
List *opnos pg_node_attr(query_jumble_ignore)
Expr xpr
Definition: primnodes.h:1337
int location
Definition: primnodes.h:1362
CoercionForm row_format pg_node_attr(query_jumble_ignore)
List * args
Definition: primnodes.h:1338
List *colnames pg_node_attr(query_jumble_ignore)
Oid row_typeid pg_node_attr(query_jumble_ignore)
Oid type pg_node_attr(query_jumble_ignore)
SQLValueFunctionOp op
Definition: primnodes.h:1483
Oid hashfuncid pg_node_attr(equal_ignore_if_zero, query_jumble_ignore)
Oid negfuncid pg_node_attr(equal_ignore_if_zero, query_jumble_ignore)
Oid inputcollid pg_node_attr(query_jumble_ignore)
Oid opfuncid pg_node_attr(equal_ignore_if_zero, query_jumble_ignore)
int32 typeMod pg_node_attr(query_jumble_ignore)
Oid collation pg_node_attr(query_jumble_ignore)
int plan_id
Definition: primnodes.h:997
char * plan_name
Definition: primnodes.h:999
List * args
Definition: primnodes.h:1018
List * paramIds
Definition: primnodes.h:995
bool useHashTable
Definition: primnodes.h:1006
Node * testexpr
Definition: primnodes.h:994
int32 firstColTypmod
Definition: primnodes.h:1002
pg_node_attr(no_query_jumble) Expr xpr
List * parParam
Definition: primnodes.h:1017
bool parallel_safe
Definition: primnodes.h:1011
List * setParam
Definition: primnodes.h:1015
bool unknownEqFalse
Definition: primnodes.h:1008
Cost startup_cost
Definition: primnodes.h:1020
Oid firstColCollation
Definition: primnodes.h:1003
Cost per_call_cost
Definition: primnodes.h:1021
SubLinkType subLinkType
Definition: primnodes.h:992
Oid firstColType
Definition: primnodes.h:1001
Oid refelemtype pg_node_attr(query_jumble_ignore)
Oid refcollid pg_node_attr(query_jumble_ignore)
Oid refrestype pg_node_attr(query_jumble_ignore)
Oid refcontainertype pg_node_attr(query_jumble_ignore)
int32 reftypmod pg_node_attr(query_jumble_ignore)
Expr * refassgnexpr
Definition: primnodes.h:630
List * refupperindexpr
Definition: primnodes.h:620
Expr * refexpr
Definition: primnodes.h:628
List * reflowerindexpr
Definition: primnodes.h:626
List *colnames pg_node_attr(query_jumble_ignore)
List *coltypes pg_node_attr(query_jumble_ignore)
Bitmapset *notnulls pg_node_attr(query_jumble_ignore)
List *ns_names pg_node_attr(query_jumble_ignore)
List *coldefexprs pg_node_attr(query_jumble_ignore)
Node * docexpr
Definition: primnodes.h:103
List *colcollations pg_node_attr(query_jumble_ignore)
int ordinalitycol pg_node_attr(query_jumble_ignore)
NodeTag type
Definition: primnodes.h:97
List *coltypmods pg_node_attr(query_jumble_ignore)
Node * rowexpr
Definition: primnodes.h:105
int location
Definition: primnodes.h:123
List * colexprs
Definition: primnodes.h:115
List *ns_uris pg_node_attr(query_jumble_ignore)
char *resname pg_node_attr(query_jumble_ignore)
Expr * expr
Definition: primnodes.h:1895
AttrNumber resorigcol pg_node_attr(query_jumble_ignore)
bool resjunk pg_node_attr(query_jumble_ignore)
Oid resorigtbl pg_node_attr(query_jumble_ignore)
AttrNumber resno
Definition: primnodes.h:1897
Index ressortgroupref
Definition: primnodes.h:1901
Definition: primnodes.h:226
AttrNumber varattno
Definition: primnodes.h:238
int32 vartypmod pg_node_attr(query_jumble_ignore)
Oid varcollid pg_node_attr(query_jumble_ignore)
Expr xpr
Definition: primnodes.h:227
int varno
Definition: primnodes.h:233
AttrNumber varattnosyn pg_node_attr(equal_ignore, query_jumble_ignore)
Index varlevelsup
Definition: primnodes.h:258
Bitmapset *varnullingrels pg_node_attr(query_jumble_ignore)
Oid vartype pg_node_attr(query_jumble_ignore)
int location
Definition: primnodes.h:271
Index varnosyn pg_node_attr(equal_ignore, query_jumble_ignore)
Expr xpr
Definition: primnodes.h:543
List * args
Definition: primnodes.h:553
Index winref
Definition: primnodes.h:557
bool winagg pg_node_attr(query_jumble_ignore)
Oid inputcollid pg_node_attr(query_jumble_ignore)
Expr * aggfilter
Definition: primnodes.h:555
int location
Definition: primnodes.h:563
Oid wincollid pg_node_attr(query_jumble_ignore)
Oid wintype pg_node_attr(query_jumble_ignore)
bool winstar pg_node_attr(query_jumble_ignore)
Oid winfnoid
Definition: primnodes.h:545
List *arg_names pg_node_attr(query_jumble_ignore)
int32 typmod pg_node_attr(query_jumble_ignore)
List * args
Definition: primnodes.h:1535
Expr xpr
Definition: primnodes.h:1525
bool indent
Definition: primnodes.h:1539
int location
Definition: primnodes.h:1544
XmlOptionType xmloption pg_node_attr(query_jumble_ignore)
char *name pg_node_attr(query_jumble_ignore)
List * named_args
Definition: primnodes.h:1531
XmlExprOp op
Definition: primnodes.h:1527
Oid type pg_node_attr(query_jumble_ignore)
const char * type
const char * name
int xmloption
Definition: xml.c:100