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