PostgreSQL Source Code git master
Loading...
Searching...
No Matches
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-2026, 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 "access/cmptype.h"
22#include "nodes/bitmapset.h"
23#include "nodes/lockoptions.h"
24#include "nodes/pg_list.h"
25
26
33
34
35/* ----------------------------------------------------------------
36 * node definitions
37 * ----------------------------------------------------------------
38 */
39
40/*
41 * Alias -
42 * specifies an alias for a range variable; the alias might also
43 * specify renaming of columns within the table.
44 *
45 * Note: colnames is a list of String nodes. In Alias structs
46 * associated with RTEs, there may be entries corresponding to dropped
47 * columns; these are normally empty strings (""). See parsenodes.h for info.
48 */
49typedef struct Alias
50{
52 char *aliasname; /* aliased rel name (never qualified) */
53 List *colnames; /* optional list of column aliases */
55
56/* What to do at commit time for temporary relations */
57typedef enum OnCommitAction
58{
59 ONCOMMIT_NOOP, /* No ON COMMIT clause (do nothing) */
60 ONCOMMIT_PRESERVE_ROWS, /* ON COMMIT PRESERVE ROWS (do nothing) */
61 ONCOMMIT_DELETE_ROWS, /* ON COMMIT DELETE ROWS */
62 ONCOMMIT_DROP, /* ON COMMIT DROP */
64
65/*
66 * RangeVar - range variable, used in FROM clauses
67 *
68 * Also used to represent table names in utility statements; there, the alias
69 * field is not used, and inh tells whether to apply the operation
70 * recursively to child tables. In some contexts it is also useful to carry
71 * a TEMP table indication here.
72 */
73typedef struct RangeVar
74{
76
77 /* the catalog (database) name, or NULL */
79
80 /* the schema name, or NULL */
82
83 /* the relation/sequence name */
84 char *relname;
85
86 /* expand rel by inheritance? recursively act on children? */
87 bool inh;
88
89 /* see RELPERSISTENCE_* in pg_class.h */
91
92 /* table alias & optional column aliases */
94
95 /* token location, or -1 if unknown */
98
104
105/*
106 * TableFunc - node for a table function, such as XMLTABLE and JSON_TABLE.
107 *
108 * Entries in the ns_names list are either String nodes containing
109 * literal namespace names, or NULL pointers to represent DEFAULT.
110 */
111typedef struct TableFunc
112{
114 /* XMLTABLE or JSON_TABLE */
116 /* list of namespace URI expressions */
118 /* list of namespace names or NULL */
120 /* input document expression */
122 /* row filter expression */
124 /* column names (list of String) */
126 /* OID list of column type OIDs */
128 /* integer list of column typmods */
130 /* OID list of column collation OIDs */
132 /* list of column filter expressions */
134 /* list of column default expressions */
136 /* JSON_TABLE: list of column value expressions */
138 /* JSON_TABLE: list of PASSING argument expressions */
140 /* nullability flag for each output column */
142 /* JSON_TABLE plan */
144 /* counts from 0; -1 if none specified */
146 /* token location, or -1 if unknown */
149
150/*
151 * IntoClause - target information for SELECT INTO, CREATE TABLE AS, and
152 * CREATE MATERIALIZED VIEW
153 *
154 * For CREATE MATERIALIZED VIEW, viewQuery is the parsed-but-not-rewritten
155 * SELECT Query for the view; otherwise it's NULL. This is irrelevant in
156 * the query jumbling as CreateTableAsStmt already includes a reference to
157 * its own Query, so ignore it. (We declare it as struct Query* to avoid a
158 * forward reference.)
159 */
160typedef struct IntoClause
161{
163
164 RangeVar *rel; /* target relation name */
165 List *colNames; /* column names to assign, or NIL */
166 char *accessMethod; /* table access method */
167 List *options; /* options from WITH clause */
168 OnCommitAction onCommit; /* what do we do at COMMIT? */
169 char *tableSpaceName; /* table space to use, or NULL */
170 /* materialized view's SELECT query */
172 bool skipData; /* true for WITH NO DATA */
174
175
176/* ----------------------------------------------------------------
177 * node types for executable expressions
178 * ----------------------------------------------------------------
179 */
180
181/*
182 * Expr - generic superclass for executable-expression nodes
183 *
184 * All node types that are used in executable expression trees should derive
185 * from Expr (that is, have Expr as their first field). Since Expr only
186 * contains NodeTag, this is a formality, but it is an easy form of
187 * documentation. See also the ExprState node types in execnodes.h.
188 */
189typedef struct Expr
190{
192
195
196/*
197 * Var - expression node representing a variable (ie, a table column)
198 *
199 * In the parser and planner, varno and varattno identify the semantic
200 * referent, which is a base-relation column unless the reference is to a join
201 * USING column that isn't semantically equivalent to either join input column
202 * (because it is a FULL join or the input column requires a type coercion).
203 * In those cases varno and varattno refer to the JOIN RTE. (Early in the
204 * planner, we replace such join references by the implied expression; but up
205 * till then we want join reference Vars to keep their original identity for
206 * query-printing purposes.)
207 *
208 * At the end of planning, Var nodes appearing in upper-level plan nodes are
209 * reassigned to point to the outputs of their subplans; for example, in a
210 * join node varno becomes INNER_VAR or OUTER_VAR and varattno becomes the
211 * index of the proper element of that subplan's target list. Similarly,
212 * INDEX_VAR is used to identify Vars that reference an index column rather
213 * than a heap column. (In ForeignScan and CustomScan plan nodes, INDEX_VAR
214 * is abused to signify references to columns of a custom scan tuple type.)
215 *
216 * ROWID_VAR is used in the planner to identify nonce variables that carry
217 * row identity information during UPDATE/DELETE/MERGE. This value should
218 * never be seen outside the planner.
219 *
220 * varnullingrels is the set of RT indexes of outer joins that can force
221 * the Var's value to null (at the point where it appears in the query).
222 * See optimizer/README for discussion of that.
223 *
224 * varlevelsup is greater than zero in Vars that represent outer references.
225 * Note that it affects the meaning of all of varno, varnullingrels, and
226 * varnosyn, all of which refer to the range table of that query level.
227 *
228 * varreturningtype is used for Vars that refer to the target relation in the
229 * RETURNING list of data-modifying queries. The default behavior is to
230 * return old values for DELETE and new values for INSERT and UPDATE, but it
231 * is also possible to explicitly request old or new values.
232 *
233 * In the parser, varnosyn and varattnosyn are either identical to
234 * varno/varattno, or they specify the column's position in an aliased JOIN
235 * RTE that hides the semantic referent RTE's refname. This is a syntactic
236 * identifier as opposed to the semantic identifier; it tells ruleutils.c
237 * how to print the Var properly. varnosyn/varattnosyn retain their values
238 * throughout planning and execution, so they are particularly helpful to
239 * identify Vars when debugging. Note, however, that a Var that is generated
240 * in the planner and doesn't correspond to any simple relation column may
241 * have varnosyn = varattnosyn = 0.
242 */
243#define INNER_VAR (-1) /* reference to inner subplan */
244#define OUTER_VAR (-2) /* reference to outer subplan */
245#define INDEX_VAR (-3) /* reference to index column */
246#define ROWID_VAR (-4) /* row identity column during planning */
247
248#define IS_SPECIAL_VARNO(varno) ((int) (varno) < 0)
249
250/* Symbols for the indexes of the special RTE entries in rules */
251#define PRS2_OLD_VARNO 1
252#define PRS2_NEW_VARNO 2
253
254/* Returning behavior for Vars in RETURNING list */
256{
257 VAR_RETURNING_DEFAULT, /* return OLD for DELETE, else return NEW */
258 VAR_RETURNING_OLD, /* return OLD for DELETE/UPDATE, else NULL */
259 VAR_RETURNING_NEW, /* return NEW for INSERT/UPDATE, else NULL */
261
262typedef struct Var
263{
265
266 /*
267 * index of this var's relation in the range table, or
268 * INNER_VAR/OUTER_VAR/etc
269 */
270 int varno;
271
272 /*
273 * attribute number of this var, or zero for all attrs ("whole-row Var")
274 */
276
277 /* pg_type OID for the type of this var */
279 /* pg_attribute typmod value */
281 /* OID of collation, or InvalidOid if none */
283
284 /*
285 * RT indexes of outer joins that can replace the Var's value with null.
286 * We can omit varnullingrels in the query jumble, because it's fully
287 * determined by varno/varlevelsup plus the Var's query location.
288 */
290
291 /*
292 * for subquery variables referencing outer relations; 0 in a normal var,
293 * >0 means N levels up
294 */
296
297 /* returning type of this var (see above) */
299
300 /*
301 * varnosyn/varattnosyn are ignored for equality, because Vars with
302 * different syntactic identifiers are semantically the same as long as
303 * their varno/varattno match.
304 */
305 /* syntactic relation index (0 if unknown) */
307 /* syntactic attribute number */
309
310 /* token location, or -1 if unknown */
313
314/*
315 * Const
316 *
317 * Note: for varlena data types, we make a rule that a Const node's value
318 * must be in non-extended form (4-byte header, no compression or external
319 * references). This ensures that the Const node is self-contained and makes
320 * it more likely that equal() will see logically identical values as equal.
321 *
322 * Only the constant type OID is relevant for the query jumbling.
323 */
324typedef struct Const
325{
327
328 Expr xpr;
329 /* pg_type OID of the constant's datatype */
331 /* typmod value, if any */
333 /* OID of collation, or InvalidOid if none */
335 /* typlen of the constant's datatype */
337 /* the constant's value */
339 /* whether the constant is null (if true, constvalue is undefined) */
341
342 /*
343 * Whether this datatype is passed by value. If true, then all the
344 * information is stored in the Datum. If false, then the Datum contains
345 * a pointer to the information.
346 */
348
349 /*
350 * token location, or -1 if unknown. All constants are tracked as
351 * locations in query jumbling, to be marked as parameters.
352 */
355
356/*
357 * Param
358 *
359 * paramkind specifies the kind of parameter. The possible values
360 * for this field are:
361 *
362 * PARAM_EXTERN: The parameter value is supplied from outside the plan.
363 * Such parameters are numbered from 1 to n.
364 *
365 * PARAM_EXEC: The parameter is an internal executor parameter, used
366 * for passing values into and out of sub-queries or from
367 * nestloop joins to their inner scans.
368 * For historical reasons, such parameters are numbered from 0.
369 * These numbers are independent of PARAM_EXTERN numbers.
370 *
371 * PARAM_SUBLINK: The parameter represents an output column of a SubLink
372 * node's sub-select. The column number is contained in the
373 * `paramid' field. (This type of Param is converted to
374 * PARAM_EXEC during planning.)
375 *
376 * PARAM_MULTIEXPR: Like PARAM_SUBLINK, the parameter represents an
377 * output column of a SubLink node's sub-select, but here, the
378 * SubLink is always a MULTIEXPR SubLink. The high-order 16 bits
379 * of the `paramid' field contain the SubLink's subLinkId, and
380 * the low-order 16 bits contain the column number. (This type
381 * of Param is also converted to PARAM_EXEC during planning.)
382 */
390
391typedef struct Param
392{
394
395 Expr xpr;
396 ParamKind paramkind; /* kind of parameter. See above */
397 int paramid; /* numeric ID for parameter */
398 Oid paramtype; /* pg_type OID of parameter's datatype */
399 /* typmod value, if known */
401 /* OID of collation, or InvalidOid if none */
403 /* token location, or -1 if unknown */
406
407/*
408 * Aggref
409 *
410 * The aggregate's args list is a targetlist, ie, a list of TargetEntry nodes.
411 *
412 * For a normal (non-ordered-set) aggregate, the non-resjunk TargetEntries
413 * represent the aggregate's regular arguments (if any) and resjunk TLEs can
414 * be added at the end to represent ORDER BY expressions that are not also
415 * arguments. As in a top-level Query, the TLEs can be marked with
416 * ressortgroupref indexes to let them be referenced by SortGroupClause
417 * entries in the aggorder and/or aggdistinct lists. This represents ORDER BY
418 * and DISTINCT operations to be applied to the aggregate input rows before
419 * they are passed to the transition function. The grammar only allows a
420 * simple "DISTINCT" specifier for the arguments, but we use the full
421 * query-level representation to allow more code sharing.
422 *
423 * For an ordered-set aggregate, the args list represents the WITHIN GROUP
424 * (aggregated) arguments, all of which will be listed in the aggorder list.
425 * DISTINCT is not supported in this case, so aggdistinct will be NIL.
426 * The direct arguments appear in aggdirectargs (as a list of plain
427 * expressions, not TargetEntry nodes).
428 *
429 * aggtranstype is the data type of the state transition values for this
430 * aggregate (resolved to an actual type, if agg's transtype is polymorphic).
431 * This is determined during planning and is InvalidOid before that.
432 *
433 * aggargtypes is an OID list of the data types of the direct and regular
434 * arguments. Normally it's redundant with the aggdirectargs and args lists,
435 * but in a combining aggregate, it's not because the args list has been
436 * replaced with a single argument representing the partial-aggregate
437 * transition values.
438 *
439 * aggpresorted is set by the query planner for ORDER BY and DISTINCT
440 * aggregates where the chosen plan provides presorted input for this
441 * aggregate during execution.
442 *
443 * aggsplit indicates the expected partial-aggregation mode for the Aggref's
444 * parent plan node. It's always set to AGGSPLIT_SIMPLE in the parser, but
445 * the planner might change it to something else. We use this mainly as
446 * a crosscheck that the Aggrefs match the plan; but note that when aggsplit
447 * indicates a non-final mode, aggtype reflects the transition data type
448 * not the SQL-level output type of the aggregate.
449 *
450 * aggno and aggtransno are -1 in the parse stage, and are set in planning.
451 * Aggregates with the same 'aggno' represent the same aggregate expression,
452 * and can share the result. Aggregates with same 'transno' but different
453 * 'aggno' can share the same transition state, only the final function needs
454 * to be called separately.
455 *
456 * Information related to collations, transition types and internal states
457 * are irrelevant for the query jumbling.
458 */
459typedef struct Aggref
460{
462
463 /* pg_proc Oid of the aggregate */
465
466 /* type Oid of result of the aggregate */
468
469 /* OID of collation of result */
471
472 /* OID of collation that function should use */
474
475 /*
476 * type Oid of aggregate's transition value; ignored for equal since it
477 * might not be set yet
478 */
480
481 /* type Oids of direct and aggregated args */
483
484 /* direct arguments, if an ordered-set agg */
486
487 /* aggregated arguments and sort expressions */
489
490 /* ORDER BY (list of SortGroupClause) */
492
493 /* DISTINCT (list of SortGroupClause) */
495
496 /* FILTER expression, if any */
498
499 /* true if argument list was really '*' */
501
502 /*
503 * true if variadic arguments have been combined into an array last
504 * argument
505 */
507
508 /* aggregate kind (see pg_aggregate.h) */
510
511 /* aggregate input already sorted */
513
514 /* > 0 if agg belongs to outer query */
516
517 /* expected agg-splitting mode of parent Agg */
519
520 /* unique ID within the Agg node */
522
523 /* unique ID of transition state in the Agg */
525
526 /* token location, or -1 if unknown */
529
530/*
531 * GroupingFunc
532 *
533 * A GroupingFunc is a GROUPING(...) expression, which behaves in many ways
534 * like an aggregate function (e.g. it "belongs" to a specific query level,
535 * which might not be the one immediately containing it), but also differs in
536 * an important respect: it never evaluates its arguments, they merely
537 * designate expressions from the GROUP BY clause of the query level to which
538 * it belongs.
539 *
540 * The spec defines the evaluation of GROUPING() purely by syntactic
541 * replacement, but we make it a real expression for optimization purposes so
542 * that one Agg node can handle multiple grouping sets at once. Evaluating the
543 * result only needs the column positions to check against the grouping set
544 * being projected. However, for EXPLAIN to produce meaningful output, we have
545 * to keep the original expressions around, since expression deparse does not
546 * give us any feasible way to get at the GROUP BY clause.
547 *
548 * Also, we treat two GroupingFunc nodes as equal if they have equal arguments
549 * lists and agglevelsup, without comparing the refs and cols annotations.
550 *
551 * In raw parse output we have only the args list; parse analysis fills in the
552 * refs list, and the planner fills in the cols list.
553 *
554 * All the fields used as information for an internal state are irrelevant
555 * for the query jumbling.
556 */
557typedef struct GroupingFunc
558{
560
561 /* arguments, not evaluated but kept for benefit of EXPLAIN etc. */
563
564 /* ressortgrouprefs of arguments */
566
567 /* actual column positions set by planner */
569
570 /* same as Aggref.agglevelsup */
572
573 /* token location */
576
577/*
578 * WindowFunc
579 *
580 * Collation information is irrelevant for the query jumbling, as is the
581 * internal state information of the node like "winstar" and "winagg".
582 */
583
584/*
585 * Null Treatment options. If specified, initially set to PARSER_IGNORE_NULLS
586 * which is then converted to IGNORE_NULLS if the window function allows the
587 * null treatment clause.
588 */
589#define NO_NULLTREATMENT 0
590#define PARSER_IGNORE_NULLS 1
591#define PARSER_RESPECT_NULLS 2
592#define IGNORE_NULLS 3
593
594typedef struct WindowFunc
595{
597 /* pg_proc Oid of the function */
599 /* type Oid of result of the window function */
601 /* OID of collation of result */
603 /* OID of collation that function should use */
605 /* arguments to the window function */
607 /* FILTER expression, if any */
609 /* List of WindowFuncRunConditions to help short-circuit execution */
611 /* index of associated WindowClause */
613 /* true if argument list was really '*' */
615 /* is function a simple aggregate? */
617 /* ignore nulls. One of the Null Treatment options */
619 /* token location, or -1 if unknown */
622
623/*
624 * WindowFuncRunCondition
625 *
626 * Represents intermediate OpExprs which will be used by WindowAgg to
627 * short-circuit execution.
628 */
630{
632
633 /* PG_OPERATOR OID of the operator */
635 /* OID of collation that operator should use */
637
638 /*
639 * true of WindowFunc belongs on the left of the resulting OpExpr or false
640 * if the WindowFunc is on the right.
641 */
643
644 /*
645 * The Expr being compared to the WindowFunc to use in the OpExpr in the
646 * WindowAgg's runCondition
647 */
650
651/*
652 * MergeSupportFunc
653 *
654 * A MergeSupportFunc is a merge support function expression that can only
655 * appear in the RETURNING list of a MERGE command. It returns information
656 * about the currently executing merge action.
657 *
658 * Currently, the only supported function is MERGE_ACTION(), which returns the
659 * command executed ("INSERT", "UPDATE", or "DELETE").
660 */
661typedef struct MergeSupportFunc
662{
664 /* type Oid of result */
666 /* OID of collation, or InvalidOid if none */
668 /* token location, or -1 if unknown */
671
672/*
673 * SubscriptingRef: describes a subscripting operation over a container
674 * (array, etc).
675 *
676 * A SubscriptingRef can describe fetching a single element from a container,
677 * fetching a part of a container (e.g. an array slice), storing a single
678 * element into a container, or storing a slice. The "store" cases work with
679 * an initial container value and a source value that is inserted into the
680 * appropriate part of the container; the result of the operation is an
681 * entire new modified container value.
682 *
683 * If reflowerindexpr = NIL, then we are fetching or storing a single container
684 * element at the subscripts given by refupperindexpr. Otherwise we are
685 * fetching or storing a container slice, that is a rectangular subcontainer
686 * with lower and upper bounds given by the index expressions.
687 * reflowerindexpr must be the same length as refupperindexpr when it
688 * is not NIL.
689 *
690 * In the slice case, individual expressions in the subscript lists can be
691 * NULL, meaning "substitute the array's current lower or upper bound".
692 * (Non-array containers may or may not support this.)
693 *
694 * refcontainertype is the actual container type that determines the
695 * subscripting semantics. (This will generally be either the exposed type of
696 * refexpr, or the base type if that is a domain.) refelemtype is the type of
697 * the container's elements; this is saved for the use of the subscripting
698 * functions, but is not used by the core code. refrestype, reftypmod, and
699 * refcollid describe the type of the SubscriptingRef's result. In a store
700 * expression, refrestype will always match refcontainertype; in a fetch,
701 * it could be refelemtype for an element fetch, or refcontainertype for a
702 * slice fetch, or possibly something else as determined by type-specific
703 * subscripting logic. Likewise, reftypmod and refcollid will match the
704 * container's properties in a store, but could be different in a fetch.
705 *
706 * Any internal state data is ignored for the query jumbling.
707 *
708 * Note: for the cases where a container is returned, if refexpr yields a R/W
709 * expanded container, then the implementation is allowed to modify that
710 * object in-place and return the same object.
711 */
712typedef struct SubscriptingRef
713{
715 /* type of the container proper */
717 /* the container type's pg_type.typelem */
719 /* type of the SubscriptingRef's result */
721 /* typmod of the result */
723 /* collation of result, or InvalidOid if none */
725 /* expressions that evaluate to upper container indexes */
727
728 /*
729 * expressions that evaluate to lower container indexes, or NIL for single
730 * container element.
731 */
733 /* the expression that evaluates to a container value */
735 /* expression for the source value, or NULL if fetch */
738
739/*
740 * CoercionContext - distinguishes the allowed set of type casts
741 *
742 * NB: ordering of the alternatives is significant; later (larger) values
743 * allow more casts than earlier ones.
744 */
745typedef enum CoercionContext
746{
747 COERCION_IMPLICIT, /* coercion in context of expression */
748 COERCION_ASSIGNMENT, /* coercion in context of assignment */
749 COERCION_PLPGSQL, /* if no assignment cast, use CoerceViaIO */
750 COERCION_EXPLICIT, /* explicit cast operation */
752
753/*
754 * CoercionForm - how to display a FuncExpr or related node
755 *
756 * "Coercion" is a bit of a misnomer, since this value records other
757 * special syntaxes besides casts, but for now we'll keep this naming.
758 *
759 * NB: equal() ignores CoercionForm fields, therefore this *must* not carry
760 * any semantically significant information. We need that behavior so that
761 * the planner will consider equivalent implicit and explicit casts to be
762 * equivalent. In cases where those actually behave differently, the coercion
763 * function's arguments will be different.
764 */
765typedef enum CoercionForm
766{
767 COERCE_EXPLICIT_CALL, /* display as a function call */
768 COERCE_EXPLICIT_CAST, /* display as an explicit cast */
769 COERCE_IMPLICIT_CAST, /* implicit cast, so hide it */
770 COERCE_SQL_SYNTAX, /* display with SQL-mandated special syntax */
772
773/*
774 * FuncExpr - expression node for a function call
775 *
776 * Collation information is irrelevant for the query jumbling, only the
777 * arguments and the function OID matter.
778 */
779typedef struct FuncExpr
780{
782 /* PG_PROC OID of the function */
784 /* PG_TYPE OID of result value */
786 /* true if function returns set */
788
789 /*
790 * true if variadic arguments have been combined into an array last
791 * argument
792 */
794 /* how to display this function call */
796 /* OID of collation of result */
798 /* OID of collation that function should use */
800 /* arguments to the function */
802 /* token location, or -1 if unknown */
805
806/*
807 * NamedArgExpr - a named argument of a function
808 *
809 * This node type can only appear in the args list of a FuncCall or FuncExpr
810 * node. We support pure positional call notation (no named arguments),
811 * named notation (all arguments are named), and mixed notation (unnamed
812 * arguments followed by named ones).
813 *
814 * Parse analysis sets argnumber to the positional index of the argument,
815 * but doesn't rearrange the argument list.
816 *
817 * The planner will convert argument lists to pure positional notation
818 * during expression preprocessing, so execution never sees a NamedArgExpr.
819 */
820typedef struct NamedArgExpr
821{
823 /* the argument expression */
825 /* the name */
827 /* argument's number in positional notation */
829 /* argument name location, or -1 if unknown */
832
833/*
834 * OpExpr - expression node for an operator invocation
835 *
836 * Semantically, this is essentially the same as a function call.
837 *
838 * Note that opfuncid is not necessarily filled in immediately on creation
839 * of the node. The planner makes sure it is valid before passing the node
840 * tree to the executor, but during parsing/planning opfuncid can be 0.
841 * Therefore, equal() will accept a zero value as being equal to other values.
842 *
843 * Internal state information and collation data is irrelevant for the query
844 * jumbling.
845 */
846typedef struct OpExpr
847{
849
850 /* PG_OPERATOR OID of the operator */
852
853 /* PG_PROC OID of underlying function */
855
856 /* PG_TYPE OID of result value */
858
859 /* true if operator returns set */
861
862 /* OID of collation of result */
864
865 /* OID of collation that operator should use */
867
868 /* arguments to the operator (1 or 2) */
870
871 /* token location, or -1 if unknown */
874
875/*
876 * DistinctExpr - expression node for "x IS DISTINCT FROM y"
877 *
878 * Except for the nodetag, this is represented identically to an OpExpr
879 * referencing the "=" operator for x and y.
880 * We use "=", not the more obvious "<>", because more datatypes have "="
881 * than "<>". This means the executor must invert the operator result.
882 * Note that the operator function won't be called at all if either input
883 * is NULL, since then the result can be determined directly.
884 */
886
887/*
888 * NullIfExpr - a NULLIF expression
889 *
890 * Like DistinctExpr, this is represented the same as an OpExpr referencing
891 * the "=" operator for x and y.
892 */
894
895/*
896 * ScalarArrayOpExpr - expression node for "scalar op ANY/ALL (array)"
897 *
898 * The operator must yield boolean. It is applied to the left operand
899 * and each element of the righthand array, and the results are combined
900 * with OR or AND (for ANY or ALL respectively). The node representation
901 * is almost the same as for the underlying operator, but we need a useOr
902 * flag to remember whether it's ANY or ALL, and we don't have to store
903 * the result type (or the collation) because it must be boolean.
904 *
905 * A ScalarArrayOpExpr with a valid hashfuncid is evaluated during execution
906 * by building a hash table containing the Const values from the RHS arg.
907 * This table is probed during expression evaluation. The planner will set
908 * hashfuncid to the hash function which must be used to build and probe the
909 * hash table. The executor determines if it should use hash-based checks or
910 * the more traditional means based on if the hashfuncid is set or not.
911 *
912 * When performing hashed NOT IN, the negfuncid will also be set to the
913 * equality function which the hash table must use to build and probe the hash
914 * table. opno and opfuncid will remain set to the <> operator and its
915 * corresponding function and won't be used during execution. For
916 * non-hashtable based NOT INs, negfuncid will be set to InvalidOid. See
917 * convert_saop_to_hashed_saop().
918 *
919 * Similar to OpExpr, opfuncid, hashfuncid, and negfuncid are not necessarily
920 * filled in right away, so will be ignored for equality if they are not set
921 * yet.
922 *
923 * OID entries of the internal function types are irrelevant for the query
924 * jumbling, but the operator OID and the arguments are.
925 */
926typedef struct ScalarArrayOpExpr
927{
929
930 /* PG_OPERATOR OID of the operator */
932
933 /* PG_PROC OID of comparison function */
935
936 /* PG_PROC OID of hash func or InvalidOid */
938
939 /* PG_PROC OID of negator of opfuncid function or InvalidOid. See above */
941
942 /* true for ANY, false for ALL */
943 bool useOr;
944
945 /* OID of collation that operator should use */
947
948 /* the scalar and array operands */
950
951 /* token location, or -1 if unknown */
954
955/*
956 * BoolExpr - expression node for the basic Boolean operators AND, OR, NOT
957 *
958 * Notice the arguments are given as a List. For NOT, of course the list
959 * must always have exactly one element. For AND and OR, there can be two
960 * or more arguments.
961 */
966
967typedef struct BoolExpr
968{
970
971 Expr xpr;
973 List *args; /* arguments to this expression */
974 ParseLoc location; /* token location, or -1 if unknown */
976
977/*
978 * SubLink
979 *
980 * A SubLink represents a subselect appearing in an expression, and in some
981 * cases also the combining operator(s) just above it. The subLinkType
982 * indicates the form of the expression represented:
983 * EXISTS_SUBLINK EXISTS(SELECT ...)
984 * ALL_SUBLINK (lefthand) op ALL (SELECT ...)
985 * ANY_SUBLINK (lefthand) op ANY (SELECT ...)
986 * ROWCOMPARE_SUBLINK (lefthand) op (SELECT ...)
987 * EXPR_SUBLINK (SELECT with single targetlist item ...)
988 * MULTIEXPR_SUBLINK (SELECT with multiple targetlist items ...)
989 * ARRAY_SUBLINK ARRAY(SELECT with single targetlist item ...)
990 * CTE_SUBLINK WITH query (never actually part of an expression)
991 * For ALL, ANY, and ROWCOMPARE, the lefthand is a list of expressions of the
992 * same length as the subselect's targetlist. ROWCOMPARE will *always* have
993 * a list with more than one entry; if the subselect has just one target
994 * then the parser will create an EXPR_SUBLINK instead (and any operator
995 * above the subselect will be represented separately).
996 * ROWCOMPARE, EXPR, and MULTIEXPR require the subselect to deliver at most
997 * one row (if it returns no rows, the result is NULL).
998 * ALL, ANY, and ROWCOMPARE require the combining operators to deliver boolean
999 * results. ALL and ANY combine the per-row results using AND and OR
1000 * semantics respectively.
1001 * ARRAY requires just one target column, and creates an array of the target
1002 * column's type using any number of rows resulting from the subselect.
1003 *
1004 * SubLink is classed as an Expr node, but it is not actually executable;
1005 * it must be replaced in the expression tree by a SubPlan node during
1006 * planning.
1007 *
1008 * NOTE: in the raw output of gram.y, testexpr contains just the raw form
1009 * of the lefthand expression (if any), and operName is the String name of
1010 * the combining operator. Also, subselect is a raw parsetree. During parse
1011 * analysis, the parser transforms testexpr into a complete boolean expression
1012 * that compares the lefthand value(s) to PARAM_SUBLINK nodes representing the
1013 * output columns of the subselect. And subselect is transformed to a Query.
1014 * This is the representation seen in saved rules and in the rewriter.
1015 *
1016 * In EXISTS, EXPR, MULTIEXPR, and ARRAY SubLinks, testexpr and operName
1017 * are unused and are always null.
1018 *
1019 * subLinkId is currently used only for MULTIEXPR SubLinks, and is zero in
1020 * other SubLinks. This number identifies different multiple-assignment
1021 * subqueries within an UPDATE statement's SET list. It is unique only
1022 * within a particular targetlist. The output column(s) of the MULTIEXPR
1023 * are referenced by PARAM_MULTIEXPR Params appearing elsewhere in the tlist.
1024 *
1025 * The CTE_SUBLINK case never occurs in actual SubLink nodes, but it is used
1026 * in SubPlans generated for WITH subqueries.
1027 */
1039
1040
1041typedef struct SubLink
1042{
1044 SubLinkType subLinkType; /* see above */
1045 int subLinkId; /* ID (1..n); 0 if not MULTIEXPR */
1046 Node *testexpr; /* outer-query test for ALL/ANY/ROWCOMPARE */
1047 /* originally specified operator name */
1049 /* subselect as Query* or raw parsetree */
1051 ParseLoc location; /* token location, or -1 if unknown */
1053
1054/*
1055 * SubPlan - executable expression node for a subplan (sub-SELECT)
1056 *
1057 * The planner replaces SubLink nodes in expression trees with SubPlan
1058 * nodes after it has finished planning the subquery. SubPlan references
1059 * a sub-plantree stored in the subplans list of the toplevel PlannedStmt.
1060 * (We avoid a direct link to make it easier to copy expression trees
1061 * without causing multiple processing of the subplan.)
1062 *
1063 * In an ordinary subplan, testexpr points to an executable expression
1064 * (OpExpr, an AND/OR tree of OpExprs, or RowCompareExpr) for the combining
1065 * operator(s); the left-hand arguments are the original lefthand expressions,
1066 * and the right-hand arguments are PARAM_EXEC Param nodes representing the
1067 * outputs of the sub-select. (NOTE: runtime coercion functions may be
1068 * inserted as well.) This is just the same expression tree as testexpr in
1069 * the original SubLink node, but the PARAM_SUBLINK nodes are replaced by
1070 * suitably numbered PARAM_EXEC nodes.
1071 *
1072 * If the sub-select becomes an initplan rather than a subplan, the executable
1073 * expression is part of the outer plan's expression tree (and the SubPlan
1074 * node itself is not, but rather is found in the outer plan's initPlan
1075 * list). In this case testexpr is NULL to avoid duplication.
1076 *
1077 * The planner also derives lists of the values that need to be passed into
1078 * and out of the subplan. Input values are represented as a list "args" of
1079 * expressions to be evaluated in the outer-query context (currently these
1080 * args are always just Vars, but in principle they could be any expression).
1081 * The values are assigned to the global PARAM_EXEC params indexed by parParam
1082 * (the parParam and args lists must have the same ordering). setParam is a
1083 * list of the PARAM_EXEC params that are computed by the sub-select, if it
1084 * is an initplan or MULTIEXPR plan; they are listed in order by sub-select
1085 * output column position. (parParam and setParam are integer Lists, not
1086 * Bitmapsets, because their ordering is significant.)
1087 *
1088 * Also, the planner computes startup and per-call costs for use of the
1089 * SubPlan. Note that these include the cost of the subquery proper,
1090 * evaluation of the testexpr if any, and any hashtable management overhead.
1091 */
1092typedef struct SubPlan
1093{
1095
1096 Expr xpr;
1097 /* Fields copied from original SubLink: */
1098 SubLinkType subLinkType; /* see above */
1099 /* The combining operators, transformed to an executable expression: */
1100 Node *testexpr; /* OpExpr or RowCompareExpr expression tree */
1101 List *paramIds; /* IDs of Params embedded in the above */
1102 /* Identification of the Plan tree to use: */
1103 int plan_id; /* Index (from 1) in PlannedStmt.subplans */
1104 /* Identification of the SubPlan for EXPLAIN and debugging purposes: */
1105 char *plan_name; /* A name assigned during planning */
1106 /* Extra data useful for determining subplan's output type: */
1107 Oid firstColType; /* Type of first column of subplan result */
1108 int32 firstColTypmod; /* Typmod of first column of subplan result */
1109 Oid firstColCollation; /* Collation of first column of subplan
1110 * result */
1111 /* Information about execution strategy: */
1112 bool isInitPlan; /* true if it's an InitPlan */
1113 bool useHashTable; /* true to store subselect output in a hash
1114 * table (implies we are doing "IN") */
1115 bool unknownEqFalse; /* true if it's okay to return FALSE when the
1116 * spec result is UNKNOWN; this allows much
1117 * simpler handling of null values */
1118 bool parallel_safe; /* is the subplan parallel-safe? */
1119 /* Note: parallel_safe does not consider contents of testexpr or args */
1120 /* Information for passing params into and out of the subselect: */
1121 /* setParam and parParam are lists of integers (param IDs) */
1122 List *setParam; /* initplan and MULTIEXPR subqueries have to
1123 * set these Params for parent plan */
1124 List *parParam; /* indices of input Params from parent plan */
1125 List *args; /* exprs to pass as parParam values */
1126 /* Estimated execution costs: */
1127 Cost startup_cost; /* one-time setup cost */
1128 Cost per_call_cost; /* cost for each subplan evaluation */
1130
1131/*
1132 * AlternativeSubPlan - expression node for a choice among SubPlans
1133 *
1134 * This is used only transiently during planning: by the time the plan
1135 * reaches the executor, all AlternativeSubPlan nodes have been removed.
1136 *
1137 * The subplans are given as a List so that the node definition need not
1138 * change if there's ever more than two alternatives. For the moment,
1139 * though, there are always exactly two; and the first one is the fast-start
1140 * plan.
1141 */
1143{
1145
1146 Expr xpr;
1147 List *subplans; /* SubPlan(s) with equivalent results */
1149
1150/* ----------------
1151 * FieldSelect
1152 *
1153 * FieldSelect represents the operation of extracting one field from a tuple
1154 * value. At runtime, the input expression is expected to yield a rowtype
1155 * Datum. The specified field number is extracted and returned as a Datum.
1156 * ----------------
1157 */
1158
1159typedef struct FieldSelect
1160{
1162 Expr *arg; /* input expression */
1163 AttrNumber fieldnum; /* attribute number of field to extract */
1164 /* type of the field (result type of this node) */
1166 /* output typmod (usually -1) */
1168 /* OID of collation of the field */
1171
1172/* ----------------
1173 * FieldStore
1174 *
1175 * FieldStore represents the operation of modifying one field in a tuple
1176 * value, yielding a new tuple value (the input is not touched!). Like
1177 * the assign case of SubscriptingRef, this is used to implement UPDATE of a
1178 * portion of a column.
1179 *
1180 * resulttype is always a named composite type (not a domain). To update
1181 * a composite domain value, apply CoerceToDomain to the FieldStore.
1182 *
1183 * A single FieldStore can actually represent updates of several different
1184 * fields. The parser only generates FieldStores with single-element lists,
1185 * but the planner will collapse multiple updates of the same base column
1186 * into one FieldStore.
1187 * ----------------
1188 */
1189
1190typedef struct FieldStore
1191{
1193 Expr *arg; /* input tuple value */
1194 List *newvals; /* new value(s) for field(s) */
1195 /* integer list of field attnums */
1197 /* type of result (same as type of arg) */
1199 /* Like RowExpr, we deliberately omit a typmod and collation here */
1201
1202/* ----------------
1203 * RelabelType
1204 *
1205 * RelabelType represents a "dummy" type coercion between two binary-
1206 * compatible datatypes, such as reinterpreting the result of an OID
1207 * expression as an int4. It is a no-op at runtime; we only need it
1208 * to provide a place to store the correct type to be attributed to
1209 * the expression result during type resolution. (We can't get away
1210 * with just overwriting the type field of the input expression node,
1211 * so we need a separate node to show the coercion's result type.)
1212 * ----------------
1213 */
1214
1215typedef struct RelabelType
1216{
1218 Expr *arg; /* input expression */
1219 Oid resulttype; /* output type of coercion expression */
1220 /* output typmod (usually -1) */
1222 /* OID of collation, or InvalidOid if none */
1224 /* how to display this node */
1226 ParseLoc location; /* token location, or -1 if unknown */
1228
1229/* ----------------
1230 * CoerceViaIO
1231 *
1232 * CoerceViaIO represents a type coercion between two types whose textual
1233 * representations are compatible, implemented by invoking the source type's
1234 * typoutput function then the destination type's typinput function.
1235 * ----------------
1236 */
1237
1238typedef struct CoerceViaIO
1239{
1241 Expr *arg; /* input expression */
1242 Oid resulttype; /* output type of coercion */
1243 /* output typmod is not stored, but is presumed -1 */
1244 /* OID of collation, or InvalidOid if none */
1246 /* how to display this node */
1248 ParseLoc location; /* token location, or -1 if unknown */
1250
1251/* ----------------
1252 * ArrayCoerceExpr
1253 *
1254 * ArrayCoerceExpr represents a type coercion from one array type to another,
1255 * which is implemented by applying the per-element coercion expression
1256 * "elemexpr" to each element of the source array. Within elemexpr, the
1257 * source element is represented by a CaseTestExpr node. Note that even if
1258 * elemexpr is a no-op (that is, just CaseTestExpr + RelabelType), the
1259 * coercion still requires some effort: we have to fix the element type OID
1260 * stored in the array header.
1261 * ----------------
1262 */
1263
1264typedef struct ArrayCoerceExpr
1265{
1267 Expr *arg; /* input expression (yields an array) */
1268 Expr *elemexpr; /* expression representing per-element work */
1269 Oid resulttype; /* output type of coercion (an array type) */
1270 /* output typmod (also element typmod) */
1272 /* OID of collation, or InvalidOid if none */
1274 /* how to display this node */
1276 ParseLoc location; /* token location, or -1 if unknown */
1278
1279/* ----------------
1280 * ConvertRowtypeExpr
1281 *
1282 * ConvertRowtypeExpr represents a type coercion from one composite type
1283 * to another, where the source type is guaranteed to contain all the columns
1284 * needed for the destination type plus possibly others; the columns need not
1285 * be in the same positions, but are matched up by name. This is primarily
1286 * used to convert a whole-row value of an inheritance child table into a
1287 * valid whole-row value of its parent table's rowtype. Both resulttype
1288 * and the exposed type of "arg" must be named composite types (not domains).
1289 * ----------------
1290 */
1291
1293{
1295 Expr *arg; /* input expression */
1296 Oid resulttype; /* output type (always a composite type) */
1297 /* Like RowExpr, we deliberately omit a typmod and collation here */
1298 /* how to display this node */
1300 ParseLoc location; /* token location, or -1 if unknown */
1302
1303/*----------
1304 * CollateExpr - COLLATE
1305 *
1306 * The planner replaces CollateExpr with RelabelType during expression
1307 * preprocessing, so execution never sees a CollateExpr.
1308 *----------
1309 */
1310typedef struct CollateExpr
1311{
1313 Expr *arg; /* input expression */
1314 Oid collOid; /* collation's OID */
1315 ParseLoc location; /* token location, or -1 if unknown */
1317
1318/*----------
1319 * CaseExpr - a CASE expression
1320 *
1321 * We support two distinct forms of CASE expression:
1322 * CASE WHEN boolexpr THEN expr [ WHEN boolexpr THEN expr ... ]
1323 * CASE testexpr WHEN compexpr THEN expr [ WHEN compexpr THEN expr ... ]
1324 * These are distinguishable by the "arg" field being NULL in the first case
1325 * and the testexpr in the second case.
1326 *
1327 * In the raw grammar output for the second form, the condition expressions
1328 * of the WHEN clauses are just the comparison values. Parse analysis
1329 * converts these to valid boolean expressions of the form
1330 * CaseTestExpr '=' compexpr
1331 * where the CaseTestExpr node is a placeholder that emits the correct
1332 * value at runtime. This structure is used so that the testexpr need be
1333 * evaluated only once. Note that after parse analysis, the condition
1334 * expressions always yield boolean.
1335 *
1336 * Note: we can test whether a CaseExpr has been through parse analysis
1337 * yet by checking whether casetype is InvalidOid or not.
1338 *----------
1339 */
1340typedef struct CaseExpr
1341{
1343 /* type of expression result */
1345 /* OID of collation, or InvalidOid if none */
1347 Expr *arg; /* implicit equality comparison argument */
1348 List *args; /* the arguments (list of WHEN clauses) */
1349 Expr *defresult; /* the default result (ELSE clause) */
1350 ParseLoc location; /* token location, or -1 if unknown */
1352
1353/*
1354 * CaseWhen - one arm of a CASE expression
1355 */
1356typedef struct CaseWhen
1357{
1359 Expr *expr; /* condition expression */
1360 Expr *result; /* substitution result */
1361 ParseLoc location; /* token location, or -1 if unknown */
1363
1364/*
1365 * Placeholder node for the test value to be processed by a CASE expression.
1366 * This is effectively like a Param, but can be implemented more simply
1367 * since we need only one replacement value at a time.
1368 *
1369 * We also abuse this node type for some other purposes, including:
1370 * * Placeholder for the current array element value in ArrayCoerceExpr;
1371 * see build_coercion_expression().
1372 * * Nested FieldStore/SubscriptingRef assignment expressions in INSERT/UPDATE;
1373 * see transformAssignmentIndirection().
1374 * * Placeholder for intermediate results in some SQL/JSON expression nodes,
1375 * such as JsonConstructorExpr.
1376 *
1377 * The uses in CaseExpr and ArrayCoerceExpr are safe only to the extent that
1378 * there is not any other CaseExpr or ArrayCoerceExpr between the value source
1379 * node and its child CaseTestExpr(s). This is true in the parse analysis
1380 * output, but the planner's function-inlining logic has to be careful not to
1381 * break it.
1382 *
1383 * The nested-assignment-expression case is safe because the only node types
1384 * that can be above such CaseTestExprs are FieldStore and SubscriptingRef.
1385 */
1386typedef struct CaseTestExpr
1387{
1389 Oid typeId; /* type for substituted value */
1390 /* typemod for substituted value */
1392 /* collation for the substituted value */
1395
1396/*
1397 * ArrayExpr - an ARRAY[] expression
1398 *
1399 * Note: if multidims is false, the constituent expressions all yield the
1400 * scalar type identified by element_typeid. If multidims is true, the
1401 * constituent expressions all yield arrays of element_typeid (ie, the same
1402 * type as array_typeid); at runtime we must check for compatible subscripts.
1403 */
1404typedef struct ArrayExpr
1405{
1407 /* type of expression result */
1409 /* OID of collation, or InvalidOid if none */
1411 /* common type of array elements */
1413 /* the array elements or sub-arrays */
1415 /* true if elements are sub-arrays */
1417 /* location of the start of the elements list */
1419 /* location of the end of the elements list */
1421 /* token location, or -1 if unknown */
1424
1425/*
1426 * RowExpr - a ROW() expression
1427 *
1428 * Note: the list of fields must have a one-for-one correspondence with
1429 * physical fields of the associated rowtype, although it is okay for it
1430 * to be shorter than the rowtype. That is, the N'th list element must
1431 * match up with the N'th physical field. When the N'th physical field
1432 * is a dropped column (attisdropped) then the N'th list element can just
1433 * be a NULL constant. (This case can only occur for named composite types,
1434 * not RECORD types, since those are built from the RowExpr itself rather
1435 * than vice versa.) It is important not to assume that length(args) is
1436 * the same as the number of columns logically present in the rowtype.
1437 *
1438 * colnames provides field names if the ROW() result is of type RECORD.
1439 * Names *must* be provided if row_typeid is RECORDOID; but if it is a
1440 * named composite type, colnames will be ignored in favor of using the
1441 * type's cataloged field names, so colnames should be NIL. Like the
1442 * args list, colnames is defined to be one-for-one with physical fields
1443 * of the rowtype (although dropped columns shouldn't appear in the
1444 * RECORD case, so this fine point is currently moot).
1445 */
1446typedef struct RowExpr
1447{
1449 List *args; /* the fields */
1450
1451 /* RECORDOID or a composite type's ID */
1453
1454 /*
1455 * row_typeid cannot be a domain over composite, only plain composite. To
1456 * create a composite domain value, apply CoerceToDomain to the RowExpr.
1457 *
1458 * Note: we deliberately do NOT store a typmod. Although a typmod will be
1459 * associated with specific RECORD types at runtime, it will differ for
1460 * different backends, and so cannot safely be stored in stored
1461 * parsetrees. We must assume typmod -1 for a RowExpr node.
1462 *
1463 * We don't need to store a collation either. The result type is
1464 * necessarily composite, and composite types never have a collation.
1465 */
1466
1467 /* how to display this node */
1469
1470 /* list of String, or NIL */
1472
1473 ParseLoc location; /* token location, or -1 if unknown */
1475
1476/*
1477 * RowCompareExpr - row-wise comparison, such as (a, b) <= (1, 2)
1478 *
1479 * We support row comparison for any operator that can be determined to
1480 * act like =, <>, <, <=, >, or >= (we determine this by looking for the
1481 * operator in btree opfamilies). Note that the same operator name might
1482 * map to a different operator for each pair of row elements, since the
1483 * element datatypes can vary.
1484 *
1485 * A RowCompareExpr node is only generated for the < <= > >= cases;
1486 * the = and <> cases are translated to simple AND or OR combinations
1487 * of the pairwise comparisons.
1488 */
1489typedef struct RowCompareExpr
1490{
1492
1493 /* LT LE GE or GT, never EQ or NE */
1495 /* OID list of pairwise comparison ops */
1497 /* OID list of containing operator families */
1499 /* OID list of collations for comparisons */
1501 /* the left-hand input arguments */
1503 /* the right-hand input arguments */
1506
1507/*
1508 * CoalesceExpr - a COALESCE expression
1509 */
1510typedef struct CoalesceExpr
1511{
1513 /* type of expression result */
1515 /* OID of collation, or InvalidOid if none */
1517 /* the arguments */
1519 /* token location, or -1 if unknown */
1522
1523/*
1524 * MinMaxExpr - a GREATEST or LEAST function
1525 */
1531
1532typedef struct MinMaxExpr
1533{
1535 /* common type of arguments and result */
1537 /* OID of collation of result */
1539 /* OID of collation that function should use */
1541 /* function to execute */
1543 /* the arguments */
1545 /* token location, or -1 if unknown */
1548
1549/*
1550 * SQLValueFunction - parameterless functions with special grammar productions
1551 *
1552 * The SQL standard categorizes some of these as <datetime value function>
1553 * and others as <general value specification>. We call 'em SQLValueFunctions
1554 * for lack of a better term. We store type and typmod of the result so that
1555 * some code doesn't need to know each function individually, and because
1556 * we would need to store typmod anyway for some of the datetime functions.
1557 * Note that currently, all variants return non-collating datatypes, so we do
1558 * not need a collation field; also, all these functions are stable.
1559 */
1578
1579typedef struct SQLValueFunction
1580{
1582 SQLValueFunctionOp op; /* which function this is */
1583
1584 /*
1585 * Result type/typmod. Type is fully determined by "op", so no need to
1586 * include this Oid in the query jumbling.
1587 */
1590 ParseLoc location; /* token location, or -1 if unknown */
1592
1593/*
1594 * XmlExpr - various SQL/XML functions requiring special grammar productions
1595 *
1596 * 'name' carries the "NAME foo" argument (already XML-escaped).
1597 * 'named_args' and 'arg_names' represent an xml_attribute list.
1598 * 'args' carries all other arguments.
1599 *
1600 * Note: result type/typmod/collation are not stored, but can be deduced
1601 * from the XmlExprOp. The type/typmod fields are just used for display
1602 * purposes, and are NOT necessarily the true result type of the node.
1603 */
1604typedef enum XmlExprOp
1605{
1606 IS_XMLCONCAT, /* XMLCONCAT(args) */
1607 IS_XMLELEMENT, /* XMLELEMENT(name, xml_attributes, args) */
1608 IS_XMLFOREST, /* XMLFOREST(xml_attributes) */
1609 IS_XMLPARSE, /* XMLPARSE(text, is_doc, preserve_ws) */
1610 IS_XMLPI, /* XMLPI(name [, args]) */
1611 IS_XMLROOT, /* XMLROOT(xml, version, standalone) */
1612 IS_XMLSERIALIZE, /* XMLSERIALIZE(is_document, xmlval, indent) */
1613 IS_DOCUMENT, /* xmlval IS DOCUMENT */
1615
1621
1622typedef struct XmlExpr
1623{
1625 /* xml function ID */
1627 /* name in xml(NAME foo ...) syntaxes */
1629 /* non-XML expressions for xml_attributes */
1631 /* parallel list of String values */
1633 /* list of expressions */
1635 /* DOCUMENT or CONTENT */
1637 /* INDENT option for XMLSERIALIZE */
1639 /* target type/typmod for XMLSERIALIZE */
1642 /* token location, or -1 if unknown */
1645
1646/*
1647 * JsonEncoding -
1648 * representation of JSON ENCODING clause
1649 */
1657
1658/*
1659 * JsonFormatType -
1660 * enumeration of JSON formats used in JSON FORMAT clause
1661 */
1662typedef enum JsonFormatType
1663{
1664 JS_FORMAT_DEFAULT, /* unspecified */
1665 JS_FORMAT_JSON, /* FORMAT JSON [ENCODING ...] */
1666 JS_FORMAT_JSONB, /* implicit internal format for RETURNING
1667 * jsonb */
1669
1670/*
1671 * JsonFormat -
1672 * representation of JSON FORMAT clause
1673 */
1674typedef struct JsonFormat
1675{
1677 JsonFormatType format_type; /* format type */
1678 JsonEncoding encoding; /* JSON encoding */
1679 ParseLoc location; /* token location, or -1 if unknown */
1681
1682/*
1683 * JsonReturning -
1684 * transformed representation of JSON RETURNING clause
1685 */
1686typedef struct JsonReturning
1687{
1689 JsonFormat *format; /* output JSON format */
1690 Oid typid; /* target type Oid */
1691 int32 typmod; /* target type modifier */
1693
1694/*
1695 * JsonValueExpr -
1696 * representation of JSON value expression (expr [FORMAT JsonFormat])
1697 *
1698 * raw_expr is the user-specified value, while formatted_expr is the value
1699 * obtained by coercing raw_expr to the type required by either the FORMAT
1700 * clause or an enclosing node's RETURNING clause.
1701 *
1702 * When deparsing a JsonValueExpr, get_rule_expr() prints raw_expr. However,
1703 * during the evaluation of a JsonValueExpr, the value of formatted_expr
1704 * takes precedence over that of raw_expr.
1705 */
1706typedef struct JsonValueExpr
1707{
1709 Expr *raw_expr; /* user-specified expression */
1710 Expr *formatted_expr; /* coerced formatted expression */
1711 JsonFormat *format; /* FORMAT clause, if specified */
1713
1724
1725/*
1726 * JsonConstructorExpr -
1727 * wrapper over FuncExpr/Aggref/WindowFunc for SQL/JSON constructors
1728 */
1730{
1732 JsonConstructorType type; /* constructor type */
1734 Expr *func; /* underlying json[b]_xxx() function call */
1735 Expr *coercion; /* coercion to RETURNING type */
1736 JsonReturning *returning; /* RETURNING clause */
1737 bool absent_on_null; /* ABSENT ON NULL? */
1738 bool unique; /* WITH UNIQUE KEYS? (JSON_OBJECT[AGG] only) */
1741
1742/*
1743 * JsonValueType -
1744 * representation of JSON item type in IS JSON predicate
1745 */
1746typedef enum JsonValueType
1747{
1748 JS_TYPE_ANY, /* IS JSON [VALUE] */
1749 JS_TYPE_OBJECT, /* IS JSON OBJECT */
1750 JS_TYPE_ARRAY, /* IS JSON ARRAY */
1751 JS_TYPE_SCALAR, /* IS JSON SCALAR */
1753
1754/*
1755 * JsonIsPredicate -
1756 * representation of IS JSON predicate
1757 */
1758typedef struct JsonIsPredicate
1759{
1761 Node *expr; /* subject expression */
1762 JsonFormat *format; /* FORMAT clause, if specified */
1763 JsonValueType item_type; /* JSON item type */
1764 bool unique_keys; /* check key uniqueness? */
1765 Oid exprBaseType; /* base type of the subject expression */
1766 ParseLoc location; /* token location, or -1 if unknown */
1768
1769/* Nodes used in SQL/JSON query functions */
1770
1771/*
1772 * JsonWrapper -
1773 * representation of WRAPPER clause for JSON_QUERY()
1774 */
1782
1783/*
1784 * JsonBehaviorType -
1785 * enumeration of behavior types used in SQL/JSON ON ERROR/EMPTY clauses
1786 *
1787 * If enum members are reordered, get_json_behavior() from ruleutils.c
1788 * must be updated accordingly.
1789 */
1802
1803/*
1804 * JsonBehavior
1805 * Specifications for ON ERROR / ON EMPTY behaviors of SQL/JSON
1806 * query functions specified by a JsonExpr
1807 *
1808 * 'expr' is the expression to emit when a given behavior (EMPTY or ERROR)
1809 * occurs on evaluating the SQL/JSON query function. 'coerce' is set to true
1810 * if 'expr' isn't already of the expected target type given by
1811 * JsonExpr.returning.
1812 */
1813typedef struct JsonBehavior
1814{
1816
1820 ParseLoc location; /* token location, or -1 if unknown */
1822
1823/*
1824 * JsonExprOp -
1825 * enumeration of SQL/JSON query function types
1826 */
1827typedef enum JsonExprOp
1828{
1829 JSON_EXISTS_OP, /* JSON_EXISTS() */
1830 JSON_QUERY_OP, /* JSON_QUERY() */
1831 JSON_VALUE_OP, /* JSON_VALUE() */
1832 JSON_TABLE_OP, /* JSON_TABLE() */
1834
1835/*
1836 * JsonExpr -
1837 * Transformed representation of JSON_VALUE(), JSON_QUERY(), and
1838 * JSON_EXISTS()
1839 */
1840typedef struct JsonExpr
1841{
1843
1845
1846 char *column_name; /* JSON_TABLE() column name or NULL if this is
1847 * not for a JSON_TABLE() */
1848
1849 /* jsonb-valued expression to query */
1851
1852 /* Format of the above expression needed by ruleutils.c */
1854
1855 /* jsonpath-valued expression containing the query pattern */
1857
1858 /* Expected type/format of the output. */
1860
1861 /* Information about the PASSING argument expressions */
1864
1865 /* User-specified or default ON EMPTY and ON ERROR behaviors */
1868
1869 /*
1870 * Information about converting the result of jsonpath functions
1871 * JsonPathQuery() and JsonPathValue() to the RETURNING type.
1872 */
1875
1876 /* WRAPPER specification for JSON_QUERY */
1878
1879 /* KEEP or OMIT QUOTES for singleton scalars returned by JSON_QUERY() */
1881
1882 /* JsonExpr's collation. */
1884
1885 /* Original JsonFuncExpr's location */
1888
1889/*
1890 * JsonTablePath
1891 * A JSON path expression to be computed as part of evaluating
1892 * a JSON_TABLE plan node
1893 */
1901
1902/*
1903 * JsonTablePlan -
1904 * Abstract class to represent different types of JSON_TABLE "plans".
1905 * A plan is used to generate a "row pattern" value by evaluating a JSON
1906 * path expression against an input JSON document, which is then used for
1907 * populating JSON_TABLE() columns
1908 */
1915
1916/*
1917 * JSON_TABLE plan to evaluate a JSON path expression and NESTED paths, if
1918 * any.
1919 */
1920typedef struct JsonTablePathScan
1921{
1923
1924 /* JSON path to evaluate */
1926
1927 /*
1928 * ERROR/EMPTY ON ERROR behavior; only significant in the plan for the
1929 * top-level path.
1930 */
1932
1933 /* Plan(s) for nested columns, if any. */
1935
1936 /*
1937 * 0-based index in TableFunc.colvalexprs of the 1st and the last column
1938 * covered by this plan. Both are -1 if all columns are nested and thus
1939 * computed by the child plan(s).
1940 */
1944
1945/*
1946 * JsonTableSiblingJoin -
1947 * Plan to join rows of sibling NESTED COLUMNS clauses in the same parent
1948 * COLUMNS clause
1949 */
1957
1958/* ----------------
1959 * NullTest
1960 *
1961 * NullTest represents the operation of testing a value for NULLness.
1962 * The appropriate test is performed and returned as a boolean Datum.
1963 *
1964 * When argisrow is false, this simply represents a test for the null value.
1965 *
1966 * When argisrow is true, the input expression must yield a rowtype, and
1967 * the node implements "row IS [NOT] NULL" per the SQL standard. This
1968 * includes checking individual fields for NULLness when the row datum
1969 * itself isn't NULL.
1970 *
1971 * NOTE: the combination of a rowtype input and argisrow==false does NOT
1972 * correspond to the SQL notation "row IS [NOT] NULL"; instead, this case
1973 * represents the SQL notation "row IS [NOT] DISTINCT FROM NULL".
1974 * ----------------
1975 */
1976
1981
1982typedef struct NullTest
1983{
1985 Expr *arg; /* input expression */
1986 NullTestType nulltesttype; /* IS NULL, IS NOT NULL */
1987 /* T to perform field-by-field null checks */
1989 ParseLoc location; /* token location, or -1 if unknown */
1991
1992/*
1993 * BooleanTest
1994 *
1995 * BooleanTest represents the operation of determining whether a boolean
1996 * is TRUE, FALSE, or UNKNOWN (ie, NULL). All six meaningful combinations
1997 * are supported. Note that a NULL input does *not* cause a NULL result.
1998 * The appropriate test is performed and returned as a boolean Datum.
1999 */
2000
2005
2006typedef struct BooleanTest
2007{
2009 Expr *arg; /* input expression */
2011 ParseLoc location; /* token location, or -1 if unknown */
2013
2014
2015/*
2016 * MergeAction
2017 *
2018 * Transformed representation of a WHEN clause in a MERGE statement
2019 */
2020
2027
2028#define NUM_MERGE_MATCH_KINDS (MERGE_WHEN_NOT_MATCHED_BY_TARGET + 1)
2029
2030typedef struct MergeAction
2031{
2033 MergeMatchKind matchKind; /* MATCHED/NOT MATCHED BY SOURCE/TARGET */
2034 CmdType commandType; /* INSERT/UPDATE/DELETE/DO NOTHING */
2035 /* OVERRIDING clause */
2037 Node *qual; /* transformed WHEN conditions */
2038 List *targetList; /* the target list (of TargetEntry) */
2039 /* target attribute numbers of an UPDATE */
2042
2043/*
2044 * CoerceToDomain
2045 *
2046 * CoerceToDomain represents the operation of coercing a value to a domain
2047 * type. At runtime (and not before) the precise set of constraints to be
2048 * checked will be determined. If the value passes, it is returned as the
2049 * result; if not, an error is raised. Note that this is equivalent to
2050 * RelabelType in the scenario where no constraints are applied.
2051 */
2052typedef struct CoerceToDomain
2053{
2055 Expr *arg; /* input expression */
2056 Oid resulttype; /* domain type ID (result type) */
2057 /* output typmod (currently always -1) */
2059 /* OID of collation, or InvalidOid if none */
2061 /* how to display this node */
2063 ParseLoc location; /* token location, or -1 if unknown */
2065
2066/*
2067 * Placeholder node for the value to be processed by a domain's check
2068 * constraint. This is effectively like a Param, but can be implemented more
2069 * simply since we need only one replacement value at a time.
2070 *
2071 * Note: the typeId/typeMod/collation will be set from the domain's base type,
2072 * not the domain itself. This is because we shouldn't consider the value
2073 * to be a member of the domain if we haven't yet checked its constraints.
2074 */
2076{
2078 /* type for substituted value */
2080 /* typemod for substituted value */
2082 /* collation for the substituted value */
2084 /* token location, or -1 if unknown */
2087
2088/*
2089 * Placeholder node for a DEFAULT marker in an INSERT or UPDATE command.
2090 *
2091 * This is not an executable expression: it must be replaced by the actual
2092 * column default expression during rewriting. But it is convenient to
2093 * treat it as an expression node during parsing and rewriting.
2094 */
2095typedef struct SetToDefault
2096{
2098 /* type for substituted value */
2100 /* typemod for substituted value */
2102 /* collation for the substituted value */
2104 /* token location, or -1 if unknown */
2107
2108/*
2109 * Node representing [WHERE] CURRENT OF cursor_name
2110 *
2111 * CURRENT OF is a bit like a Var, in that it carries the rangetable index
2112 * of the target relation being constrained; this aids placing the expression
2113 * correctly during planning. We can assume however that its "levelsup" is
2114 * always zero, due to the syntactic constraints on where it can appear.
2115 * Also, cvarno will always be a true RT index, never INNER_VAR etc.
2116 *
2117 * The referenced cursor can be represented either as a hardwired string
2118 * or as a reference to a run-time parameter of type REFCURSOR. The latter
2119 * case is for the convenience of plpgsql.
2120 */
2121typedef struct CurrentOfExpr
2122{
2124 Index cvarno; /* RT index of target relation */
2125 char *cursor_name; /* name of referenced cursor, or NULL */
2126 int cursor_param; /* refcursor parameter number, or 0 */
2128
2129/*
2130 * NextValueExpr - get next value from sequence
2131 *
2132 * This has the same effect as calling the nextval() function, but it does not
2133 * check permissions on the sequence. This is used for identity columns,
2134 * where the sequence is an implicit dependency without its own permissions.
2135 */
2142
2143/*
2144 * InferenceElem - an element of a unique index inference specification
2145 *
2146 * This mostly matches the structure of IndexElems, but having a dedicated
2147 * primnode allows for a clean separation between the use of index parameters
2148 * by utility commands, and this node.
2149 */
2150typedef struct InferenceElem
2151{
2153 Node *expr; /* expression to infer from, or NULL */
2154 Oid infercollid; /* OID of collation, or InvalidOid */
2155 Oid inferopclass; /* OID of att opclass, or InvalidOid */
2157
2158/*
2159 * ReturningExpr - return OLD/NEW.(expression) in RETURNING list
2160 *
2161 * This is used when updating an auto-updatable view and returning a view
2162 * column that is not simply a Var referring to the base relation. In such
2163 * cases, OLD/NEW.viewcol can expand to an arbitrary expression, but the
2164 * result is required to be NULL if the OLD/NEW row doesn't exist. To handle
2165 * this, the rewriter wraps the expanded expression in a ReturningExpr, which
2166 * is equivalent to "CASE WHEN (OLD/NEW row exists) THEN (expr) ELSE NULL".
2167 *
2168 * A similar situation can arise when rewriting the RETURNING clause of a
2169 * rule, which may also contain arbitrary expressions.
2170 *
2171 * ReturningExpr nodes never appear in a parsed Query --- they are only ever
2172 * inserted by the rewriter and the planner.
2173 */
2174typedef struct ReturningExpr
2175{
2177 int retlevelsup; /* > 0 if it belongs to outer query */
2178 bool retold; /* true for OLD, false for NEW */
2179 Expr *retexpr; /* expression to be returned */
2181
2182/*
2183 * GraphLabelRef - label reference in label expression inside GRAPH_TABLE clause
2184 */
2191
2192/*
2193 * GraphPropertyRef - property reference inside GRAPH_TABLE clause
2194 */
2205
2206/*--------------------
2207 * TargetEntry -
2208 * a target entry (used in query target lists)
2209 *
2210 * Strictly speaking, a TargetEntry isn't an expression node (since it can't
2211 * be evaluated by ExecEvalExpr). But we treat it as one anyway, since in
2212 * very many places it's convenient to process a whole query targetlist as a
2213 * single expression tree.
2214 *
2215 * In a SELECT's targetlist, resno should always be equal to the item's
2216 * ordinal position (counting from 1). However, in an INSERT or UPDATE
2217 * targetlist, resno represents the attribute number of the destination
2218 * column for the item; so there may be missing or out-of-order resnos.
2219 * It is even legal to have duplicated resnos; consider
2220 * UPDATE table SET arraycol[1] = ..., arraycol[2] = ..., ...
2221 * In an INSERT, the rewriter and planner will normalize the tlist by
2222 * reordering it into physical column order and filling in default values
2223 * for any columns not assigned values by the original query. In an UPDATE,
2224 * after the rewriter merges multiple assignments for the same column, the
2225 * planner extracts the target-column numbers into a separate "update_colnos"
2226 * list, and then renumbers the tlist elements serially. Thus, tlist resnos
2227 * match ordinal position in all tlists seen by the executor; but it is wrong
2228 * to assume that before planning has happened.
2229 *
2230 * resname is required to represent the correct column name in non-resjunk
2231 * entries of top-level SELECT targetlists, since it will be used as the
2232 * column title sent to the frontend. In most other contexts it is only
2233 * a debugging aid, and may be wrong or even NULL. (In particular, it may
2234 * be wrong in a tlist from a stored rule, if the referenced column has been
2235 * renamed by ALTER TABLE since the rule was made. Also, the planner tends
2236 * to store NULL rather than look up a valid name for tlist entries in
2237 * non-toplevel plan nodes.) In resjunk entries, resname should be either
2238 * a specific system-generated name (such as "ctid") or NULL; anything else
2239 * risks confusing ExecGetJunkAttribute!
2240 *
2241 * ressortgroupref is used in the representation of ORDER BY, GROUP BY, and
2242 * DISTINCT items. Targetlist entries with ressortgroupref=0 are not
2243 * sort/group items. If ressortgroupref>0, then this item is an ORDER BY,
2244 * GROUP BY, and/or DISTINCT target value. No two entries in a targetlist
2245 * may have the same nonzero ressortgroupref --- but there is no particular
2246 * meaning to the nonzero values, except as tags. (For example, one must
2247 * not assume that lower ressortgroupref means a more significant sort key.)
2248 * The order of the associated SortGroupClause lists determine the semantics.
2249 *
2250 * resorigtbl/resorigcol identify the source of the column, if it is a
2251 * simple reference to a column of a base table (or view). If it is not
2252 * a simple reference, these fields are zeroes.
2253 *
2254 * If resjunk is true then the column is a working column (such as a sort key)
2255 * that should be removed from the final output of the query. Resjunk columns
2256 * must have resnos that cannot duplicate any regular column's resno. Also
2257 * note that there are places that assume resjunk columns come after non-junk
2258 * columns.
2259 *--------------------
2260 */
2261typedef struct TargetEntry
2262{
2264 /* expression to evaluate */
2266 /* attribute number (see notes above) */
2268 /* name of the column (could be NULL) */
2270 /* nonzero if referenced by a sort/group clause */
2272 /* OID of column's source table */
2274 /* column's number in source table */
2276 /* set to true to eliminate the attribute from final target list */
2279
2280
2281/* ----------------------------------------------------------------
2282 * node types for join trees
2283 *
2284 * The leaves of a join tree structure are RangeTblRef nodes. Above
2285 * these, JoinExpr nodes can appear to denote a specific kind of join
2286 * or qualified join. Also, FromExpr nodes can appear to denote an
2287 * ordinary cross-product join ("FROM foo, bar, baz WHERE ...").
2288 * FromExpr is like a JoinExpr of jointype JOIN_INNER, except that it
2289 * may have any number of child nodes, not just two.
2290 *
2291 * NOTE: the top level of a Query's jointree is always a FromExpr.
2292 * Even if the jointree contains no rels, there will be a FromExpr.
2293 *
2294 * NOTE: the qualification expressions present in JoinExpr nodes are
2295 * *in addition to* the query's main WHERE clause, which appears as the
2296 * qual of the top-level FromExpr. The reason for associating quals with
2297 * specific nodes in the jointree is that the position of a qual is critical
2298 * when outer joins are present. (If we enforce a qual too soon or too late,
2299 * that may cause the outer join to produce the wrong set of NULL-extended
2300 * rows.) If all joins are inner joins then all the qual positions are
2301 * semantically interchangeable.
2302 *
2303 * NOTE: in the raw output of gram.y, a join tree contains RangeVar,
2304 * RangeSubselect, and RangeFunction nodes, which are all replaced by
2305 * RangeTblRef nodes during the parse analysis phase. Also, the top-level
2306 * FromExpr is added during parse analysis; the grammar regards FROM and
2307 * WHERE as separate.
2308 * ----------------------------------------------------------------
2309 */
2310
2311/*
2312 * RangeTblRef - reference to an entry in the query's rangetable
2313 *
2314 * We could use direct pointers to the RT entries and skip having these
2315 * nodes, but multiple pointers to the same node in a querytree cause
2316 * lots of headaches, so it seems better to store an index into the RT.
2317 */
2323
2324/*----------
2325 * JoinExpr - for SQL JOIN expressions
2326 *
2327 * isNatural, usingClause, and quals are interdependent. The user can write
2328 * only one of NATURAL, USING(), or ON() (this is enforced by the grammar).
2329 * If he writes NATURAL then parse analysis generates the equivalent USING()
2330 * list, and from that fills in "quals" with the right equality comparisons.
2331 * If he writes USING() then "quals" is filled with equality comparisons.
2332 * If he writes ON() then only "quals" is set. Note that NATURAL/USING
2333 * are not equivalent to ON() since they also affect the output column list.
2334 *
2335 * alias is an Alias node representing the AS alias-clause attached to the
2336 * join expression, or NULL if no clause. NB: presence or absence of the
2337 * alias has a critical impact on semantics, because a join with an alias
2338 * restricts visibility of the tables/columns inside it.
2339 *
2340 * join_using_alias is an Alias node representing the join correlation
2341 * name that SQL:2016 and later allow to be attached to JOIN/USING.
2342 * Its column alias list includes only the common column names from USING,
2343 * and it does not restrict visibility of the join's input tables.
2344 *
2345 * During parse analysis, an RTE is created for the Join, and its index
2346 * is filled into rtindex. This RTE is present mainly so that Vars can
2347 * be created that refer to the outputs of the join. The planner sometimes
2348 * generates JoinExprs internally; these can have rtindex = 0 if there are
2349 * no join alias variables referencing such joins.
2350 *----------
2351 */
2352typedef struct JoinExpr
2353{
2355 JoinType jointype; /* type of join */
2356 bool isNatural; /* Natural join? Will need to shape table */
2357 Node *larg; /* left subtree */
2358 Node *rarg; /* right subtree */
2359 /* USING clause, if any (list of String) */
2361 /* alias attached to USING clause, if any */
2363 /* qualifiers on join, if any */
2365 /* user-written alias clause, if any */
2367 /* RT index assigned for join, or 0 */
2370
2371/*----------
2372 * FromExpr - represents a FROM ... WHERE ... construct
2373 *
2374 * This is both more flexible than a JoinExpr (it can have any number of
2375 * children, including zero) and less so --- we don't need to deal with
2376 * aliases and so on. The output column set is implicitly just the union
2377 * of the outputs of the children.
2378 *----------
2379 */
2380typedef struct FromExpr
2381{
2383 List *fromlist; /* List of join subtrees */
2384 Node *quals; /* qualifiers on join, if any */
2386
2387/*----------
2388 * OnConflictExpr - represents an ON CONFLICT DO ... expression
2389 *
2390 * The optimizer requires a list of inference elements, and optionally a WHERE
2391 * clause to infer a unique index. The unique index (or, occasionally,
2392 * indexes) inferred are used to arbitrate whether or not the alternative ON
2393 * CONFLICT path is taken.
2394 *----------
2395 */
2396typedef struct OnConflictExpr
2397{
2399 OnConflictAction action; /* DO NOTHING, SELECT, or UPDATE */
2400
2401 /* Arbiter */
2402 List *arbiterElems; /* unique index arbiter list (of
2403 * InferenceElem's) */
2404 Node *arbiterWhere; /* unique index arbiter WHERE clause */
2405 Oid constraint; /* pg_constraint OID for arbiter */
2406
2407 /* ON CONFLICT DO SELECT */
2408 LockClauseStrength lockStrength; /* strength of lock for DO SELECT */
2409
2410 /* ON CONFLICT DO UPDATE */
2411 List *onConflictSet; /* List of ON CONFLICT SET TargetEntrys */
2412
2413 /* both ON CONFLICT DO SELECT and UPDATE */
2414 Node *onConflictWhere; /* qualifiers to restrict SELECT/UPDATE */
2415 int exclRelIndex; /* RT index of 'excluded' relation */
2416 List *exclRelTlist; /* tlist of the EXCLUDED pseudo relation */
2418
2419#endif /* PRIMNODES_H */
int16 AttrNumber
Definition attnum.h:21
int32_t int32
Definition c.h:614
unsigned int Index
Definition c.h:700
CompareType
Definition cmptype.h:32
LockClauseStrength
Definition lockoptions.h:22
double Cost
Definition nodes.h:261
OnConflictAction
Definition nodes.h:427
CmdType
Definition nodes.h:273
NodeTag
Definition nodes.h:27
AggSplit
Definition nodes.h:385
int ParseLoc
Definition nodes.h:250
JoinType
Definition nodes.h:298
#define plan(x)
Definition pg_regress.c:161
uint64_t Datum
Definition postgres.h:70
unsigned int Oid
static int fb(int x)
BoolTestType
Definition primnodes.h:2002
@ IS_NOT_TRUE
Definition primnodes.h:2003
@ IS_NOT_FALSE
Definition primnodes.h:2003
@ IS_NOT_UNKNOWN
Definition primnodes.h:2003
@ IS_TRUE
Definition primnodes.h:2003
@ IS_UNKNOWN
Definition primnodes.h:2003
@ IS_FALSE
Definition primnodes.h:2003
SubLinkType
Definition primnodes.h:1029
@ ARRAY_SUBLINK
Definition primnodes.h:1036
@ ANY_SUBLINK
Definition primnodes.h:1032
@ MULTIEXPR_SUBLINK
Definition primnodes.h:1035
@ CTE_SUBLINK
Definition primnodes.h:1037
@ EXPR_SUBLINK
Definition primnodes.h:1034
@ ROWCOMPARE_SUBLINK
Definition primnodes.h:1033
@ ALL_SUBLINK
Definition primnodes.h:1031
@ EXISTS_SUBLINK
Definition primnodes.h:1030
JsonFormatType
Definition primnodes.h:1663
@ JS_FORMAT_JSONB
Definition primnodes.h:1666
@ JS_FORMAT_DEFAULT
Definition primnodes.h:1664
@ JS_FORMAT_JSON
Definition primnodes.h:1665
MinMaxOp
Definition primnodes.h:1527
@ IS_LEAST
Definition primnodes.h:1529
@ IS_GREATEST
Definition primnodes.h:1528
TableFuncType
Definition primnodes.h:100
@ TFT_XMLTABLE
Definition primnodes.h:101
@ TFT_JSON_TABLE
Definition primnodes.h:102
BoolExprType
Definition primnodes.h:963
@ AND_EXPR
Definition primnodes.h:964
@ OR_EXPR
Definition primnodes.h:964
@ NOT_EXPR
Definition primnodes.h:964
JsonEncoding
Definition primnodes.h:1651
@ JS_ENC_DEFAULT
Definition primnodes.h:1652
@ JS_ENC_UTF32
Definition primnodes.h:1655
@ JS_ENC_UTF8
Definition primnodes.h:1653
@ JS_ENC_UTF16
Definition primnodes.h:1654
XmlOptionType
Definition primnodes.h:1617
@ XMLOPTION_CONTENT
Definition primnodes.h:1619
@ XMLOPTION_DOCUMENT
Definition primnodes.h:1618
SQLValueFunctionOp
Definition primnodes.h:1561
@ SVFOP_CURRENT_CATALOG
Definition primnodes.h:1575
@ SVFOP_LOCALTIME_N
Definition primnodes.h:1568
@ SVFOP_CURRENT_TIMESTAMP
Definition primnodes.h:1565
@ SVFOP_LOCALTIME
Definition primnodes.h:1567
@ SVFOP_CURRENT_TIMESTAMP_N
Definition primnodes.h:1566
@ SVFOP_CURRENT_ROLE
Definition primnodes.h:1571
@ SVFOP_USER
Definition primnodes.h:1573
@ SVFOP_CURRENT_SCHEMA
Definition primnodes.h:1576
@ SVFOP_LOCALTIMESTAMP_N
Definition primnodes.h:1570
@ SVFOP_CURRENT_DATE
Definition primnodes.h:1562
@ SVFOP_CURRENT_TIME_N
Definition primnodes.h:1564
@ SVFOP_CURRENT_TIME
Definition primnodes.h:1563
@ SVFOP_LOCALTIMESTAMP
Definition primnodes.h:1569
@ SVFOP_CURRENT_USER
Definition primnodes.h:1572
@ SVFOP_SESSION_USER
Definition primnodes.h:1574
ParamKind
Definition primnodes.h:384
@ PARAM_MULTIEXPR
Definition primnodes.h:388
@ PARAM_EXTERN
Definition primnodes.h:385
@ PARAM_SUBLINK
Definition primnodes.h:387
@ PARAM_EXEC
Definition primnodes.h:386
JsonWrapper
Definition primnodes.h:1776
@ JSW_UNCONDITIONAL
Definition primnodes.h:1780
@ JSW_CONDITIONAL
Definition primnodes.h:1779
@ JSW_UNSPEC
Definition primnodes.h:1777
@ JSW_NONE
Definition primnodes.h:1778
OpExpr DistinctExpr
Definition primnodes.h:885
XmlExprOp
Definition primnodes.h:1605
@ IS_DOCUMENT
Definition primnodes.h:1613
@ IS_XMLFOREST
Definition primnodes.h:1608
@ IS_XMLCONCAT
Definition primnodes.h:1606
@ IS_XMLPI
Definition primnodes.h:1610
@ IS_XMLPARSE
Definition primnodes.h:1609
@ IS_XMLSERIALIZE
Definition primnodes.h:1612
@ IS_XMLROOT
Definition primnodes.h:1611
@ IS_XMLELEMENT
Definition primnodes.h:1607
VarReturningType
Definition primnodes.h:256
@ VAR_RETURNING_OLD
Definition primnodes.h:258
@ VAR_RETURNING_NEW
Definition primnodes.h:259
@ VAR_RETURNING_DEFAULT
Definition primnodes.h:257
JsonBehaviorType
Definition primnodes.h:1791
@ JSON_BEHAVIOR_ERROR
Definition primnodes.h:1793
@ JSON_BEHAVIOR_TRUE
Definition primnodes.h:1795
@ JSON_BEHAVIOR_DEFAULT
Definition primnodes.h:1800
@ JSON_BEHAVIOR_EMPTY
Definition primnodes.h:1794
@ JSON_BEHAVIOR_FALSE
Definition primnodes.h:1796
@ JSON_BEHAVIOR_NULL
Definition primnodes.h:1792
@ JSON_BEHAVIOR_EMPTY_OBJECT
Definition primnodes.h:1799
@ JSON_BEHAVIOR_UNKNOWN
Definition primnodes.h:1797
@ JSON_BEHAVIOR_EMPTY_ARRAY
Definition primnodes.h:1798
OnCommitAction
Definition primnodes.h:58
@ ONCOMMIT_DELETE_ROWS
Definition primnodes.h:61
@ ONCOMMIT_NOOP
Definition primnodes.h:59
@ ONCOMMIT_PRESERVE_ROWS
Definition primnodes.h:60
@ ONCOMMIT_DROP
Definition primnodes.h:62
JsonExprOp
Definition primnodes.h:1828
@ JSON_QUERY_OP
Definition primnodes.h:1830
@ JSON_TABLE_OP
Definition primnodes.h:1832
@ JSON_EXISTS_OP
Definition primnodes.h:1829
@ JSON_VALUE_OP
Definition primnodes.h:1831
CoercionForm
Definition primnodes.h:766
@ COERCE_SQL_SYNTAX
Definition primnodes.h:770
@ COERCE_IMPLICIT_CAST
Definition primnodes.h:769
@ COERCE_EXPLICIT_CAST
Definition primnodes.h:768
@ COERCE_EXPLICIT_CALL
Definition primnodes.h:767
OverridingKind
Definition primnodes.h:28
@ OVERRIDING_NOT_SET
Definition primnodes.h:29
@ OVERRIDING_SYSTEM_VALUE
Definition primnodes.h:31
@ OVERRIDING_USER_VALUE
Definition primnodes.h:30
NullTestType
Definition primnodes.h:1978
@ IS_NULL
Definition primnodes.h:1979
@ IS_NOT_NULL
Definition primnodes.h:1979
JsonValueType
Definition primnodes.h:1747
@ JS_TYPE_ANY
Definition primnodes.h:1748
@ JS_TYPE_ARRAY
Definition primnodes.h:1750
@ JS_TYPE_OBJECT
Definition primnodes.h:1749
@ JS_TYPE_SCALAR
Definition primnodes.h:1751
MergeMatchKind
Definition primnodes.h:2022
@ MERGE_WHEN_NOT_MATCHED_BY_TARGET
Definition primnodes.h:2025
@ MERGE_WHEN_NOT_MATCHED_BY_SOURCE
Definition primnodes.h:2024
@ MERGE_WHEN_MATCHED
Definition primnodes.h:2023
CoercionContext
Definition primnodes.h:746
@ COERCION_PLPGSQL
Definition primnodes.h:749
@ COERCION_ASSIGNMENT
Definition primnodes.h:748
@ COERCION_EXPLICIT
Definition primnodes.h:750
@ COERCION_IMPLICIT
Definition primnodes.h:747
JsonConstructorType
Definition primnodes.h:1715
@ JSCTOR_JSON_SERIALIZE
Definition primnodes.h:1722
@ JSCTOR_JSON_ARRAYAGG
Definition primnodes.h:1719
@ JSCTOR_JSON_PARSE
Definition primnodes.h:1720
@ JSCTOR_JSON_OBJECT
Definition primnodes.h:1716
@ JSCTOR_JSON_SCALAR
Definition primnodes.h:1721
@ JSCTOR_JSON_ARRAY
Definition primnodes.h:1717
@ JSCTOR_JSON_OBJECTAGG
Definition primnodes.h:1718
OpExpr NullIfExpr
Definition primnodes.h:893
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:464
Expr xpr
Definition primnodes.h:461
List * aggdistinct
Definition primnodes.h:494
AggSplit aggsplit pg_node_attr(query_jumble_ignore)
List * aggdirectargs
Definition primnodes.h:485
List *aggargtypes pg_node_attr(query_jumble_ignore)
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:488
Expr * aggfilter
Definition primnodes.h:497
int aggno pg_node_attr(query_jumble_ignore)
Oid aggtype pg_node_attr(query_jumble_ignore)
bool aggvariadic pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:527
List * aggorder
Definition primnodes.h:491
bool aggpresorted pg_node_attr(equal_ignore, query_jumble_ignore)
char * aliasname
Definition primnodes.h:52
NodeTag type
Definition primnodes.h:51
List * colnames
Definition primnodes.h:53
pg_node_attr(no_query_jumble) Expr xpr
Oid resultcollid pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:1276
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)
ParseLoc location
Definition primnodes.h:1422
ParseLoc list_start
Definition primnodes.h:1418
Oid array_collid pg_node_attr(query_jumble_ignore)
List *elements pg_node_attr(query_jumble_squash)
ParseLoc list_end
Definition primnodes.h:1420
bool multidims pg_node_attr(query_jumble_ignore)
Oid array_typeid pg_node_attr(query_jumble_ignore)
pg_node_attr(custom_read_write) Expr xpr
BoolExprType boolop
Definition primnodes.h:972
List * args
Definition primnodes.h:973
ParseLoc location
Definition primnodes.h:974
ParseLoc location
Definition primnodes.h:2011
BoolTestType booltesttype
Definition primnodes.h:2010
Expr * arg
Definition primnodes.h:1347
Oid casecollid pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:1350
Oid casetype pg_node_attr(query_jumble_ignore)
Expr * defresult
Definition primnodes.h:1349
List * args
Definition primnodes.h:1348
int32 typeMod pg_node_attr(query_jumble_ignore)
Oid collation pg_node_attr(query_jumble_ignore)
Expr * result
Definition primnodes.h:1360
Expr * expr
Definition primnodes.h:1359
ParseLoc location
Definition primnodes.h:1361
Oid coalescetype pg_node_attr(query_jumble_ignore)
Oid coalescecollid pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:1520
Oid collation pg_node_attr(query_jumble_ignore)
int32 typeMod pg_node_attr(query_jumble_ignore)
int32 resulttypmod pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:2063
CoercionForm coercionformat pg_node_attr(query_jumble_ignore)
Oid resultcollid pg_node_attr(query_jumble_ignore)
CoercionForm coerceformat pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:1248
Oid resultcollid pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:1315
ParseLoc location pg_node_attr(query_jumble_location)
Oid consttype
Definition primnodes.h:330
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 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:2125
pg_node_attr(abstract) NodeTag type
int32 resulttypmod pg_node_attr(query_jumble_ignore)
AttrNumber fieldnum
Definition primnodes.h:1163
Oid resulttype pg_node_attr(query_jumble_ignore)
Oid resultcollid pg_node_attr(query_jumble_ignore)
List *fieldnums pg_node_attr(query_jumble_ignore)
Oid resulttype pg_node_attr(query_jumble_ignore)
List * newvals
Definition primnodes.h:1194
Expr * arg
Definition primnodes.h:1193
Node * quals
Definition primnodes.h:2384
NodeTag type
Definition primnodes.h:2382
List * fromlist
Definition primnodes.h:2383
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:781
bool funcretset pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:803
Oid funcid
Definition primnodes.h:783
List * args
Definition primnodes.h:801
CoercionForm funcformat pg_node_attr(query_jumble_ignore)
Oid funcresulttype pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:2189
ParseLoc location
Definition primnodes.h:2203
const char * elvarname
Definition primnodes.h:2198
List *cols pg_node_attr(equal_ignore, query_jumble_ignore)
List *args pg_node_attr(query_jumble_ignore)
Index agglevelsup
Definition primnodes.h:571
List *refs pg_node_attr(equal_ignore)
ParseLoc location
Definition primnodes.h:574
struct Query *viewQuery pg_node_attr(query_jumble_ignore)
List * colNames
Definition primnodes.h:165
char * tableSpaceName
Definition primnodes.h:169
bool skipData
Definition primnodes.h:172
OnCommitAction onCommit
Definition primnodes.h:168
NodeTag type
Definition primnodes.h:162
List * options
Definition primnodes.h:167
char * accessMethod
Definition primnodes.h:166
RangeVar * rel
Definition primnodes.h:164
Node * quals
Definition primnodes.h:2364
JoinType jointype
Definition primnodes.h:2355
Alias *join_using_alias pg_node_attr(query_jumble_ignore)
int rtindex
Definition primnodes.h:2368
Alias *alias pg_node_attr(query_jumble_ignore)
Node * larg
Definition primnodes.h:2357
bool isNatural
Definition primnodes.h:2356
NodeTag type
Definition primnodes.h:2354
Node * rarg
Definition primnodes.h:2358
List *usingClause pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:1820
JsonBehaviorType btype
Definition primnodes.h:1817
NodeTag type
Definition primnodes.h:1815
JsonReturning * returning
Definition primnodes.h:1736
JsonConstructorType type
Definition primnodes.h:1732
char * column_name
Definition primnodes.h:1846
Node * formatted_expr
Definition primnodes.h:1850
ParseLoc location
Definition primnodes.h:1886
List * passing_values
Definition primnodes.h:1863
JsonBehavior * on_empty
Definition primnodes.h:1866
JsonFormat * format
Definition primnodes.h:1853
List * passing_names
Definition primnodes.h:1862
Node * path_spec
Definition primnodes.h:1856
bool use_io_coercion
Definition primnodes.h:1873
Oid collation
Definition primnodes.h:1883
JsonReturning * returning
Definition primnodes.h:1859
bool use_json_coercion
Definition primnodes.h:1874
JsonWrapper wrapper
Definition primnodes.h:1877
JsonExprOp op
Definition primnodes.h:1844
JsonBehavior * on_error
Definition primnodes.h:1867
bool omit_quotes
Definition primnodes.h:1880
ParseLoc location
Definition primnodes.h:1679
NodeTag type
Definition primnodes.h:1676
JsonEncoding encoding
Definition primnodes.h:1678
JsonFormatType format_type
Definition primnodes.h:1677
JsonFormat * format
Definition primnodes.h:1762
JsonValueType item_type
Definition primnodes.h:1763
ParseLoc location
Definition primnodes.h:1766
JsonFormat * format
Definition primnodes.h:1689
JsonTablePath * path
Definition primnodes.h:1925
JsonTablePlan * child
Definition primnodes.h:1934
JsonTablePlan plan
Definition primnodes.h:1922
Const * value
Definition primnodes.h:1898
pg_node_attr(abstract) NodeTag type
JsonTablePlan * rplan
Definition primnodes.h:1955
JsonTablePlan * lplan
Definition primnodes.h:1954
JsonTablePlan plan
Definition primnodes.h:1952
Expr * formatted_expr
Definition primnodes.h:1710
JsonFormat * format
Definition primnodes.h:1711
Expr * raw_expr
Definition primnodes.h:1709
Definition pg_list.h:54
List *updateColnos pg_node_attr(query_jumble_ignore)
OverridingKind override pg_node_attr(query_jumble_ignore)
NodeTag type
Definition primnodes.h:2032
Node * qual
Definition primnodes.h:2037
CmdType commandType
Definition primnodes.h:2034
List * targetList
Definition primnodes.h:2038
MergeMatchKind matchKind
Definition primnodes.h:2033
ParseLoc location
Definition primnodes.h:669
List * args
Definition primnodes.h:1544
Oid minmaxcollid pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:1546
Oid inputcollid pg_node_attr(query_jumble_ignore)
Oid minmaxtype pg_node_attr(query_jumble_ignore)
MinMaxOp op
Definition primnodes.h:1542
char *name pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:830
Definition nodes.h:135
NullTestType nulltesttype
Definition primnodes.h:1986
bool argisrow pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:1989
Expr * arg
Definition primnodes.h:1985
List * arbiterElems
Definition primnodes.h:2402
OnConflictAction action
Definition primnodes.h:2399
LockClauseStrength lockStrength
Definition primnodes.h:2408
List * onConflictSet
Definition primnodes.h:2411
List * exclRelTlist
Definition primnodes.h:2416
Node * onConflictWhere
Definition primnodes.h:2414
Node * arbiterWhere
Definition primnodes.h:2404
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)
bool opretset pg_node_attr(query_jumble_ignore)
Oid opno
Definition primnodes.h:851
List * args
Definition primnodes.h:869
ParseLoc location
Definition primnodes.h:872
Expr xpr
Definition primnodes.h:848
ParseLoc location
Definition primnodes.h:404
int32 paramtypmod
Definition primnodes.h:400
int paramid
Definition primnodes.h:397
Oid paramtype
Definition primnodes.h:398
ParamKind paramkind
Definition primnodes.h:396
pg_node_attr(custom_query_jumble) Expr xpr
Oid paramcollid
Definition primnodes.h:402
NodeTag type
Definition primnodes.h:2320
char * relname
Definition primnodes.h:84
bool inh
Definition primnodes.h:87
Alias * alias
Definition primnodes.h:93
char relpersistence
Definition primnodes.h:90
char * catalogname
Definition primnodes.h:78
ParseLoc location
Definition primnodes.h:96
char * schemaname
Definition primnodes.h:81
NodeTag type
Definition primnodes.h:75
int32 resulttypmod pg_node_attr(query_jumble_ignore)
Oid resultcollid pg_node_attr(query_jumble_ignore)
CoercionForm relabelformat pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:1226
List *opnos pg_node_attr(query_jumble_ignore)
CompareType cmptype
Definition primnodes.h:1494
List *inputcollids pg_node_attr(query_jumble_ignore)
List *opfamilies pg_node_attr(query_jumble_ignore)
Expr xpr
Definition primnodes.h:1448
CoercionForm row_format pg_node_attr(query_jumble_ignore)
List * args
Definition primnodes.h:1449
ParseLoc location
Definition primnodes.h:1473
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)
ParseLoc location
Definition primnodes.h:1590
SQLValueFunctionOp op
Definition primnodes.h:1582
Oid hashfuncid pg_node_attr(equal_ignore_if_zero, query_jumble_ignore)
Oid negfuncid pg_node_attr(equal_ignore_if_zero, query_jumble_ignore)
ParseLoc location
Definition primnodes.h:952
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)
ParseLoc location
Definition primnodes.h:2105
int plan_id
Definition primnodes.h:1103
char * plan_name
Definition primnodes.h:1105
List * args
Definition primnodes.h:1125
List * paramIds
Definition primnodes.h:1101
bool isInitPlan
Definition primnodes.h:1112
bool useHashTable
Definition primnodes.h:1113
Node * testexpr
Definition primnodes.h:1100
int32 firstColTypmod
Definition primnodes.h:1108
pg_node_attr(no_query_jumble) Expr xpr
List * parParam
Definition primnodes.h:1124
bool parallel_safe
Definition primnodes.h:1118
List * setParam
Definition primnodes.h:1122
bool unknownEqFalse
Definition primnodes.h:1115
Cost startup_cost
Definition primnodes.h:1127
Oid firstColCollation
Definition primnodes.h:1109
Cost per_call_cost
Definition primnodes.h:1128
SubLinkType subLinkType
Definition primnodes.h:1098
Oid firstColType
Definition primnodes.h:1107
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:736
List * refupperindexpr
Definition primnodes.h:726
List * reflowerindexpr
Definition primnodes.h:732
List *passingvalexprs pg_node_attr(query_jumble_ignore)
List *colnames pg_node_attr(query_jumble_ignore)
List *ns_names pg_node_attr(query_jumble_ignore)
Node *plan pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:147
Bitmapset *notnulls pg_node_attr(query_jumble_ignore)
Node * docexpr
Definition primnodes.h:121
int ordinalitycol pg_node_attr(query_jumble_ignore)
List *coldefexprs pg_node_attr(query_jumble_ignore)
NodeTag type
Definition primnodes.h:113
List *colvalexprs pg_node_attr(query_jumble_ignore)
List *colcollations pg_node_attr(query_jumble_ignore)
List *coltypes pg_node_attr(query_jumble_ignore)
Node * rowexpr
Definition primnodes.h:123
List *ns_uris pg_node_attr(query_jumble_ignore)
List * colexprs
Definition primnodes.h:133
TableFuncType functype
Definition primnodes.h:115
List *coltypmods pg_node_attr(query_jumble_ignore)
Expr * expr
Definition primnodes.h:2265
char *resname pg_node_attr(query_jumble_ignore)
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:2267
Index ressortgroupref
Definition primnodes.h:2271
ParseLoc location
Definition primnodes.h:311
AttrNumber varattno
Definition primnodes.h:275
int32 vartypmod pg_node_attr(query_jumble_ignore)
Oid varcollid pg_node_attr(query_jumble_ignore)
Expr xpr
Definition primnodes.h:264
int varno
Definition primnodes.h:270
VarReturningType varreturningtype
Definition primnodes.h:298
AttrNumber varattnosyn pg_node_attr(equal_ignore, query_jumble_ignore)
Bitmapset *varnullingrels pg_node_attr(query_jumble_ignore)
Index varlevelsup
Definition primnodes.h:295
Oid vartype pg_node_attr(query_jumble_ignore)
Index varnosyn pg_node_attr(equal_ignore, query_jumble_ignore)
Oid inputcollid pg_node_attr(query_jumble_ignore)
List * args
Definition primnodes.h:606
Index winref
Definition primnodes.h:612
bool winagg pg_node_attr(query_jumble_ignore)
Oid inputcollid pg_node_attr(query_jumble_ignore)
Expr * aggfilter
Definition primnodes.h:608
ParseLoc location
Definition primnodes.h:620
Oid wincollid pg_node_attr(query_jumble_ignore)
Oid wintype pg_node_attr(query_jumble_ignore)
List *runCondition pg_node_attr(query_jumble_ignore)
int ignore_nulls
Definition primnodes.h:618
bool winstar pg_node_attr(query_jumble_ignore)
int32 typmod pg_node_attr(query_jumble_ignore)
List * args
Definition primnodes.h:1634
Expr xpr
Definition primnodes.h:1624
ParseLoc location
Definition primnodes.h:1643
bool indent
Definition primnodes.h:1638
char *name pg_node_attr(query_jumble_ignore)
XmlOptionType xmloption pg_node_attr(query_jumble_ignore)
List * named_args
Definition primnodes.h:1630
XmlExprOp op
Definition primnodes.h:1626
Oid type pg_node_attr(query_jumble_ignore)
List *arg_names pg_node_attr(query_jumble_ignore)
const char * type
const char * name
int xmloption
Definition xml.c:109