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 * For query jumble, we don't want different const values changing the jumble
323 * result. We only jumble consttype as different const types could result in
324 * very different plans and execution times, which is useful to distinguish in
325 * extensions such as pg_stat_statements.
326 */
327typedef struct Const
328{
330
331 Expr xpr;
332 /* pg_type OID of the constant's datatype */
334 /* typmod value, if any */
336 /* OID of collation, or InvalidOid if none */
338 /* typlen of the constant's datatype */
340 /* the constant's value */
342 /* whether the constant is null (if true, constvalue is undefined) */
344
345 /*
346 * Whether this datatype is passed by value. If true, then all the
347 * information is stored in the Datum. If false, then the Datum contains
348 * a pointer to the information.
349 */
351
352 /* token location, or -1 if unknown. */
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 */
456typedef struct Aggref
457{
459
460 /* pg_proc Oid of the aggregate */
462
463 /* type Oid of result of the aggregate */
465
466 /* OID of collation of result */
468
469 /* OID of collation that function should use */
471
472 /*
473 * type Oid of aggregate's transition value; ignored for equal since it
474 * might not be set yet
475 */
477
478 /* type Oids of direct and aggregated args */
480
481 /* direct arguments, if an ordered-set agg */
483
484 /* aggregated arguments and sort expressions */
486
487 /* ORDER BY (list of SortGroupClause) */
489
490 /* DISTINCT (list of SortGroupClause) */
492
493 /* FILTER expression, if any */
495
496 /* true if argument list was really '*' */
498
499 /*
500 * true if variadic arguments have been combined into an array last
501 * argument
502 */
504
505 /* aggregate kind (see pg_aggregate.h) */
507
508 /* aggregate input already sorted */
510
511 /* > 0 if agg belongs to outer query */
513
514 /* expected agg-splitting mode of parent Agg */
516
517 /* unique ID within the Agg node */
519
520 /* unique ID of transition state in the Agg */
522
523 /* token location, or -1 if unknown */
526
527/*
528 * GroupingFunc
529 *
530 * A GroupingFunc is a GROUPING(...) expression, which behaves in many ways
531 * like an aggregate function (e.g. it "belongs" to a specific query level,
532 * which might not be the one immediately containing it), but also differs in
533 * an important respect: it never evaluates its arguments, they merely
534 * designate expressions from the GROUP BY clause of the query level to which
535 * it belongs.
536 *
537 * The spec defines the evaluation of GROUPING() purely by syntactic
538 * replacement, but we make it a real expression for optimization purposes so
539 * that one Agg node can handle multiple grouping sets at once. Evaluating the
540 * result only needs the column positions to check against the grouping set
541 * being projected. However, for EXPLAIN to produce meaningful output, we have
542 * to keep the original expressions around, since expression deparse does not
543 * give us any feasible way to get at the GROUP BY clause.
544 *
545 * Also, we treat two GroupingFunc nodes as equal if they have equal arguments
546 * lists and agglevelsup, without comparing the refs and cols annotations.
547 *
548 * In raw parse output we have only the args list; parse analysis fills in the
549 * refs list, and the planner fills in the cols list.
550 */
551typedef struct GroupingFunc
552{
554
555 /* arguments, not evaluated but kept for benefit of EXPLAIN etc. */
557
558 /* ressortgrouprefs of arguments */
560
561 /* actual column positions set by planner */
563
564 /* same as Aggref.agglevelsup */
566
567 /* token location */
570
571/*
572 * Null Treatment options. If specified, initially set to PARSER_IGNORE_NULLS
573 * which is then converted to IGNORE_NULLS if the window function allows the
574 * null treatment clause.
575 */
576#define NO_NULLTREATMENT 0
577#define PARSER_IGNORE_NULLS 1
578#define PARSER_RESPECT_NULLS 2
579#define IGNORE_NULLS 3
580
581 /*
582 * WindowFunc
583 *
584 * Node type to represent a call to a window function.
585 */
586typedef struct WindowFunc
587{
589 /* pg_proc Oid of the function */
591 /* type Oid of result of the window function */
593 /* OID of collation of result */
595 /* OID of collation that function should use */
597 /* arguments to the window function */
599 /* FILTER expression, if any */
601 /* List of WindowFuncRunConditions to help short-circuit execution */
603 /* index of associated WindowClause */
605 /* true if argument list was really '*' */
607 /* is function a simple aggregate? */
609 /* ignore nulls. One of the Null Treatment options */
611 /* token location, or -1 if unknown */
614
615/*
616 * WindowFuncRunCondition
617 *
618 * Represents intermediate OpExprs which will be used by WindowAgg to
619 * short-circuit execution.
620 */
622{
624
625 /* PG_OPERATOR OID of the operator */
627 /* OID of collation that operator should use */
629
630 /*
631 * true of WindowFunc belongs on the left of the resulting OpExpr or false
632 * if the WindowFunc is on the right.
633 */
635
636 /*
637 * The Expr being compared to the WindowFunc to use in the OpExpr in the
638 * WindowAgg's runCondition
639 */
642
643/*
644 * MergeSupportFunc
645 *
646 * A MergeSupportFunc is a merge support function expression that can only
647 * appear in the RETURNING list of a MERGE command. It returns information
648 * about the currently executing merge action.
649 *
650 * Currently, the only supported function is MERGE_ACTION(), which returns the
651 * command executed ("INSERT", "UPDATE", or "DELETE").
652 */
653typedef struct MergeSupportFunc
654{
656 /* type Oid of result */
658 /* OID of collation, or InvalidOid if none */
660 /* token location, or -1 if unknown */
663
664/*
665 * SubscriptingRef: describes a subscripting operation over a container
666 * (array, etc).
667 *
668 * A SubscriptingRef can describe fetching a single element from a container,
669 * fetching a part of a container (e.g. an array slice), storing a single
670 * element into a container, or storing a slice. The "store" cases work with
671 * an initial container value and a source value that is inserted into the
672 * appropriate part of the container; the result of the operation is an
673 * entire new modified container value.
674 *
675 * If reflowerindexpr = NIL, then we are fetching or storing a single container
676 * element at the subscripts given by refupperindexpr. Otherwise we are
677 * fetching or storing a container slice, that is a rectangular subcontainer
678 * with lower and upper bounds given by the index expressions.
679 * reflowerindexpr must be the same length as refupperindexpr when it
680 * is not NIL.
681 *
682 * In the slice case, individual expressions in the subscript lists can be
683 * NULL, meaning "substitute the array's current lower or upper bound".
684 * (Non-array containers may or may not support this.)
685 *
686 * refcontainertype is the actual container type that determines the
687 * subscripting semantics. (This will generally be either the exposed type of
688 * refexpr, or the base type if that is a domain.) refelemtype is the type of
689 * the container's elements; this is saved for the use of the subscripting
690 * functions, but is not used by the core code. refrestype, reftypmod, and
691 * refcollid describe the type of the SubscriptingRef's result. In a store
692 * expression, refrestype will always match refcontainertype; in a fetch,
693 * it could be refelemtype for an element fetch, or refcontainertype for a
694 * slice fetch, or possibly something else as determined by type-specific
695 * subscripting logic. Likewise, reftypmod and refcollid will match the
696 * container's properties in a store, but could be different in a fetch.
697 *
698 * Note: for the cases where a container is returned, if refexpr yields a R/W
699 * expanded container, then the implementation is allowed to modify that
700 * object in-place and return the same object.
701 */
702typedef struct SubscriptingRef
703{
705 /* type of the container proper */
707 /* the container type's pg_type.typelem */
709 /* type of the SubscriptingRef's result */
711 /* typmod of the result */
713 /* collation of result, or InvalidOid if none */
715 /* expressions that evaluate to upper container indexes */
717
718 /*
719 * expressions that evaluate to lower container indexes, or NIL for single
720 * container element.
721 */
723 /* the expression that evaluates to a container value */
725 /* expression for the source value, or NULL if fetch */
728
729/*
730 * CoercionContext - distinguishes the allowed set of type casts
731 *
732 * NB: ordering of the alternatives is significant; later (larger) values
733 * allow more casts than earlier ones.
734 */
735typedef enum CoercionContext
736{
737 COERCION_IMPLICIT, /* coercion in context of expression */
738 COERCION_ASSIGNMENT, /* coercion in context of assignment */
739 COERCION_PLPGSQL, /* if no assignment cast, use CoerceViaIO */
740 COERCION_EXPLICIT, /* explicit cast operation */
742
743/*
744 * CoercionForm - how to display a FuncExpr or related node
745 *
746 * "Coercion" is a bit of a misnomer, since this value records other
747 * special syntaxes besides casts, but for now we'll keep this naming.
748 *
749 * NB: equal() ignores CoercionForm fields, therefore this *must* not carry
750 * any semantically significant information. We need that behavior so that
751 * the planner will consider equivalent implicit and explicit casts to be
752 * equivalent. In cases where those actually behave differently, the coercion
753 * function's arguments will be different.
754 */
755typedef enum CoercionForm
756{
757 COERCE_EXPLICIT_CALL, /* display as a function call */
758 COERCE_EXPLICIT_CAST, /* display as an explicit cast */
759 COERCE_IMPLICIT_CAST, /* implicit cast, so hide it */
760 COERCE_SQL_SYNTAX, /* display with SQL-mandated special syntax */
762
763/*
764 * FuncExpr - expression node for a function call
765 */
766typedef struct FuncExpr
767{
769 /* PG_PROC OID of the function */
771 /* PG_TYPE OID of result value */
773 /* true if function returns set */
775
776 /*
777 * true if variadic arguments have been combined into an array last
778 * argument
779 */
781 /* how to display this function call */
783 /* OID of collation of result */
785 /* OID of collation that function should use */
787 /* arguments to the function */
789 /* token location, or -1 if unknown */
792
793/*
794 * NamedArgExpr - a named argument of a function
795 *
796 * This node type can only appear in the args list of a FuncCall or FuncExpr
797 * node. We support pure positional call notation (no named arguments),
798 * named notation (all arguments are named), and mixed notation (unnamed
799 * arguments followed by named ones).
800 *
801 * Parse analysis sets argnumber to the positional index of the argument,
802 * but doesn't rearrange the argument list.
803 *
804 * The planner will convert argument lists to pure positional notation
805 * during expression preprocessing, so execution never sees a NamedArgExpr.
806 */
807typedef struct NamedArgExpr
808{
810 /* the argument expression */
812 /* the name */
814 /* argument's number in positional notation */
816 /* argument name location, or -1 if unknown */
819
820/*
821 * OpExpr - expression node for an operator invocation
822 *
823 * Semantically, this is essentially the same as a function call.
824 *
825 * Note that opfuncid is not necessarily filled in immediately on creation
826 * of the node. The planner makes sure it is valid before passing the node
827 * tree to the executor, but during parsing/planning opfuncid can be 0.
828 * Therefore, equal() will accept a zero value as being equal to other values.
829 */
830typedef struct OpExpr
831{
833
834 /* PG_OPERATOR OID of the operator */
836
837 /* PG_PROC OID of underlying function */
839
840 /* PG_TYPE OID of result value */
842
843 /* true if operator returns set */
845
846 /* OID of collation of result */
848
849 /* OID of collation that operator should use */
851
852 /* arguments to the operator (1 or 2) */
854
855 /* token location, or -1 if unknown */
858
859/*
860 * DistinctExpr - expression node for "x IS DISTINCT FROM y"
861 *
862 * Except for the nodetag, this is represented identically to an OpExpr
863 * referencing the "=" operator for x and y.
864 * We use "=", not the more obvious "<>", because more datatypes have "="
865 * than "<>". This means the executor must invert the operator result.
866 * Note that the operator function won't be called at all if either input
867 * is NULL, since then the result can be determined directly.
868 */
870
871/*
872 * NullIfExpr - a NULLIF expression
873 *
874 * Like DistinctExpr, this is represented the same as an OpExpr referencing
875 * the "=" operator for x and y.
876 */
878
879/*
880 * ScalarArrayOpExpr - expression node for "scalar op ANY/ALL (array)"
881 *
882 * The operator must yield boolean. It is applied to the left operand
883 * and each element of the righthand array, and the results are combined
884 * with OR or AND (for ANY or ALL respectively). The node representation
885 * is almost the same as for the underlying operator, but we need a useOr
886 * flag to remember whether it's ANY or ALL, and we don't have to store
887 * the result type (or the collation) because it must be boolean.
888 *
889 * A ScalarArrayOpExpr with a valid hashfuncid is evaluated during execution
890 * by building a hash table containing the Const values from the RHS arg.
891 * This table is probed during expression evaluation. The planner will set
892 * hashfuncid to the hash function which must be used to build and probe the
893 * hash table. The executor determines if it should use hash-based checks or
894 * the more traditional means based on if the hashfuncid is set or not.
895 *
896 * When performing hashed NOT IN, the negfuncid will also be set to the
897 * equality function which the hash table must use to build and probe the hash
898 * table. opno and opfuncid will remain set to the <> operator and its
899 * corresponding function and won't be used during execution. For
900 * non-hashtable based NOT INs, negfuncid will be set to InvalidOid. See
901 * convert_saop_to_hashed_saop().
902 *
903 * Similar to OpExpr, opfuncid, hashfuncid, and negfuncid are not necessarily
904 * filled in right away, so will be ignored for equality if they are not set
905 * yet.
906 */
907typedef struct ScalarArrayOpExpr
908{
910
911 /* PG_OPERATOR OID of the operator */
913
914 /* PG_PROC OID of comparison function */
916
917 /* PG_PROC OID of hash func or InvalidOid */
919
920 /* PG_PROC OID of negator of opfuncid function or InvalidOid. See above */
922
923 /* true for ANY, false for ALL */
924 bool useOr;
925
926 /* OID of collation that operator should use */
928
929 /* the scalar and array operands */
931
932 /* token location, or -1 if unknown */
935
936/*
937 * BoolExpr - expression node for the basic Boolean operators AND, OR, NOT
938 *
939 * Notice the arguments are given as a List. For NOT, of course the list
940 * must always have exactly one element. For AND and OR, there can be two
941 * or more arguments.
942 */
947
948typedef struct BoolExpr
949{
951
952 Expr xpr;
954 List *args; /* arguments to this expression */
955 ParseLoc location; /* token location, or -1 if unknown */
957
958/*
959 * SubLink
960 *
961 * A SubLink represents a subselect appearing in an expression, and in some
962 * cases also the combining operator(s) just above it. The subLinkType
963 * indicates the form of the expression represented:
964 * EXISTS_SUBLINK EXISTS(SELECT ...)
965 * ALL_SUBLINK (lefthand) op ALL (SELECT ...)
966 * ANY_SUBLINK (lefthand) op ANY (SELECT ...)
967 * ROWCOMPARE_SUBLINK (lefthand) op (SELECT ...)
968 * EXPR_SUBLINK (SELECT with single targetlist item ...)
969 * MULTIEXPR_SUBLINK (SELECT with multiple targetlist items ...)
970 * ARRAY_SUBLINK ARRAY(SELECT with single targetlist item ...)
971 * CTE_SUBLINK WITH query (never actually part of an expression)
972 * For ALL, ANY, and ROWCOMPARE, the lefthand is a list of expressions of the
973 * same length as the subselect's targetlist. ROWCOMPARE will *always* have
974 * a list with more than one entry; if the subselect has just one target
975 * then the parser will create an EXPR_SUBLINK instead (and any operator
976 * above the subselect will be represented separately).
977 * ROWCOMPARE, EXPR, and MULTIEXPR require the subselect to deliver at most
978 * one row (if it returns no rows, the result is NULL).
979 * ALL, ANY, and ROWCOMPARE require the combining operators to deliver boolean
980 * results. ALL and ANY combine the per-row results using AND and OR
981 * semantics respectively.
982 * ARRAY requires just one target column, and creates an array of the target
983 * column's type using any number of rows resulting from the subselect.
984 *
985 * SubLink is classed as an Expr node, but it is not actually executable;
986 * it must be replaced in the expression tree by a SubPlan node during
987 * planning.
988 *
989 * NOTE: in the raw output of gram.y, testexpr contains just the raw form
990 * of the lefthand expression (if any), and operName is the String name of
991 * the combining operator. Also, subselect is a raw parsetree. During parse
992 * analysis, the parser transforms testexpr into a complete boolean expression
993 * that compares the lefthand value(s) to PARAM_SUBLINK nodes representing the
994 * output columns of the subselect. And subselect is transformed to a Query.
995 * This is the representation seen in saved rules and in the rewriter.
996 *
997 * In EXISTS, EXPR, MULTIEXPR, and ARRAY SubLinks, testexpr and operName
998 * are unused and are always null.
999 *
1000 * subLinkId is currently used only for MULTIEXPR SubLinks, and is zero in
1001 * other SubLinks. This number identifies different multiple-assignment
1002 * subqueries within an UPDATE statement's SET list. It is unique only
1003 * within a particular targetlist. The output column(s) of the MULTIEXPR
1004 * are referenced by PARAM_MULTIEXPR Params appearing elsewhere in the tlist.
1005 *
1006 * The CTE_SUBLINK case never occurs in actual SubLink nodes, but it is used
1007 * in SubPlans generated for WITH subqueries.
1008 */
1020
1021
1022typedef struct SubLink
1023{
1025 SubLinkType subLinkType; /* see above */
1026 int subLinkId; /* ID (1..n); 0 if not MULTIEXPR */
1027 Node *testexpr; /* outer-query test for ALL/ANY/ROWCOMPARE */
1028 /* originally specified operator name */
1030 /* subselect as Query* or raw parsetree */
1032 ParseLoc location; /* token location, or -1 if unknown */
1034
1035/*
1036 * SubPlan - executable expression node for a subplan (sub-SELECT)
1037 *
1038 * The planner replaces SubLink nodes in expression trees with SubPlan
1039 * nodes after it has finished planning the subquery. SubPlan references
1040 * a sub-plantree stored in the subplans list of the toplevel PlannedStmt.
1041 * (We avoid a direct link to make it easier to copy expression trees
1042 * without causing multiple processing of the subplan.)
1043 *
1044 * In an ordinary subplan, testexpr points to an executable expression
1045 * (OpExpr, an AND/OR tree of OpExprs, or RowCompareExpr) for the combining
1046 * operator(s); the left-hand arguments are the original lefthand expressions,
1047 * and the right-hand arguments are PARAM_EXEC Param nodes representing the
1048 * outputs of the sub-select. (NOTE: runtime coercion functions may be
1049 * inserted as well.) This is just the same expression tree as testexpr in
1050 * the original SubLink node, but the PARAM_SUBLINK nodes are replaced by
1051 * suitably numbered PARAM_EXEC nodes.
1052 *
1053 * If the sub-select becomes an initplan rather than a subplan, the executable
1054 * expression is part of the outer plan's expression tree (and the SubPlan
1055 * node itself is not, but rather is found in the outer plan's initPlan
1056 * list). In this case testexpr is NULL to avoid duplication.
1057 *
1058 * The planner also derives lists of the values that need to be passed into
1059 * and out of the subplan. Input values are represented as a list "args" of
1060 * expressions to be evaluated in the outer-query context (currently these
1061 * args are always just Vars, but in principle they could be any expression).
1062 * The values are assigned to the global PARAM_EXEC params indexed by parParam
1063 * (the parParam and args lists must have the same ordering). setParam is a
1064 * list of the PARAM_EXEC params that are computed by the sub-select, if it
1065 * is an initplan or MULTIEXPR plan; they are listed in order by sub-select
1066 * output column position. (parParam and setParam are integer Lists, not
1067 * Bitmapsets, because their ordering is significant.)
1068 *
1069 * Also, the planner computes startup and per-call costs for use of the
1070 * SubPlan. Note that these include the cost of the subquery proper,
1071 * evaluation of the testexpr if any, and any hashtable management overhead.
1072 */
1073typedef struct SubPlan
1074{
1076
1077 Expr xpr;
1078 /* Fields copied from original SubLink: */
1079 SubLinkType subLinkType; /* see above */
1080 /* The combining operators, transformed to an executable expression: */
1081 Node *testexpr; /* OpExpr or RowCompareExpr expression tree */
1082 List *paramIds; /* IDs of Params embedded in the above */
1083 /* Identification of the Plan tree to use: */
1084 int plan_id; /* Index (from 1) in PlannedStmt.subplans */
1085 /* Identification of the SubPlan for EXPLAIN and debugging purposes: */
1086 char *plan_name; /* A name assigned during planning */
1087 /* Extra data useful for determining subplan's output type: */
1088 Oid firstColType; /* Type of first column of subplan result */
1089 int32 firstColTypmod; /* Typmod of first column of subplan result */
1090 Oid firstColCollation; /* Collation of first column of subplan
1091 * result */
1092 /* Information about execution strategy: */
1093 bool isInitPlan; /* true if it's an InitPlan */
1094 bool useHashTable; /* true to store subselect output in a hash
1095 * table (implies we are doing "IN") */
1096 bool unknownEqFalse; /* true if it's okay to return FALSE when the
1097 * spec result is UNKNOWN; this allows much
1098 * simpler handling of null values */
1099 bool parallel_safe; /* is the subplan parallel-safe? */
1100 /* Note: parallel_safe does not consider contents of testexpr or args */
1101 /* Information for passing params into and out of the subselect: */
1102 /* setParam and parParam are lists of integers (param IDs) */
1103 List *setParam; /* initplan and MULTIEXPR subqueries have to
1104 * set these Params for parent plan */
1105 List *parParam; /* indices of input Params from parent plan */
1106 List *args; /* exprs to pass as parParam values */
1107 /* Estimated execution costs: */
1108 int disabled_nodes; /* count of disabled nodes in the plan */
1109 Cost startup_cost; /* one-time setup cost */
1110 Cost per_call_cost; /* cost for each subplan evaluation */
1112
1113/*
1114 * AlternativeSubPlan - expression node for a choice among SubPlans
1115 *
1116 * This is used only transiently during planning: by the time the plan
1117 * reaches the executor, all AlternativeSubPlan nodes have been removed.
1118 *
1119 * The subplans are given as a List so that the node definition need not
1120 * change if there's ever more than two alternatives. For the moment,
1121 * though, there are always exactly two; and the first one is the fast-start
1122 * plan.
1123 */
1125{
1127
1128 Expr xpr;
1129 List *subplans; /* SubPlan(s) with equivalent results */
1131
1132/* ----------------
1133 * FieldSelect
1134 *
1135 * FieldSelect represents the operation of extracting one field from a tuple
1136 * value. At runtime, the input expression is expected to yield a rowtype
1137 * Datum. The specified field number is extracted and returned as a Datum.
1138 * ----------------
1139 */
1140
1141typedef struct FieldSelect
1142{
1144 Expr *arg; /* input expression */
1145 AttrNumber fieldnum; /* attribute number of field to extract */
1146 /* type of the field (result type of this node) */
1148 /* output typmod (usually -1) */
1150 /* OID of collation of the field */
1153
1154/* ----------------
1155 * FieldStore
1156 *
1157 * FieldStore represents the operation of modifying one field in a tuple
1158 * value, yielding a new tuple value (the input is not touched!). Like
1159 * the assign case of SubscriptingRef, this is used to implement UPDATE of a
1160 * portion of a column.
1161 *
1162 * resulttype is always a named composite type (not a domain). To update
1163 * a composite domain value, apply CoerceToDomain to the FieldStore.
1164 *
1165 * A single FieldStore can actually represent updates of several different
1166 * fields. The parser only generates FieldStores with single-element lists,
1167 * but the planner will collapse multiple updates of the same base column
1168 * into one FieldStore.
1169 * ----------------
1170 */
1171
1172typedef struct FieldStore
1173{
1175 Expr *arg; /* input tuple value */
1176 List *newvals; /* new value(s) for field(s) */
1177 /* integer list of field attnums */
1179 /* type of result (same as type of arg) */
1181 /* Like RowExpr, we deliberately omit a typmod and collation here */
1183
1184/* ----------------
1185 * RelabelType
1186 *
1187 * RelabelType represents a "dummy" type coercion between two binary-
1188 * compatible datatypes, such as reinterpreting the result of an OID
1189 * expression as an int4. It is a no-op at runtime; we only need it
1190 * to provide a place to store the correct type to be attributed to
1191 * the expression result during type resolution. (We can't get away
1192 * with just overwriting the type field of the input expression node,
1193 * so we need a separate node to show the coercion's result type.)
1194 * ----------------
1195 */
1196
1197typedef struct RelabelType
1198{
1200 Expr *arg; /* input expression */
1201 Oid resulttype; /* output type of coercion expression */
1202 /* output typmod (usually -1) */
1204 /* OID of collation, or InvalidOid if none */
1206 /* how to display this node */
1208 ParseLoc location; /* token location, or -1 if unknown */
1210
1211/* ----------------
1212 * CoerceViaIO
1213 *
1214 * CoerceViaIO represents a type coercion between two types whose textual
1215 * representations are compatible, implemented by invoking the source type's
1216 * typoutput function then the destination type's typinput function.
1217 * ----------------
1218 */
1219
1220typedef struct CoerceViaIO
1221{
1223 Expr *arg; /* input expression */
1224 Oid resulttype; /* output type of coercion */
1225 /* output typmod is not stored, but is presumed -1 */
1226 /* OID of collation, or InvalidOid if none */
1228 /* how to display this node */
1230 ParseLoc location; /* token location, or -1 if unknown */
1232
1233/* ----------------
1234 * ArrayCoerceExpr
1235 *
1236 * ArrayCoerceExpr represents a type coercion from one array type to another,
1237 * which is implemented by applying the per-element coercion expression
1238 * "elemexpr" to each element of the source array. Within elemexpr, the
1239 * source element is represented by a CaseTestExpr node. Note that even if
1240 * elemexpr is a no-op (that is, just CaseTestExpr + RelabelType), the
1241 * coercion still requires some effort: we have to fix the element type OID
1242 * stored in the array header.
1243 * ----------------
1244 */
1245
1246typedef struct ArrayCoerceExpr
1247{
1249 Expr *arg; /* input expression (yields an array) */
1250 Expr *elemexpr; /* expression representing per-element work */
1251 Oid resulttype; /* output type of coercion (an array type) */
1252 /* output typmod (also element typmod) */
1254 /* OID of collation, or InvalidOid if none */
1256 /* how to display this node */
1258 ParseLoc location; /* token location, or -1 if unknown */
1260
1261/* ----------------
1262 * ConvertRowtypeExpr
1263 *
1264 * ConvertRowtypeExpr represents a type coercion from one composite type
1265 * to another, where the source type is guaranteed to contain all the columns
1266 * needed for the destination type plus possibly others; the columns need not
1267 * be in the same positions, but are matched up by name. This is primarily
1268 * used to convert a whole-row value of an inheritance child table into a
1269 * valid whole-row value of its parent table's rowtype. Both resulttype
1270 * and the exposed type of "arg" must be named composite types (not domains).
1271 * ----------------
1272 */
1273
1275{
1277 Expr *arg; /* input expression */
1278 Oid resulttype; /* output type (always a composite type) */
1279 /* Like RowExpr, we deliberately omit a typmod and collation here */
1280 /* how to display this node */
1282 ParseLoc location; /* token location, or -1 if unknown */
1284
1285/*----------
1286 * CollateExpr - COLLATE
1287 *
1288 * The planner replaces CollateExpr with RelabelType during expression
1289 * preprocessing, so execution never sees a CollateExpr.
1290 *----------
1291 */
1292typedef struct CollateExpr
1293{
1295 Expr *arg; /* input expression */
1296 Oid collOid; /* collation's OID */
1297 ParseLoc location; /* token location, or -1 if unknown */
1299
1300/*----------
1301 * CaseExpr - a CASE expression
1302 *
1303 * We support two distinct forms of CASE expression:
1304 * CASE WHEN boolexpr THEN expr [ WHEN boolexpr THEN expr ... ]
1305 * CASE testexpr WHEN compexpr THEN expr [ WHEN compexpr THEN expr ... ]
1306 * These are distinguishable by the "arg" field being NULL in the first case
1307 * and the testexpr in the second case.
1308 *
1309 * In the raw grammar output for the second form, the condition expressions
1310 * of the WHEN clauses are just the comparison values. Parse analysis
1311 * converts these to valid boolean expressions of the form
1312 * CaseTestExpr '=' compexpr
1313 * where the CaseTestExpr node is a placeholder that emits the correct
1314 * value at runtime. This structure is used so that the testexpr need be
1315 * evaluated only once. Note that after parse analysis, the condition
1316 * expressions always yield boolean.
1317 *
1318 * Note: we can test whether a CaseExpr has been through parse analysis
1319 * yet by checking whether casetype is InvalidOid or not.
1320 *----------
1321 */
1322typedef struct CaseExpr
1323{
1325 /* type of expression result */
1327 /* OID of collation, or InvalidOid if none */
1329 Expr *arg; /* implicit equality comparison argument */
1330 List *args; /* the arguments (list of WHEN clauses) */
1331 Expr *defresult; /* the default result (ELSE clause) */
1332 ParseLoc location; /* token location, or -1 if unknown */
1334
1335/*
1336 * CaseWhen - one arm of a CASE expression
1337 */
1338typedef struct CaseWhen
1339{
1341 Expr *expr; /* condition expression */
1342 Expr *result; /* substitution result */
1343 ParseLoc location; /* token location, or -1 if unknown */
1345
1346/*
1347 * Placeholder node for the test value to be processed by a CASE expression.
1348 * This is effectively like a Param, but can be implemented more simply
1349 * since we need only one replacement value at a time.
1350 *
1351 * We also abuse this node type for some other purposes, including:
1352 * * Placeholder for the current array element value in ArrayCoerceExpr;
1353 * see build_coercion_expression().
1354 * * Nested FieldStore/SubscriptingRef assignment expressions in INSERT/UPDATE;
1355 * see transformAssignmentIndirection().
1356 * * Placeholder for intermediate results in some SQL/JSON expression nodes,
1357 * such as JsonConstructorExpr.
1358 *
1359 * The uses in CaseExpr and ArrayCoerceExpr are safe only to the extent that
1360 * there is not any other CaseExpr or ArrayCoerceExpr between the value source
1361 * node and its child CaseTestExpr(s). This is true in the parse analysis
1362 * output, but the planner's function-inlining logic has to be careful not to
1363 * break it.
1364 *
1365 * The nested-assignment-expression case is safe because the only node types
1366 * that can be above such CaseTestExprs are FieldStore and SubscriptingRef.
1367 */
1368typedef struct CaseTestExpr
1369{
1371 Oid typeId; /* type for substituted value */
1372 /* typemod for substituted value */
1374 /* collation for the substituted value */
1377
1378/*
1379 * ArrayExpr - an ARRAY[] expression
1380 *
1381 * Note: if multidims is false, the constituent expressions all yield the
1382 * scalar type identified by element_typeid. If multidims is true, the
1383 * constituent expressions all yield arrays of element_typeid (ie, the same
1384 * type as array_typeid); at runtime we must check for compatible subscripts.
1385 */
1386typedef struct ArrayExpr
1387{
1389 /* type of expression result */
1391 /* OID of collation, or InvalidOid if none */
1393 /* common type of array elements */
1395 /* the array elements or sub-arrays */
1397 /* true if elements are sub-arrays */
1399 /* location of the start of the elements list */
1401 /* location of the end of the elements list */
1403 /* token location, or -1 if unknown */
1406
1407/*
1408 * RowExpr - a ROW() expression
1409 *
1410 * Note: the list of fields must have a one-for-one correspondence with
1411 * physical fields of the associated rowtype, although it is okay for it
1412 * to be shorter than the rowtype. That is, the N'th list element must
1413 * match up with the N'th physical field. When the N'th physical field
1414 * is a dropped column (attisdropped) then the N'th list element can just
1415 * be a NULL constant. (This case can only occur for named composite types,
1416 * not RECORD types, since those are built from the RowExpr itself rather
1417 * than vice versa.) It is important not to assume that length(args) is
1418 * the same as the number of columns logically present in the rowtype.
1419 *
1420 * colnames provides field names if the ROW() result is of type RECORD.
1421 * Names *must* be provided if row_typeid is RECORDOID; but if it is a
1422 * named composite type, colnames will be ignored in favor of using the
1423 * type's cataloged field names, so colnames should be NIL. Like the
1424 * args list, colnames is defined to be one-for-one with physical fields
1425 * of the rowtype (although dropped columns shouldn't appear in the
1426 * RECORD case, so this fine point is currently moot).
1427 */
1428typedef struct RowExpr
1429{
1431 List *args; /* the fields */
1432
1433 /* RECORDOID or a composite type's ID */
1435
1436 /*
1437 * row_typeid cannot be a domain over composite, only plain composite. To
1438 * create a composite domain value, apply CoerceToDomain to the RowExpr.
1439 *
1440 * Note: we deliberately do NOT store a typmod. Although a typmod will be
1441 * associated with specific RECORD types at runtime, it will differ for
1442 * different backends, and so cannot safely be stored in stored
1443 * parsetrees. We must assume typmod -1 for a RowExpr node.
1444 *
1445 * We don't need to store a collation either. The result type is
1446 * necessarily composite, and composite types never have a collation.
1447 */
1448
1449 /* how to display this node */
1451
1452 /* list of String, or NIL */
1454
1455 ParseLoc location; /* token location, or -1 if unknown */
1457
1458/*
1459 * RowCompareExpr - row-wise comparison, such as (a, b) <= (1, 2)
1460 *
1461 * We support row comparison for any operator that can be determined to
1462 * act like =, <>, <, <=, >, or >= (we determine this by looking for the
1463 * operator in btree opfamilies). Note that the same operator name might
1464 * map to a different operator for each pair of row elements, since the
1465 * element datatypes can vary.
1466 *
1467 * A RowCompareExpr node is only generated for the < <= > >= cases;
1468 * the = and <> cases are translated to simple AND or OR combinations
1469 * of the pairwise comparisons.
1470 */
1471typedef struct RowCompareExpr
1472{
1474
1475 /* LT LE GE or GT, never EQ or NE */
1477 /* OID list of pairwise comparison ops */
1479 /* OID list of containing operator families */
1481 /* OID list of collations for comparisons */
1483 /* the left-hand input arguments */
1485 /* the right-hand input arguments */
1488
1489/*
1490 * CoalesceExpr - a COALESCE expression
1491 */
1492typedef struct CoalesceExpr
1493{
1495 /* type of expression result */
1497 /* OID of collation, or InvalidOid if none */
1499 /* the arguments */
1501 /* token location, or -1 if unknown */
1504
1505/*
1506 * MinMaxExpr - a GREATEST or LEAST function
1507 */
1513
1514typedef struct MinMaxExpr
1515{
1517 /* common type of arguments and result */
1519 /* OID of collation of result */
1521 /* OID of collation that function should use */
1523 /* function to execute */
1525 /* the arguments */
1527 /* token location, or -1 if unknown */
1530
1531/*
1532 * SQLValueFunction - parameterless functions with special grammar productions
1533 *
1534 * The SQL standard categorizes some of these as <datetime value function>
1535 * and others as <general value specification>. We call 'em SQLValueFunctions
1536 * for lack of a better term. We store type and typmod of the result so that
1537 * some code doesn't need to know each function individually, and because
1538 * we would need to store typmod anyway for some of the datetime functions.
1539 * Note that currently, all variants return non-collating datatypes, so we do
1540 * not need a collation field; also, all these functions are stable.
1541 */
1560
1561typedef struct SQLValueFunction
1562{
1564 SQLValueFunctionOp op; /* which function this is */
1565
1566 /*
1567 * Result type/typmod. Type is fully determined by "op", so no need to
1568 * include this Oid in the query jumbling.
1569 */
1572 ParseLoc location; /* token location, or -1 if unknown */
1574
1575/*
1576 * XmlExpr - various SQL/XML functions requiring special grammar productions
1577 *
1578 * 'name' carries the "NAME foo" argument (already XML-escaped).
1579 * 'named_args' and 'arg_names' represent an xml_attribute list.
1580 * 'args' carries all other arguments.
1581 *
1582 * Note: result type/typmod/collation are not stored, but can be deduced
1583 * from the XmlExprOp. The type/typmod fields are just used for display
1584 * purposes, and are NOT necessarily the true result type of the node.
1585 */
1586typedef enum XmlExprOp
1587{
1588 IS_XMLCONCAT, /* XMLCONCAT(args) */
1589 IS_XMLELEMENT, /* XMLELEMENT(name, xml_attributes, args) */
1590 IS_XMLFOREST, /* XMLFOREST(xml_attributes) */
1591 IS_XMLPARSE, /* XMLPARSE(text, is_doc, preserve_ws) */
1592 IS_XMLPI, /* XMLPI(name [, args]) */
1593 IS_XMLROOT, /* XMLROOT(xml, version, standalone) */
1594 IS_XMLSERIALIZE, /* XMLSERIALIZE(is_document, xmlval, indent) */
1595 IS_DOCUMENT, /* xmlval IS DOCUMENT */
1597
1603
1604typedef struct XmlExpr
1605{
1607 /* xml function ID */
1609 /* name in xml(NAME foo ...) syntaxes */
1611 /* non-XML expressions for xml_attributes */
1613 /* parallel list of String values */
1615 /* list of expressions */
1617 /* DOCUMENT or CONTENT */
1619 /* INDENT option for XMLSERIALIZE */
1621 /* target type/typmod for XMLSERIALIZE */
1624 /* token location, or -1 if unknown */
1627
1628/*
1629 * JsonEncoding -
1630 * representation of JSON ENCODING clause
1631 */
1639
1640/*
1641 * JsonFormatType -
1642 * enumeration of JSON formats used in JSON FORMAT clause
1643 */
1644typedef enum JsonFormatType
1645{
1646 JS_FORMAT_DEFAULT, /* unspecified */
1647 JS_FORMAT_JSON, /* FORMAT JSON [ENCODING ...] */
1648 JS_FORMAT_JSONB, /* implicit internal format for RETURNING
1649 * jsonb */
1651
1652/*
1653 * JsonFormat -
1654 * representation of JSON FORMAT clause
1655 */
1656typedef struct JsonFormat
1657{
1659 JsonFormatType format_type; /* format type */
1660 JsonEncoding encoding; /* JSON encoding */
1661 ParseLoc location; /* token location, or -1 if unknown */
1663
1664/*
1665 * JsonReturning -
1666 * transformed representation of JSON RETURNING clause
1667 */
1668typedef struct JsonReturning
1669{
1671 JsonFormat *format; /* output JSON format */
1672 Oid typid; /* target type Oid */
1673 int32 typmod; /* target type modifier */
1675
1676/*
1677 * JsonValueExpr -
1678 * representation of JSON value expression (expr [FORMAT JsonFormat])
1679 *
1680 * raw_expr is the user-specified value, while formatted_expr is the value
1681 * obtained by coercing raw_expr to the type required by either the FORMAT
1682 * clause or an enclosing node's RETURNING clause.
1683 *
1684 * When deparsing a JsonValueExpr, get_rule_expr() prints raw_expr. However,
1685 * during the evaluation of a JsonValueExpr, the value of formatted_expr
1686 * takes precedence over that of raw_expr.
1687 */
1688typedef struct JsonValueExpr
1689{
1691 Expr *raw_expr; /* user-specified expression */
1692 Expr *formatted_expr; /* coerced formatted expression */
1693 JsonFormat *format; /* FORMAT clause, if specified */
1695
1707
1708/*
1709 * JsonConstructorExpr -
1710 * wrapper over FuncExpr/Aggref/WindowFunc for SQL/JSON constructors
1711 *
1712 * func is the executable expression:
1713 * - Aggref/WindowFunc for JSON_OBJECTAGG/JSON_ARRAYAGG,
1714 * - CoalesceExpr for JSON_ARRAY_QUERY,
1715 * - NULL for other types (the executor calls the underlying json[b]_xxx()
1716 * functions directly).
1717 *
1718 * orig_query holds the user's original subquery for JSON_ARRAY(query), used
1719 * only by ruleutils.c for deparsing; it is not walked because func is
1720 * authoritative for all other purposes.
1721 */
1723{
1725 JsonConstructorType type; /* constructor type */
1727 Expr *func; /* executable expression or NULL */
1728 Expr *coercion; /* coercion to RETURNING type */
1729 JsonReturning *returning; /* RETURNING clause */
1730 Node *orig_query; /* original subquery for deparsing */
1731 bool absent_on_null; /* ABSENT ON NULL? */
1732 bool unique; /* WITH UNIQUE KEYS? (JSON_OBJECT[AGG] only) */
1735
1736/*
1737 * JsonValueType -
1738 * representation of JSON item type in IS JSON predicate
1739 */
1740typedef enum JsonValueType
1741{
1742 JS_TYPE_ANY, /* IS JSON [VALUE] */
1743 JS_TYPE_OBJECT, /* IS JSON OBJECT */
1744 JS_TYPE_ARRAY, /* IS JSON ARRAY */
1745 JS_TYPE_SCALAR, /* IS JSON SCALAR */
1747
1748/*
1749 * JsonIsPredicate -
1750 * representation of IS JSON predicate
1751 */
1752typedef struct JsonIsPredicate
1753{
1755 Node *expr; /* subject expression */
1756 JsonFormat *format; /* FORMAT clause, if specified */
1757 JsonValueType item_type; /* JSON item type */
1758 bool unique_keys; /* check key uniqueness? */
1759 Oid exprBaseType; /* base type of the subject expression */
1760 ParseLoc location; /* token location, or -1 if unknown */
1762
1763/* Nodes used in SQL/JSON query functions */
1764
1765/*
1766 * JsonWrapper -
1767 * representation of WRAPPER clause for JSON_QUERY()
1768 */
1776
1777/*
1778 * JsonBehaviorType -
1779 * enumeration of behavior types used in SQL/JSON ON ERROR/EMPTY clauses
1780 *
1781 * If enum members are reordered, get_json_behavior() from ruleutils.c
1782 * must be updated accordingly.
1783 */
1796
1797/*
1798 * JsonBehavior
1799 * Specifications for ON ERROR / ON EMPTY behaviors of SQL/JSON
1800 * query functions specified by a JsonExpr
1801 *
1802 * 'expr' is the expression to emit when a given behavior (EMPTY or ERROR)
1803 * occurs on evaluating the SQL/JSON query function. 'coerce' is set to true
1804 * if 'expr' isn't already of the expected target type given by
1805 * JsonExpr.returning.
1806 */
1807typedef struct JsonBehavior
1808{
1810
1814 ParseLoc location; /* token location, or -1 if unknown */
1816
1817/*
1818 * JsonExprOp -
1819 * enumeration of SQL/JSON query function types
1820 */
1821typedef enum JsonExprOp
1822{
1823 JSON_EXISTS_OP, /* JSON_EXISTS() */
1824 JSON_QUERY_OP, /* JSON_QUERY() */
1825 JSON_VALUE_OP, /* JSON_VALUE() */
1826 JSON_TABLE_OP, /* JSON_TABLE() */
1828
1829/*
1830 * JsonExpr -
1831 * Transformed representation of JSON_VALUE(), JSON_QUERY(), and
1832 * JSON_EXISTS()
1833 */
1834typedef struct JsonExpr
1835{
1837
1839
1840 char *column_name; /* JSON_TABLE() column name or NULL if this is
1841 * not for a JSON_TABLE() */
1842
1843 /* jsonb-valued expression to query */
1845
1846 /* Format of the above expression needed by ruleutils.c */
1848
1849 /* jsonpath-valued expression containing the query pattern */
1851
1852 /* Expected type/format of the output. */
1854
1855 /* Information about the PASSING argument expressions */
1858
1859 /* User-specified or default ON EMPTY and ON ERROR behaviors */
1862
1863 /*
1864 * Information about converting the result of jsonpath functions
1865 * JsonPathQuery() and JsonPathValue() to the RETURNING type.
1866 */
1869
1870 /* WRAPPER specification for JSON_QUERY */
1872
1873 /* KEEP or OMIT QUOTES for singleton scalars returned by JSON_QUERY() */
1875
1876 /* JsonExpr's collation. */
1878
1879 /* Original JsonFuncExpr's location */
1882
1883/*
1884 * JsonTablePath
1885 * A JSON path expression to be computed as part of evaluating
1886 * a JSON_TABLE plan node
1887 */
1895
1896/*
1897 * JsonTablePlan -
1898 * Abstract class to represent different types of JSON_TABLE "plans".
1899 * A plan is used to generate a "row pattern" value by evaluating a JSON
1900 * path expression against an input JSON document, which is then used for
1901 * populating JSON_TABLE() columns
1902 */
1909
1910/*
1911 * JSON_TABLE plan to evaluate a JSON path expression and NESTED paths, if
1912 * any.
1913 */
1914typedef struct JsonTablePathScan
1915{
1917
1918 /* JSON path to evaluate */
1920
1921 /*
1922 * ERROR/EMPTY ON ERROR behavior; only significant in the plan for the
1923 * top-level path.
1924 */
1926
1927 /* Plan(s) for nested columns, if any. */
1929
1930 /*
1931 * 0-based index in TableFunc.colvalexprs of the 1st and the last column
1932 * covered by this plan. Both are -1 if all columns are nested and thus
1933 * computed by the child plan(s).
1934 */
1938
1939/*
1940 * JsonTableSiblingJoin -
1941 * Plan to join rows of sibling NESTED COLUMNS clauses in the same parent
1942 * COLUMNS clause
1943 */
1951
1952/* ----------------
1953 * NullTest
1954 *
1955 * NullTest represents the operation of testing a value for NULLness.
1956 * The appropriate test is performed and returned as a boolean Datum.
1957 *
1958 * When argisrow is false, this simply represents a test for the null value.
1959 *
1960 * When argisrow is true, the input expression must yield a rowtype, and
1961 * the node implements "row IS [NOT] NULL" per the SQL standard. This
1962 * includes checking individual fields for NULLness when the row datum
1963 * itself isn't NULL.
1964 *
1965 * NOTE: the combination of a rowtype input and argisrow==false does NOT
1966 * correspond to the SQL notation "row IS [NOT] NULL"; instead, this case
1967 * represents the SQL notation "row IS [NOT] DISTINCT FROM NULL".
1968 * ----------------
1969 */
1970
1975
1976typedef struct NullTest
1977{
1979 Expr *arg; /* input expression */
1980 NullTestType nulltesttype; /* IS NULL, IS NOT NULL */
1981 /* T to perform field-by-field null checks */
1983 ParseLoc location; /* token location, or -1 if unknown */
1985
1986/*
1987 * BooleanTest
1988 *
1989 * BooleanTest represents the operation of determining whether a boolean
1990 * is TRUE, FALSE, or UNKNOWN (ie, NULL). All six meaningful combinations
1991 * are supported. Note that a NULL input does *not* cause a NULL result.
1992 * The appropriate test is performed and returned as a boolean Datum.
1993 */
1994
1999
2000typedef struct BooleanTest
2001{
2003 Expr *arg; /* input expression */
2005 ParseLoc location; /* token location, or -1 if unknown */
2007
2008
2009/*
2010 * MergeAction
2011 *
2012 * Transformed representation of a WHEN clause in a MERGE statement
2013 */
2014
2021
2022#define NUM_MERGE_MATCH_KINDS (MERGE_WHEN_NOT_MATCHED_BY_TARGET + 1)
2023
2024typedef struct MergeAction
2025{
2027 MergeMatchKind matchKind; /* MATCHED/NOT MATCHED BY SOURCE/TARGET */
2028 CmdType commandType; /* INSERT/UPDATE/DELETE/DO NOTHING */
2029 /* OVERRIDING clause */
2031 Node *qual; /* transformed WHEN conditions */
2032 List *targetList; /* the target list (of TargetEntry) */
2033 /* target attribute numbers of an UPDATE */
2036
2037/*
2038 * CoerceToDomain
2039 *
2040 * CoerceToDomain represents the operation of coercing a value to a domain
2041 * type. At runtime (and not before) the precise set of constraints to be
2042 * checked will be determined. If the value passes, it is returned as the
2043 * result; if not, an error is raised. Note that this is equivalent to
2044 * RelabelType in the scenario where no constraints are applied.
2045 */
2046typedef struct CoerceToDomain
2047{
2049 Expr *arg; /* input expression */
2050 Oid resulttype; /* domain type ID (result type) */
2051 /* output typmod (currently always -1) */
2053 /* OID of collation, or InvalidOid if none */
2055 /* how to display this node */
2057 ParseLoc location; /* token location, or -1 if unknown */
2059
2060/*
2061 * Placeholder node for the value to be processed by a domain's check
2062 * constraint. This is effectively like a Param, but can be implemented more
2063 * simply since we need only one replacement value at a time.
2064 *
2065 * Note: the typeId/typeMod/collation will be set from the domain's base type,
2066 * not the domain itself. This is because we shouldn't consider the value
2067 * to be a member of the domain if we haven't yet checked its constraints.
2068 */
2070{
2072 /* type for substituted value */
2074 /* typemod for substituted value */
2076 /* collation for the substituted value */
2078 /* token location, or -1 if unknown */
2081
2082/*
2083 * Placeholder node for a DEFAULT marker in an INSERT or UPDATE command.
2084 *
2085 * This is not an executable expression: it must be replaced by the actual
2086 * column default expression during rewriting. But it is convenient to
2087 * treat it as an expression node during parsing and rewriting.
2088 */
2089typedef struct SetToDefault
2090{
2092 /* type for substituted value */
2094 /* typemod for substituted value */
2096 /* collation for the substituted value */
2098 /* token location, or -1 if unknown */
2101
2102/*
2103 * Node representing [WHERE] CURRENT OF cursor_name
2104 *
2105 * CURRENT OF is a bit like a Var, in that it carries the rangetable index
2106 * of the target relation being constrained; this aids placing the expression
2107 * correctly during planning. We can assume however that its "levelsup" is
2108 * always zero, due to the syntactic constraints on where it can appear.
2109 * Also, cvarno will always be a true RT index, never INNER_VAR etc.
2110 *
2111 * The referenced cursor can be represented either as a hardwired string
2112 * or as a reference to a run-time parameter of type REFCURSOR. The latter
2113 * case is for the convenience of plpgsql.
2114 */
2115typedef struct CurrentOfExpr
2116{
2118 Index cvarno; /* RT index of target relation */
2119 char *cursor_name; /* name of referenced cursor, or NULL */
2120 int cursor_param; /* refcursor parameter number, or 0 */
2122
2123/*
2124 * NextValueExpr - get next value from sequence
2125 *
2126 * This has the same effect as calling the nextval() function, but it does not
2127 * check permissions on the sequence. This is used for identity columns,
2128 * where the sequence is an implicit dependency without its own permissions.
2129 */
2136
2137/*
2138 * InferenceElem - an element of a unique index inference specification
2139 *
2140 * This mostly matches the structure of IndexElems, but having a dedicated
2141 * primnode allows for a clean separation between the use of index parameters
2142 * by utility commands, and this node.
2143 */
2144typedef struct InferenceElem
2145{
2147 Node *expr; /* expression to infer from, or NULL */
2148 Oid infercollid; /* OID of collation, or InvalidOid */
2149 Oid inferopclass; /* OID of att opclass, or InvalidOid */
2151
2152/*
2153 * ReturningExpr - return OLD/NEW.(expression) in RETURNING list
2154 *
2155 * This is used when updating an auto-updatable view and returning a view
2156 * column that is not simply a Var referring to the base relation. In such
2157 * cases, OLD/NEW.viewcol can expand to an arbitrary expression, but the
2158 * result is required to be NULL if the OLD/NEW row doesn't exist. To handle
2159 * this, the rewriter wraps the expanded expression in a ReturningExpr, which
2160 * is equivalent to "CASE WHEN (OLD/NEW row exists) THEN (expr) ELSE NULL".
2161 *
2162 * A similar situation can arise when rewriting the RETURNING clause of a
2163 * rule, which may also contain arbitrary expressions.
2164 *
2165 * ReturningExpr nodes never appear in a parsed Query --- they are only ever
2166 * inserted by the rewriter and the planner.
2167 */
2168typedef struct ReturningExpr
2169{
2171 int retlevelsup; /* > 0 if it belongs to outer query */
2172 bool retold; /* true for OLD, false for NEW */
2173 Expr *retexpr; /* expression to be returned */
2175
2176/*
2177 * GraphLabelRef - label reference in label expression inside GRAPH_TABLE clause
2178 */
2185
2186/*
2187 * GraphPropertyRef - property reference inside GRAPH_TABLE clause
2188 */
2199
2200/*--------------------
2201 * TargetEntry -
2202 * a target entry (used in query target lists)
2203 *
2204 * Strictly speaking, a TargetEntry isn't an expression node (since it can't
2205 * be evaluated by ExecEvalExpr). But we treat it as one anyway, since in
2206 * very many places it's convenient to process a whole query targetlist as a
2207 * single expression tree.
2208 *
2209 * In a SELECT's targetlist, resno should always be equal to the item's
2210 * ordinal position (counting from 1). However, in an INSERT or UPDATE
2211 * targetlist, resno represents the attribute number of the destination
2212 * column for the item; so there may be missing or out-of-order resnos.
2213 * It is even legal to have duplicated resnos; consider
2214 * UPDATE table SET arraycol[1] = ..., arraycol[2] = ..., ...
2215 * In an INSERT, the rewriter and planner will normalize the tlist by
2216 * reordering it into physical column order and filling in default values
2217 * for any columns not assigned values by the original query. In an UPDATE,
2218 * after the rewriter merges multiple assignments for the same column, the
2219 * planner extracts the target-column numbers into a separate "update_colnos"
2220 * list, and then renumbers the tlist elements serially. Thus, tlist resnos
2221 * match ordinal position in all tlists seen by the executor; but it is wrong
2222 * to assume that before planning has happened.
2223 *
2224 * resname is required to represent the correct column name in non-resjunk
2225 * entries of top-level SELECT targetlists, since it will be used as the
2226 * column title sent to the frontend. In most other contexts it is only
2227 * a debugging aid, and may be wrong or even NULL. (In particular, it may
2228 * be wrong in a tlist from a stored rule, if the referenced column has been
2229 * renamed by ALTER TABLE since the rule was made. Also, the planner tends
2230 * to store NULL rather than look up a valid name for tlist entries in
2231 * non-toplevel plan nodes.) In resjunk entries, resname should be either
2232 * a specific system-generated name (such as "ctid") or NULL; anything else
2233 * risks confusing ExecGetJunkAttribute!
2234 *
2235 * ressortgroupref is used in the representation of ORDER BY, GROUP BY, and
2236 * DISTINCT items. Targetlist entries with ressortgroupref=0 are not
2237 * sort/group items. If ressortgroupref>0, then this item is an ORDER BY,
2238 * GROUP BY, and/or DISTINCT target value. No two entries in a targetlist
2239 * may have the same nonzero ressortgroupref --- but there is no particular
2240 * meaning to the nonzero values, except as tags. (For example, one must
2241 * not assume that lower ressortgroupref means a more significant sort key.)
2242 * The order of the associated SortGroupClause lists determine the semantics.
2243 *
2244 * resorigtbl/resorigcol identify the source of the column, if it is a
2245 * simple reference to a column of a base table (or view). If it is not
2246 * a simple reference, these fields are zeroes.
2247 *
2248 * If resjunk is true then the column is a working column (such as a sort key)
2249 * that should be removed from the final output of the query. Resjunk columns
2250 * must have resnos that cannot duplicate any regular column's resno. Also
2251 * note that there are places that assume resjunk columns come after non-junk
2252 * columns.
2253 *--------------------
2254 */
2255typedef struct TargetEntry
2256{
2258 /* expression to evaluate */
2260 /* attribute number (see notes above) */
2262 /* name of the column (could be NULL) */
2264 /* nonzero if referenced by a sort/group clause */
2266 /* OID of column's source table */
2268 /* column's number in source table */
2270 /* set to true to eliminate the attribute from final target list */
2273
2274
2275/* ----------------------------------------------------------------
2276 * node types for join trees
2277 *
2278 * The leaves of a join tree structure are RangeTblRef nodes. Above
2279 * these, JoinExpr nodes can appear to denote a specific kind of join
2280 * or qualified join. Also, FromExpr nodes can appear to denote an
2281 * ordinary cross-product join ("FROM foo, bar, baz WHERE ...").
2282 * FromExpr is like a JoinExpr of jointype JOIN_INNER, except that it
2283 * may have any number of child nodes, not just two.
2284 *
2285 * NOTE: the top level of a Query's jointree is always a FromExpr.
2286 * Even if the jointree contains no rels, there will be a FromExpr.
2287 *
2288 * NOTE: the qualification expressions present in JoinExpr nodes are
2289 * *in addition to* the query's main WHERE clause, which appears as the
2290 * qual of the top-level FromExpr. The reason for associating quals with
2291 * specific nodes in the jointree is that the position of a qual is critical
2292 * when outer joins are present. (If we enforce a qual too soon or too late,
2293 * that may cause the outer join to produce the wrong set of NULL-extended
2294 * rows.) If all joins are inner joins then all the qual positions are
2295 * semantically interchangeable.
2296 *
2297 * NOTE: in the raw output of gram.y, a join tree contains RangeVar,
2298 * RangeSubselect, and RangeFunction nodes, which are all replaced by
2299 * RangeTblRef nodes during the parse analysis phase. Also, the top-level
2300 * FromExpr is added during parse analysis; the grammar regards FROM and
2301 * WHERE as separate.
2302 * ----------------------------------------------------------------
2303 */
2304
2305/*
2306 * RangeTblRef - reference to an entry in the query's rangetable
2307 *
2308 * We could use direct pointers to the RT entries and skip having these
2309 * nodes, but multiple pointers to the same node in a querytree cause
2310 * lots of headaches, so it seems better to store an index into the RT.
2311 */
2317
2318/*----------
2319 * JoinExpr - for SQL JOIN expressions
2320 *
2321 * isNatural, usingClause, and quals are interdependent. The user can write
2322 * only one of NATURAL, USING(), or ON() (this is enforced by the grammar).
2323 * If he writes NATURAL then parse analysis generates the equivalent USING()
2324 * list, and from that fills in "quals" with the right equality comparisons.
2325 * If he writes USING() then "quals" is filled with equality comparisons.
2326 * If he writes ON() then only "quals" is set. Note that NATURAL/USING
2327 * are not equivalent to ON() since they also affect the output column list.
2328 *
2329 * alias is an Alias node representing the AS alias-clause attached to the
2330 * join expression, or NULL if no clause. NB: presence or absence of the
2331 * alias has a critical impact on semantics, because a join with an alias
2332 * restricts visibility of the tables/columns inside it.
2333 *
2334 * join_using_alias is an Alias node representing the join correlation
2335 * name that SQL:2016 and later allow to be attached to JOIN/USING.
2336 * Its column alias list includes only the common column names from USING,
2337 * and it does not restrict visibility of the join's input tables.
2338 *
2339 * During parse analysis, an RTE is created for the Join, and its index
2340 * is filled into rtindex. This RTE is present mainly so that Vars can
2341 * be created that refer to the outputs of the join. The planner sometimes
2342 * generates JoinExprs internally; these can have rtindex = 0 if there are
2343 * no join alias variables referencing such joins.
2344 *----------
2345 */
2346typedef struct JoinExpr
2347{
2349 JoinType jointype; /* type of join */
2350 bool isNatural; /* Natural join? Will need to shape table */
2351 Node *larg; /* left subtree */
2352 Node *rarg; /* right subtree */
2353 /* USING clause, if any (list of String) */
2355 /* alias attached to USING clause, if any */
2357 /* qualifiers on join, if any */
2359 /* user-written alias clause, if any */
2361 /* RT index assigned for join, or 0 */
2364
2365/*----------
2366 * FromExpr - represents a FROM ... WHERE ... construct
2367 *
2368 * This is both more flexible than a JoinExpr (it can have any number of
2369 * children, including zero) and less so --- we don't need to deal with
2370 * aliases and so on. The output column set is implicitly just the union
2371 * of the outputs of the children.
2372 *----------
2373 */
2374typedef struct FromExpr
2375{
2377 List *fromlist; /* List of join subtrees */
2378 Node *quals; /* qualifiers on join, if any */
2380
2381/*----------
2382 * OnConflictExpr - represents an ON CONFLICT DO ... expression
2383 *
2384 * The optimizer requires a list of inference elements, and optionally a WHERE
2385 * clause to infer a unique index. The unique index (or, occasionally,
2386 * indexes) inferred are used to arbitrate whether or not the alternative ON
2387 * CONFLICT path is taken.
2388 *----------
2389 */
2390typedef struct OnConflictExpr
2391{
2393 OnConflictAction action; /* DO NOTHING, SELECT, or UPDATE */
2394
2395 /* Arbiter */
2396 List *arbiterElems; /* unique index arbiter list (of
2397 * InferenceElem's) */
2398 Node *arbiterWhere; /* unique index arbiter WHERE clause */
2399 Oid constraint; /* pg_constraint OID for arbiter */
2400
2401 /* ON CONFLICT DO SELECT */
2402 LockClauseStrength lockStrength; /* strength of lock for DO SELECT */
2403
2404 /* ON CONFLICT DO UPDATE */
2405 List *onConflictSet; /* List of ON CONFLICT SET TargetEntrys */
2406
2407 /* both ON CONFLICT DO SELECT and UPDATE */
2408 Node *onConflictWhere; /* qualifiers to restrict SELECT/UPDATE */
2409 int exclRelIndex; /* RT index of 'excluded' relation */
2410 List *exclRelTlist; /* tlist of the EXCLUDED pseudo relation */
2412
2413/*----------
2414 * ForPortionOfExpr - represents a FOR PORTION OF ... expression
2415 *
2416 * We set up an expression to make a range from the FROM/TO bounds,
2417 * so that we can use range operators with it.
2418 *
2419 * Then we set up an overlaps expression between that and the range column,
2420 * so that we can find the rows we need to update/delete.
2421 *
2422 * If the user used the FROM ... TO ... syntax, we save the individual
2423 * expressions so that we can deparse them.
2424 *
2425 * In the executor we'll also build an intersect expression between the
2426 * targeted range and the range column, so that we can update the start/end
2427 * bounds of the UPDATE'd record.
2428 *----------
2429 */
2430typedef struct ForPortionOfExpr
2431{
2433 Var *rangeVar; /* Range column */
2434 char *range_name; /* Range name */
2435 Node *targetFrom; /* FOR PORTION OF FROM bound, if given */
2436 Node *targetTo; /* FOR PORTION OF TO bound, if given */
2437 Node *targetRange; /* FOR PORTION OF bounds as a range/multirange */
2438 Oid rangeType; /* (base)type of targetRange */
2439 bool isDomain; /* Is rangeVar a domain? */
2440 Node *overlapsExpr; /* range && targetRange */
2441 List *rangeTargetList; /* List of TargetEntrys to set the time
2442 * column(s) */
2443 Oid withoutPortionProc; /* SRF proc for old_range - target_range */
2444 ParseLoc location; /* token location, or -1 if unknown */
2445 ParseLoc targetLocation; /* token location, or -1 if unknown */
2447
2448#endif /* PRIMNODES_H */
int16 AttrNumber
Definition attnum.h:21
int32_t int32
Definition c.h:679
unsigned int Index
Definition c.h:757
CompareType
Definition cmptype.h:32
LockClauseStrength
Definition lockoptions.h:22
double Cost
Definition nodes.h:259
OnConflictAction
Definition nodes.h:425
CmdType
Definition nodes.h:271
NodeTag
Definition nodes.h:27
AggSplit
Definition nodes.h:383
int ParseLoc
Definition nodes.h:248
JoinType
Definition nodes.h:296
#define plan(x)
Definition pg_regress.c:164
uint64_t Datum
Definition postgres.h:70
unsigned int Oid
static int fb(int x)
BoolTestType
Definition primnodes.h:1996
@ IS_NOT_TRUE
Definition primnodes.h:1997
@ IS_NOT_FALSE
Definition primnodes.h:1997
@ IS_NOT_UNKNOWN
Definition primnodes.h:1997
@ IS_TRUE
Definition primnodes.h:1997
@ IS_UNKNOWN
Definition primnodes.h:1997
@ IS_FALSE
Definition primnodes.h:1997
SubLinkType
Definition primnodes.h:1010
@ ARRAY_SUBLINK
Definition primnodes.h:1017
@ ANY_SUBLINK
Definition primnodes.h:1013
@ MULTIEXPR_SUBLINK
Definition primnodes.h:1016
@ CTE_SUBLINK
Definition primnodes.h:1018
@ EXPR_SUBLINK
Definition primnodes.h:1015
@ ROWCOMPARE_SUBLINK
Definition primnodes.h:1014
@ ALL_SUBLINK
Definition primnodes.h:1012
@ EXISTS_SUBLINK
Definition primnodes.h:1011
JsonFormatType
Definition primnodes.h:1645
@ JS_FORMAT_JSONB
Definition primnodes.h:1648
@ JS_FORMAT_DEFAULT
Definition primnodes.h:1646
@ JS_FORMAT_JSON
Definition primnodes.h:1647
MinMaxOp
Definition primnodes.h:1509
@ IS_LEAST
Definition primnodes.h:1511
@ IS_GREATEST
Definition primnodes.h:1510
TableFuncType
Definition primnodes.h:100
@ TFT_XMLTABLE
Definition primnodes.h:101
@ TFT_JSON_TABLE
Definition primnodes.h:102
BoolExprType
Definition primnodes.h:944
@ AND_EXPR
Definition primnodes.h:945
@ OR_EXPR
Definition primnodes.h:945
@ NOT_EXPR
Definition primnodes.h:945
JsonEncoding
Definition primnodes.h:1633
@ JS_ENC_DEFAULT
Definition primnodes.h:1634
@ JS_ENC_UTF32
Definition primnodes.h:1637
@ JS_ENC_UTF8
Definition primnodes.h:1635
@ JS_ENC_UTF16
Definition primnodes.h:1636
XmlOptionType
Definition primnodes.h:1599
@ XMLOPTION_CONTENT
Definition primnodes.h:1601
@ XMLOPTION_DOCUMENT
Definition primnodes.h:1600
SQLValueFunctionOp
Definition primnodes.h:1543
@ SVFOP_CURRENT_CATALOG
Definition primnodes.h:1557
@ SVFOP_LOCALTIME_N
Definition primnodes.h:1550
@ SVFOP_CURRENT_TIMESTAMP
Definition primnodes.h:1547
@ SVFOP_LOCALTIME
Definition primnodes.h:1549
@ SVFOP_CURRENT_TIMESTAMP_N
Definition primnodes.h:1548
@ SVFOP_CURRENT_ROLE
Definition primnodes.h:1553
@ SVFOP_USER
Definition primnodes.h:1555
@ SVFOP_CURRENT_SCHEMA
Definition primnodes.h:1558
@ SVFOP_LOCALTIMESTAMP_N
Definition primnodes.h:1552
@ SVFOP_CURRENT_DATE
Definition primnodes.h:1544
@ SVFOP_CURRENT_TIME_N
Definition primnodes.h:1546
@ SVFOP_CURRENT_TIME
Definition primnodes.h:1545
@ SVFOP_LOCALTIMESTAMP
Definition primnodes.h:1551
@ SVFOP_CURRENT_USER
Definition primnodes.h:1554
@ SVFOP_SESSION_USER
Definition primnodes.h:1556
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:1770
@ JSW_UNCONDITIONAL
Definition primnodes.h:1774
@ JSW_CONDITIONAL
Definition primnodes.h:1773
@ JSW_UNSPEC
Definition primnodes.h:1771
@ JSW_NONE
Definition primnodes.h:1772
OpExpr DistinctExpr
Definition primnodes.h:869
XmlExprOp
Definition primnodes.h:1587
@ IS_DOCUMENT
Definition primnodes.h:1595
@ IS_XMLFOREST
Definition primnodes.h:1590
@ IS_XMLCONCAT
Definition primnodes.h:1588
@ IS_XMLPI
Definition primnodes.h:1592
@ IS_XMLPARSE
Definition primnodes.h:1591
@ IS_XMLSERIALIZE
Definition primnodes.h:1594
@ IS_XMLROOT
Definition primnodes.h:1593
@ IS_XMLELEMENT
Definition primnodes.h:1589
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:1785
@ JSON_BEHAVIOR_ERROR
Definition primnodes.h:1787
@ JSON_BEHAVIOR_TRUE
Definition primnodes.h:1789
@ JSON_BEHAVIOR_DEFAULT
Definition primnodes.h:1794
@ JSON_BEHAVIOR_EMPTY
Definition primnodes.h:1788
@ JSON_BEHAVIOR_FALSE
Definition primnodes.h:1790
@ JSON_BEHAVIOR_NULL
Definition primnodes.h:1786
@ JSON_BEHAVIOR_EMPTY_OBJECT
Definition primnodes.h:1793
@ JSON_BEHAVIOR_UNKNOWN
Definition primnodes.h:1791
@ JSON_BEHAVIOR_EMPTY_ARRAY
Definition primnodes.h:1792
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:1822
@ JSON_QUERY_OP
Definition primnodes.h:1824
@ JSON_TABLE_OP
Definition primnodes.h:1826
@ JSON_EXISTS_OP
Definition primnodes.h:1823
@ JSON_VALUE_OP
Definition primnodes.h:1825
CoercionForm
Definition primnodes.h:756
@ COERCE_SQL_SYNTAX
Definition primnodes.h:760
@ COERCE_IMPLICIT_CAST
Definition primnodes.h:759
@ COERCE_EXPLICIT_CAST
Definition primnodes.h:758
@ COERCE_EXPLICIT_CALL
Definition primnodes.h:757
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:1972
@ IS_NULL
Definition primnodes.h:1973
@ IS_NOT_NULL
Definition primnodes.h:1973
JsonValueType
Definition primnodes.h:1741
@ JS_TYPE_ANY
Definition primnodes.h:1742
@ JS_TYPE_ARRAY
Definition primnodes.h:1744
@ JS_TYPE_OBJECT
Definition primnodes.h:1743
@ JS_TYPE_SCALAR
Definition primnodes.h:1745
MergeMatchKind
Definition primnodes.h:2016
@ MERGE_WHEN_NOT_MATCHED_BY_TARGET
Definition primnodes.h:2019
@ MERGE_WHEN_NOT_MATCHED_BY_SOURCE
Definition primnodes.h:2018
@ MERGE_WHEN_MATCHED
Definition primnodes.h:2017
CoercionContext
Definition primnodes.h:736
@ COERCION_PLPGSQL
Definition primnodes.h:739
@ COERCION_ASSIGNMENT
Definition primnodes.h:738
@ COERCION_EXPLICIT
Definition primnodes.h:740
@ COERCION_IMPLICIT
Definition primnodes.h:737
JsonConstructorType
Definition primnodes.h:1697
@ JSCTOR_JSON_SERIALIZE
Definition primnodes.h:1705
@ JSCTOR_JSON_ARRAYAGG
Definition primnodes.h:1702
@ JSCTOR_JSON_PARSE
Definition primnodes.h:1703
@ JSCTOR_JSON_OBJECT
Definition primnodes.h:1698
@ JSCTOR_JSON_SCALAR
Definition primnodes.h:1704
@ JSCTOR_JSON_ARRAY_QUERY
Definition primnodes.h:1700
@ JSCTOR_JSON_ARRAY
Definition primnodes.h:1699
@ JSCTOR_JSON_OBJECTAGG
Definition primnodes.h:1701
OpExpr NullIfExpr
Definition primnodes.h:877
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:461
Expr xpr
Definition primnodes.h:458
List * aggdistinct
Definition primnodes.h:491
AggSplit aggsplit pg_node_attr(query_jumble_ignore)
List * aggdirectargs
Definition primnodes.h:482
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:485
Expr * aggfilter
Definition primnodes.h:494
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:524
List * aggorder
Definition primnodes.h:488
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:1258
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:1404
ParseLoc list_start
Definition primnodes.h:1400
Oid array_collid pg_node_attr(query_jumble_ignore)
List *elements pg_node_attr(query_jumble_squash)
ParseLoc list_end
Definition primnodes.h:1402
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:953
List * args
Definition primnodes.h:954
ParseLoc location
Definition primnodes.h:955
ParseLoc location
Definition primnodes.h:2005
BoolTestType booltesttype
Definition primnodes.h:2004
Expr * arg
Definition primnodes.h:1329
Oid casecollid pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:1332
Oid casetype pg_node_attr(query_jumble_ignore)
Expr * defresult
Definition primnodes.h:1331
List * args
Definition primnodes.h:1330
int32 typeMod pg_node_attr(query_jumble_ignore)
Oid collation pg_node_attr(query_jumble_ignore)
Expr * result
Definition primnodes.h:1342
Expr * expr
Definition primnodes.h:1341
ParseLoc location
Definition primnodes.h:1343
Oid coalescetype pg_node_attr(query_jumble_ignore)
Oid coalescecollid pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:1502
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:2057
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:1230
Oid resultcollid pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:1297
ParseLoc location pg_node_attr(query_jumble_location)
Oid consttype
Definition primnodes.h:333
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:2119
pg_node_attr(abstract) NodeTag type
int32 resulttypmod pg_node_attr(query_jumble_ignore)
AttrNumber fieldnum
Definition primnodes.h:1145
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:1176
Expr * arg
Definition primnodes.h:1175
ParseLoc targetLocation
Definition primnodes.h:2445
List * rangeTargetList
Definition primnodes.h:2441
ParseLoc location
Definition primnodes.h:2444
Node * quals
Definition primnodes.h:2378
NodeTag type
Definition primnodes.h:2376
List * fromlist
Definition primnodes.h:2377
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:768
bool funcretset pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:790
Oid funcid
Definition primnodes.h:770
List * args
Definition primnodes.h:788
CoercionForm funcformat pg_node_attr(query_jumble_ignore)
Oid funcresulttype pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:2183
ParseLoc location
Definition primnodes.h:2197
const char * elvarname
Definition primnodes.h:2192
List *cols pg_node_attr(equal_ignore, query_jumble_ignore)
List *args pg_node_attr(query_jumble_ignore)
Index agglevelsup
Definition primnodes.h:565
List *refs pg_node_attr(equal_ignore)
ParseLoc location
Definition primnodes.h:568
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:2358
JoinType jointype
Definition primnodes.h:2349
Alias *join_using_alias pg_node_attr(query_jumble_ignore)
int rtindex
Definition primnodes.h:2362
Alias *alias pg_node_attr(query_jumble_ignore)
Node * larg
Definition primnodes.h:2351
bool isNatural
Definition primnodes.h:2350
NodeTag type
Definition primnodes.h:2348
Node * rarg
Definition primnodes.h:2352
List *usingClause pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:1814
JsonBehaviorType btype
Definition primnodes.h:1811
NodeTag type
Definition primnodes.h:1809
JsonReturning * returning
Definition primnodes.h:1729
JsonConstructorType type
Definition primnodes.h:1725
char * column_name
Definition primnodes.h:1840
Node * formatted_expr
Definition primnodes.h:1844
ParseLoc location
Definition primnodes.h:1880
List * passing_values
Definition primnodes.h:1857
JsonBehavior * on_empty
Definition primnodes.h:1860
JsonFormat * format
Definition primnodes.h:1847
List * passing_names
Definition primnodes.h:1856
Node * path_spec
Definition primnodes.h:1850
bool use_io_coercion
Definition primnodes.h:1867
Oid collation
Definition primnodes.h:1877
JsonReturning * returning
Definition primnodes.h:1853
bool use_json_coercion
Definition primnodes.h:1868
JsonWrapper wrapper
Definition primnodes.h:1871
JsonExprOp op
Definition primnodes.h:1838
JsonBehavior * on_error
Definition primnodes.h:1861
bool omit_quotes
Definition primnodes.h:1874
ParseLoc location
Definition primnodes.h:1661
NodeTag type
Definition primnodes.h:1658
JsonEncoding encoding
Definition primnodes.h:1660
JsonFormatType format_type
Definition primnodes.h:1659
JsonFormat * format
Definition primnodes.h:1756
JsonValueType item_type
Definition primnodes.h:1757
ParseLoc location
Definition primnodes.h:1760
JsonFormat * format
Definition primnodes.h:1671
JsonTablePath * path
Definition primnodes.h:1919
JsonTablePlan * child
Definition primnodes.h:1928
JsonTablePlan plan
Definition primnodes.h:1916
Const * value
Definition primnodes.h:1892
pg_node_attr(abstract) NodeTag type
JsonTablePlan * rplan
Definition primnodes.h:1949
JsonTablePlan * lplan
Definition primnodes.h:1948
JsonTablePlan plan
Definition primnodes.h:1946
Expr * formatted_expr
Definition primnodes.h:1692
JsonFormat * format
Definition primnodes.h:1693
Expr * raw_expr
Definition primnodes.h:1691
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:2026
Node * qual
Definition primnodes.h:2031
CmdType commandType
Definition primnodes.h:2028
List * targetList
Definition primnodes.h:2032
MergeMatchKind matchKind
Definition primnodes.h:2027
ParseLoc location
Definition primnodes.h:661
List * args
Definition primnodes.h:1526
Oid minmaxcollid pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:1528
Oid inputcollid pg_node_attr(query_jumble_ignore)
Oid minmaxtype pg_node_attr(query_jumble_ignore)
MinMaxOp op
Definition primnodes.h:1524
char *name pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:817
Definition nodes.h:133
NullTestType nulltesttype
Definition primnodes.h:1980
bool argisrow pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition primnodes.h:1983
Expr * arg
Definition primnodes.h:1979
List * arbiterElems
Definition primnodes.h:2396
OnConflictAction action
Definition primnodes.h:2393
LockClauseStrength lockStrength
Definition primnodes.h:2402
List * onConflictSet
Definition primnodes.h:2405
List * exclRelTlist
Definition primnodes.h:2410
Node * onConflictWhere
Definition primnodes.h:2408
Node * arbiterWhere
Definition primnodes.h:2398
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:835
List * args
Definition primnodes.h:853
ParseLoc location
Definition primnodes.h:856
Expr xpr
Definition primnodes.h:832
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:2314
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:1208
List *opnos pg_node_attr(query_jumble_ignore)
CompareType cmptype
Definition primnodes.h:1476
List *inputcollids pg_node_attr(query_jumble_ignore)
List *opfamilies pg_node_attr(query_jumble_ignore)
Expr xpr
Definition primnodes.h:1430
CoercionForm row_format pg_node_attr(query_jumble_ignore)
List * args
Definition primnodes.h:1431
ParseLoc location
Definition primnodes.h:1455
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:1572
SQLValueFunctionOp op
Definition primnodes.h:1564
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:933
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:2099
int plan_id
Definition primnodes.h:1084
int disabled_nodes
Definition primnodes.h:1108
char * plan_name
Definition primnodes.h:1086
List * args
Definition primnodes.h:1106
List * paramIds
Definition primnodes.h:1082
bool isInitPlan
Definition primnodes.h:1093
bool useHashTable
Definition primnodes.h:1094
Node * testexpr
Definition primnodes.h:1081
int32 firstColTypmod
Definition primnodes.h:1089
pg_node_attr(no_query_jumble) Expr xpr
List * parParam
Definition primnodes.h:1105
bool parallel_safe
Definition primnodes.h:1099
List * setParam
Definition primnodes.h:1103
bool unknownEqFalse
Definition primnodes.h:1096
Cost startup_cost
Definition primnodes.h:1109
Oid firstColCollation
Definition primnodes.h:1090
Cost per_call_cost
Definition primnodes.h:1110
SubLinkType subLinkType
Definition primnodes.h:1079
Oid firstColType
Definition primnodes.h:1088
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:726
List * refupperindexpr
Definition primnodes.h:716
List * reflowerindexpr
Definition primnodes.h:722
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:2259
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:2261
Index ressortgroupref
Definition primnodes.h:2265
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:598
Index winref
Definition primnodes.h:604
bool winagg pg_node_attr(query_jumble_ignore)
Oid inputcollid pg_node_attr(query_jumble_ignore)
Expr * aggfilter
Definition primnodes.h:600
ParseLoc location
Definition primnodes.h:612
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:610
bool winstar pg_node_attr(query_jumble_ignore)
int32 typmod pg_node_attr(query_jumble_ignore)
List * args
Definition primnodes.h:1616
Expr xpr
Definition primnodes.h:1606
ParseLoc location
Definition primnodes.h:1625
bool indent
Definition primnodes.h:1620
char *name pg_node_attr(query_jumble_ignore)
XmlOptionType xmloption pg_node_attr(query_jumble_ignore)
List * named_args
Definition primnodes.h:1612
XmlExprOp op
Definition primnodes.h:1608
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