PostgreSQL Source Code  git master
parsenodes.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * parsenodes.h
4  * definitions for parse tree nodes
5  *
6  * Many of the node types used in parsetrees include a "location" field.
7  * This is a byte (not character) offset in the original source text, to be
8  * used for positioning an error cursor when there is an error related to
9  * the node. Access to the original source text is needed to make use of
10  * the location. At the topmost (statement) level, we also provide a
11  * statement length, likewise measured in bytes, for convenience in
12  * identifying statement boundaries in multi-statement source strings.
13  *
14  *
15  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
16  * Portions Copyright (c) 1994, Regents of the University of California
17  *
18  * src/include/nodes/parsenodes.h
19  *
20  *-------------------------------------------------------------------------
21  */
22 #ifndef PARSENODES_H
23 #define PARSENODES_H
24 
25 #include "common/relpath.h"
26 #include "nodes/bitmapset.h"
27 #include "nodes/lockoptions.h"
28 #include "nodes/primnodes.h"
29 #include "nodes/value.h"
30 #include "partitioning/partdefs.h"
31 
32 
33 /* Possible sources of a Query */
34 typedef enum QuerySource
35 {
36  QSRC_ORIGINAL, /* original parsetree (explicit query) */
37  QSRC_PARSER, /* added by parse analysis (now unused) */
38  QSRC_INSTEAD_RULE, /* added by unconditional INSTEAD rule */
39  QSRC_QUAL_INSTEAD_RULE, /* added by conditional INSTEAD rule */
40  QSRC_NON_INSTEAD_RULE, /* added by non-INSTEAD rule */
42 
43 /* Sort ordering options for ORDER BY and CREATE INDEX */
44 typedef enum SortByDir
45 {
49  SORTBY_USING, /* not allowed in CREATE INDEX ... */
51 
52 typedef enum SortByNulls
53 {
58 
59 /* Options for [ ALL | DISTINCT ] */
60 typedef enum SetQuantifier
61 {
66 
67 /*
68  * Grantable rights are encoded so that we can OR them together in a bitmask.
69  * The present representation of AclItem limits us to 32 distinct rights,
70  * even though AclMode is defined as uint64. See utils/acl.h.
71  *
72  * Caution: changing these codes breaks stored ACLs, hence forces initdb.
73  */
74 typedef uint64 AclMode; /* a bitmask of privilege bits */
75 
76 #define ACL_INSERT (1<<0) /* for relations */
77 #define ACL_SELECT (1<<1)
78 #define ACL_UPDATE (1<<2)
79 #define ACL_DELETE (1<<3)
80 #define ACL_TRUNCATE (1<<4)
81 #define ACL_REFERENCES (1<<5)
82 #define ACL_TRIGGER (1<<6)
83 #define ACL_EXECUTE (1<<7) /* for functions */
84 #define ACL_USAGE (1<<8) /* for various object types */
85 #define ACL_CREATE (1<<9) /* for namespaces and databases */
86 #define ACL_CREATE_TEMP (1<<10) /* for databases */
87 #define ACL_CONNECT (1<<11) /* for databases */
88 #define ACL_SET (1<<12) /* for configuration parameters */
89 #define ACL_ALTER_SYSTEM (1<<13) /* for configuration parameters */
90 #define ACL_MAINTAIN (1<<14) /* for relations */
91 #define N_ACL_RIGHTS 15 /* 1 plus the last 1<<x */
92 #define ACL_NO_RIGHTS 0
93 /* Currently, SELECT ... FOR [KEY] UPDATE/SHARE requires UPDATE privileges */
94 #define ACL_SELECT_FOR_UPDATE ACL_UPDATE
95 
96 
97 /*****************************************************************************
98  * Query Tree
99  *****************************************************************************/
100 
101 /*
102  * Query -
103  * Parse analysis turns all statements into a Query tree
104  * for further processing by the rewriter and planner.
105  *
106  * Utility statements (i.e. non-optimizable statements) have the
107  * utilityStmt field set, and the rest of the Query is mostly dummy.
108  *
109  * Planning converts a Query tree into a Plan tree headed by a PlannedStmt
110  * node --- the Query structure is not used by the executor.
111  *
112  * All the fields ignored for the query jumbling are not semantically
113  * significant (such as alias names), as is ignored anything that can
114  * be deduced from child nodes (else we'd just be double-hashing that
115  * piece of information).
116  */
117 typedef struct Query
118 {
120 
121  CmdType commandType; /* select|insert|update|delete|merge|utility */
122 
123  /* where did I come from? */
124  QuerySource querySource pg_node_attr(query_jumble_ignore);
125 
126  /*
127  * query identifier (can be set by plugins); ignored for equal, as it
128  * might not be set; also not stored. This is the result of the query
129  * jumble, hence ignored.
130  */
131  uint64 queryId pg_node_attr(equal_ignore, query_jumble_ignore, read_write_ignore, read_as(0));
132 
133  /* do I set the command result tag? */
134  bool canSetTag pg_node_attr(query_jumble_ignore);
135 
136  Node *utilityStmt; /* non-null if commandType == CMD_UTILITY */
137 
138  /*
139  * rtable index of target relation for INSERT/UPDATE/DELETE/MERGE; 0 for
140  * SELECT. This is ignored in the query jumble as unrelated to the
141  * compilation of the query ID.
142  */
143  int resultRelation pg_node_attr(query_jumble_ignore);
144 
145  /* has aggregates in tlist or havingQual */
146  bool hasAggs pg_node_attr(query_jumble_ignore);
147  /* has window functions in tlist */
148  bool hasWindowFuncs pg_node_attr(query_jumble_ignore);
149  /* has set-returning functions in tlist */
150  bool hasTargetSRFs pg_node_attr(query_jumble_ignore);
151  /* has subquery SubLink */
152  bool hasSubLinks pg_node_attr(query_jumble_ignore);
153  /* distinctClause is from DISTINCT ON */
154  bool hasDistinctOn pg_node_attr(query_jumble_ignore);
155  /* WITH RECURSIVE was specified */
156  bool hasRecursive pg_node_attr(query_jumble_ignore);
157  /* has INSERT/UPDATE/DELETE in WITH */
158  bool hasModifyingCTE pg_node_attr(query_jumble_ignore);
159  /* FOR [KEY] UPDATE/SHARE was specified */
160  bool hasForUpdate pg_node_attr(query_jumble_ignore);
161  /* rewriter has applied some RLS policy */
162  bool hasRowSecurity pg_node_attr(query_jumble_ignore);
163  /* is a RETURN statement */
164  bool isReturn pg_node_attr(query_jumble_ignore);
165 
166  List *cteList; /* WITH list (of CommonTableExpr's) */
167 
168  List *rtable; /* list of range table entries */
169 
170  /*
171  * list of RTEPermissionInfo nodes for the rtable entries having
172  * perminfoindex > 0
173  */
174  List *rteperminfos pg_node_attr(query_jumble_ignore);
175  FromExpr *jointree; /* table join tree (FROM and WHERE clauses);
176  * also USING clause for MERGE */
177 
178  List *mergeActionList; /* list of actions for MERGE (only) */
179 
180  /*
181  * rtable index of target relation for MERGE to pull data. Initially, this
182  * is the same as resultRelation, but after query rewriting, if the target
183  * relation is a trigger-updatable view, this is the index of the expanded
184  * view subquery, whereas resultRelation is the index of the target view.
185  */
186  int mergeTargetRelation pg_node_attr(query_jumble_ignore);
187 
188  /* join condition between source and target for MERGE */
190 
191  List *targetList; /* target list (of TargetEntry) */
192 
193  /* OVERRIDING clause */
194  OverridingKind override pg_node_attr(query_jumble_ignore);
195 
196  OnConflictExpr *onConflict; /* ON CONFLICT DO [NOTHING | UPDATE] */
197 
198  List *returningList; /* return-values list (of TargetEntry) */
199 
200  List *groupClause; /* a list of SortGroupClause's */
201  bool groupDistinct; /* is the group by clause distinct? */
202 
203  List *groupingSets; /* a list of GroupingSet's if present */
204 
205  Node *havingQual; /* qualifications applied to groups */
206 
207  List *windowClause; /* a list of WindowClause's */
208 
209  List *distinctClause; /* a list of SortGroupClause's */
210 
211  List *sortClause; /* a list of SortGroupClause's */
212 
213  Node *limitOffset; /* # of result tuples to skip (int8 expr) */
214  Node *limitCount; /* # of result tuples to return (int8 expr) */
215  LimitOption limitOption; /* limit type */
216 
217  List *rowMarks; /* a list of RowMarkClause's */
218 
219  Node *setOperations; /* set-operation tree if this is top level of
220  * a UNION/INTERSECT/EXCEPT query */
221 
222  /*
223  * A list of pg_constraint OIDs that the query depends on to be
224  * semantically valid
225  */
226  List *constraintDeps pg_node_attr(query_jumble_ignore);
227 
228  /* a list of WithCheckOption's (added during rewrite) */
229  List *withCheckOptions pg_node_attr(query_jumble_ignore);
230 
231  /*
232  * The following two fields identify the portion of the source text string
233  * containing this query. They are typically only populated in top-level
234  * Queries, not in sub-queries. When not set, they might both be zero, or
235  * both be -1 meaning "unknown".
236  */
237  /* start location, or -1 if unknown */
239  /* length in bytes; 0 means "rest of string" */
240  ParseLoc stmt_len pg_node_attr(query_jumble_ignore);
242 
243 
244 /****************************************************************************
245  * Supporting data structures for Parse Trees
246  *
247  * Most of these node types appear in raw parsetrees output by the grammar,
248  * and get transformed to something else by the analyzer. A few of them
249  * are used as-is in transformed querytrees.
250  ****************************************************************************/
251 
252 /*
253  * TypeName - specifies a type in definitions
254  *
255  * For TypeName structures generated internally, it is often easier to
256  * specify the type by OID than by name. If "names" is NIL then the
257  * actual type OID is given by typeOid, otherwise typeOid is unused.
258  * Similarly, if "typmods" is NIL then the actual typmod is expected to
259  * be prespecified in typemod, otherwise typemod is unused.
260  *
261  * If pct_type is true, then names is actually a field name and we look up
262  * the type of that field. Otherwise (the normal case), names is a type
263  * name possibly qualified with schema and database name.
264  */
265 typedef struct TypeName
266 {
268  List *names; /* qualified name (list of String nodes) */
269  Oid typeOid; /* type identified by OID */
270  bool setof; /* is a set? */
271  bool pct_type; /* %TYPE specified? */
272  List *typmods; /* type modifier expression(s) */
273  int32 typemod; /* prespecified type modifier */
274  List *arrayBounds; /* array bounds */
275  ParseLoc location; /* token location, or -1 if unknown */
277 
278 /*
279  * ColumnRef - specifies a reference to a column, or possibly a whole tuple
280  *
281  * The "fields" list must be nonempty. It can contain String nodes
282  * (representing names) and A_Star nodes (representing occurrence of a '*').
283  * Currently, A_Star must appear only as the last list element --- the grammar
284  * is responsible for enforcing this!
285  *
286  * Note: any container subscripting or selection of fields from composite columns
287  * is represented by an A_Indirection node above the ColumnRef. However,
288  * for simplicity in the normal case, initial field selection from a table
289  * name is represented within ColumnRef and not by adding A_Indirection.
290  */
291 typedef struct ColumnRef
292 {
294  List *fields; /* field names (String nodes) or A_Star */
295  ParseLoc location; /* token location, or -1 if unknown */
297 
298 /*
299  * ParamRef - specifies a $n parameter reference
300  */
301 typedef struct ParamRef
302 {
304  int number; /* the number of the parameter */
305  ParseLoc location; /* token location, or -1 if unknown */
307 
308 /*
309  * A_Expr - infix, prefix, and postfix expressions
310  */
311 typedef enum A_Expr_Kind
312 {
313  AEXPR_OP, /* normal operator */
314  AEXPR_OP_ANY, /* scalar op ANY (array) */
315  AEXPR_OP_ALL, /* scalar op ALL (array) */
316  AEXPR_DISTINCT, /* IS DISTINCT FROM - name must be "=" */
317  AEXPR_NOT_DISTINCT, /* IS NOT DISTINCT FROM - name must be "=" */
318  AEXPR_NULLIF, /* NULLIF - name must be "=" */
319  AEXPR_IN, /* [NOT] IN - name must be "=" or "<>" */
320  AEXPR_LIKE, /* [NOT] LIKE - name must be "~~" or "!~~" */
321  AEXPR_ILIKE, /* [NOT] ILIKE - name must be "~~*" or "!~~*" */
322  AEXPR_SIMILAR, /* [NOT] SIMILAR - name must be "~" or "!~" */
323  AEXPR_BETWEEN, /* name must be "BETWEEN" */
324  AEXPR_NOT_BETWEEN, /* name must be "NOT BETWEEN" */
325  AEXPR_BETWEEN_SYM, /* name must be "BETWEEN SYMMETRIC" */
326  AEXPR_NOT_BETWEEN_SYM, /* name must be "NOT BETWEEN SYMMETRIC" */
328 
329 typedef struct A_Expr
330 {
331  pg_node_attr(custom_read_write)
332 
333  NodeTag type;
334  A_Expr_Kind kind; /* see above */
335  List *name; /* possibly-qualified name of operator */
336  Node *lexpr; /* left argument, or NULL if none */
337  Node *rexpr; /* right argument, or NULL if none */
338  ParseLoc location; /* token location, or -1 if unknown */
340 
341 /*
342  * A_Const - a literal constant
343  *
344  * Value nodes are inline for performance. You can treat 'val' as a node,
345  * as in IsA(&val, Integer). 'val' is not valid if isnull is true.
346  */
347 union ValUnion
348 {
355 };
356 
357 typedef struct A_Const
358 {
359  pg_node_attr(custom_copy_equal, custom_read_write, custom_query_jumble)
360 
361  NodeTag type;
362  union ValUnion val;
363  bool isnull; /* SQL NULL constant */
364  ParseLoc location; /* token location, or -1 if unknown */
366 
367 /*
368  * TypeCast - a CAST expression
369  */
370 typedef struct TypeCast
371 {
373  Node *arg; /* the expression being casted */
374  TypeName *typeName; /* the target type */
375  ParseLoc location; /* token location, or -1 if unknown */
377 
378 /*
379  * CollateClause - a COLLATE expression
380  */
381 typedef struct CollateClause
382 {
384  Node *arg; /* input expression */
385  List *collname; /* possibly-qualified collation name */
386  ParseLoc location; /* token location, or -1 if unknown */
388 
389 /*
390  * RoleSpec - a role name or one of a few special values.
391  */
392 typedef enum RoleSpecType
393 {
394  ROLESPEC_CSTRING, /* role name is stored as a C string */
395  ROLESPEC_CURRENT_ROLE, /* role spec is CURRENT_ROLE */
396  ROLESPEC_CURRENT_USER, /* role spec is CURRENT_USER */
397  ROLESPEC_SESSION_USER, /* role spec is SESSION_USER */
398  ROLESPEC_PUBLIC, /* role name is "public" */
400 
401 typedef struct RoleSpec
402 {
404  RoleSpecType roletype; /* Type of this rolespec */
405  char *rolename; /* filled only for ROLESPEC_CSTRING */
406  ParseLoc location; /* token location, or -1 if unknown */
408 
409 /*
410  * FuncCall - a function or aggregate invocation
411  *
412  * agg_order (if not NIL) indicates we saw 'foo(... ORDER BY ...)', or if
413  * agg_within_group is true, it was 'foo(...) WITHIN GROUP (ORDER BY ...)'.
414  * agg_star indicates we saw a 'foo(*)' construct, while agg_distinct
415  * indicates we saw 'foo(DISTINCT ...)'. In any of these cases, the
416  * construct *must* be an aggregate call. Otherwise, it might be either an
417  * aggregate or some other kind of function. However, if FILTER or OVER is
418  * present it had better be an aggregate or window function.
419  *
420  * Normally, you'd initialize this via makeFuncCall() and then only change the
421  * parts of the struct its defaults don't match afterwards, as needed.
422  */
423 typedef struct FuncCall
424 {
426  List *funcname; /* qualified name of function */
427  List *args; /* the arguments (list of exprs) */
428  List *agg_order; /* ORDER BY (list of SortBy) */
429  Node *agg_filter; /* FILTER clause, if any */
430  struct WindowDef *over; /* OVER clause, if any */
431  bool agg_within_group; /* ORDER BY appeared in WITHIN GROUP */
432  bool agg_star; /* argument was really '*' */
433  bool agg_distinct; /* arguments were labeled DISTINCT */
434  bool func_variadic; /* last argument was labeled VARIADIC */
435  CoercionForm funcformat; /* how to display this node */
436  ParseLoc location; /* token location, or -1 if unknown */
438 
439 /*
440  * A_Star - '*' representing all columns of a table or compound field
441  *
442  * This can appear within ColumnRef.fields, A_Indirection.indirection, and
443  * ResTarget.indirection lists.
444  */
445 typedef struct A_Star
446 {
449 
450 /*
451  * A_Indices - array subscript or slice bounds ([idx] or [lidx:uidx])
452  *
453  * In slice case, either or both of lidx and uidx can be NULL (omitted).
454  * In non-slice case, uidx holds the single subscript and lidx is always NULL.
455  */
456 typedef struct A_Indices
457 {
459  bool is_slice; /* true if slice (i.e., colon present) */
460  Node *lidx; /* slice lower bound, if any */
461  Node *uidx; /* subscript, or slice upper bound if any */
463 
464 /*
465  * A_Indirection - select a field and/or array element from an expression
466  *
467  * The indirection list can contain A_Indices nodes (representing
468  * subscripting), String nodes (representing field selection --- the
469  * string value is the name of the field to select), and A_Star nodes
470  * (representing selection of all fields of a composite type).
471  * For example, a complex selection operation like
472  * (foo).field1[42][7].field2
473  * would be represented with a single A_Indirection node having a 4-element
474  * indirection list.
475  *
476  * Currently, A_Star must appear only as the last list element --- the grammar
477  * is responsible for enforcing this!
478  */
479 typedef struct A_Indirection
480 {
482  Node *arg; /* the thing being selected from */
483  List *indirection; /* subscripts and/or field names and/or * */
485 
486 /*
487  * A_ArrayExpr - an ARRAY[] construct
488  */
489 typedef struct A_ArrayExpr
490 {
492  List *elements; /* array element expressions */
493  ParseLoc location; /* token location, or -1 if unknown */
495 
496 /*
497  * ResTarget -
498  * result target (used in target list of pre-transformed parse trees)
499  *
500  * In a SELECT target list, 'name' is the column label from an
501  * 'AS ColumnLabel' clause, or NULL if there was none, and 'val' is the
502  * value expression itself. The 'indirection' field is not used.
503  *
504  * INSERT uses ResTarget in its target-column-names list. Here, 'name' is
505  * the name of the destination column, 'indirection' stores any subscripts
506  * attached to the destination, and 'val' is not used.
507  *
508  * In an UPDATE target list, 'name' is the name of the destination column,
509  * 'indirection' stores any subscripts attached to the destination, and
510  * 'val' is the expression to assign.
511  *
512  * See A_Indirection for more info about what can appear in 'indirection'.
513  */
514 typedef struct ResTarget
515 {
517  char *name; /* column name or NULL */
518  List *indirection; /* subscripts, field names, and '*', or NIL */
519  Node *val; /* the value expression to compute or assign */
520  ParseLoc location; /* token location, or -1 if unknown */
522 
523 /*
524  * MultiAssignRef - element of a row source expression for UPDATE
525  *
526  * In an UPDATE target list, when we have SET (a,b,c) = row-valued-expression,
527  * we generate separate ResTarget items for each of a,b,c. Their "val" trees
528  * are MultiAssignRef nodes numbered 1..n, linking to a common copy of the
529  * row-valued-expression (which parse analysis will process only once, when
530  * handling the MultiAssignRef with colno=1).
531  */
532 typedef struct MultiAssignRef
533 {
535  Node *source; /* the row-valued expression */
536  int colno; /* column number for this target (1..n) */
537  int ncolumns; /* number of targets in the construct */
539 
540 /*
541  * SortBy - for ORDER BY clause
542  */
543 typedef struct SortBy
544 {
546  Node *node; /* expression to sort on */
547  SortByDir sortby_dir; /* ASC/DESC/USING/default */
548  SortByNulls sortby_nulls; /* NULLS FIRST/LAST */
549  List *useOp; /* name of op to use, if SORTBY_USING */
550  ParseLoc location; /* operator location, or -1 if none/unknown */
552 
553 /*
554  * WindowDef - raw representation of WINDOW and OVER clauses
555  *
556  * For entries in a WINDOW list, "name" is the window name being defined.
557  * For OVER clauses, we use "name" for the "OVER window" syntax, or "refname"
558  * for the "OVER (window)" syntax, which is subtly different --- the latter
559  * implies overriding the window frame clause.
560  */
561 typedef struct WindowDef
562 {
564  char *name; /* window's own name */
565  char *refname; /* referenced window name, if any */
566  List *partitionClause; /* PARTITION BY expression list */
567  List *orderClause; /* ORDER BY (list of SortBy) */
568  int frameOptions; /* frame_clause options, see below */
569  Node *startOffset; /* expression for starting bound, if any */
570  Node *endOffset; /* expression for ending bound, if any */
571  ParseLoc location; /* parse location, or -1 if none/unknown */
573 
574 /*
575  * frameOptions is an OR of these bits. The NONDEFAULT and BETWEEN bits are
576  * used so that ruleutils.c can tell which properties were specified and
577  * which were defaulted; the correct behavioral bits must be set either way.
578  * The START_foo and END_foo options must come in pairs of adjacent bits for
579  * the convenience of gram.y, even though some of them are useless/invalid.
580  */
581 #define FRAMEOPTION_NONDEFAULT 0x00001 /* any specified? */
582 #define FRAMEOPTION_RANGE 0x00002 /* RANGE behavior */
583 #define FRAMEOPTION_ROWS 0x00004 /* ROWS behavior */
584 #define FRAMEOPTION_GROUPS 0x00008 /* GROUPS behavior */
585 #define FRAMEOPTION_BETWEEN 0x00010 /* BETWEEN given? */
586 #define FRAMEOPTION_START_UNBOUNDED_PRECEDING 0x00020 /* start is U. P. */
587 #define FRAMEOPTION_END_UNBOUNDED_PRECEDING 0x00040 /* (disallowed) */
588 #define FRAMEOPTION_START_UNBOUNDED_FOLLOWING 0x00080 /* (disallowed) */
589 #define FRAMEOPTION_END_UNBOUNDED_FOLLOWING 0x00100 /* end is U. F. */
590 #define FRAMEOPTION_START_CURRENT_ROW 0x00200 /* start is C. R. */
591 #define FRAMEOPTION_END_CURRENT_ROW 0x00400 /* end is C. R. */
592 #define FRAMEOPTION_START_OFFSET_PRECEDING 0x00800 /* start is O. P. */
593 #define FRAMEOPTION_END_OFFSET_PRECEDING 0x01000 /* end is O. P. */
594 #define FRAMEOPTION_START_OFFSET_FOLLOWING 0x02000 /* start is O. F. */
595 #define FRAMEOPTION_END_OFFSET_FOLLOWING 0x04000 /* end is O. F. */
596 #define FRAMEOPTION_EXCLUDE_CURRENT_ROW 0x08000 /* omit C.R. */
597 #define FRAMEOPTION_EXCLUDE_GROUP 0x10000 /* omit C.R. & peers */
598 #define FRAMEOPTION_EXCLUDE_TIES 0x20000 /* omit C.R.'s peers */
599 
600 #define FRAMEOPTION_START_OFFSET \
601  (FRAMEOPTION_START_OFFSET_PRECEDING | FRAMEOPTION_START_OFFSET_FOLLOWING)
602 #define FRAMEOPTION_END_OFFSET \
603  (FRAMEOPTION_END_OFFSET_PRECEDING | FRAMEOPTION_END_OFFSET_FOLLOWING)
604 #define FRAMEOPTION_EXCLUSION \
605  (FRAMEOPTION_EXCLUDE_CURRENT_ROW | FRAMEOPTION_EXCLUDE_GROUP | \
606  FRAMEOPTION_EXCLUDE_TIES)
607 
608 #define FRAMEOPTION_DEFAULTS \
609  (FRAMEOPTION_RANGE | FRAMEOPTION_START_UNBOUNDED_PRECEDING | \
610  FRAMEOPTION_END_CURRENT_ROW)
611 
612 /*
613  * RangeSubselect - subquery appearing in a FROM clause
614  */
615 typedef struct RangeSubselect
616 {
618  bool lateral; /* does it have LATERAL prefix? */
619  Node *subquery; /* the untransformed sub-select clause */
620  Alias *alias; /* table alias & optional column aliases */
622 
623 /*
624  * RangeFunction - function call appearing in a FROM clause
625  *
626  * functions is a List because we use this to represent the construct
627  * ROWS FROM(func1(...), func2(...), ...). Each element of this list is a
628  * two-element sublist, the first element being the untransformed function
629  * call tree, and the second element being a possibly-empty list of ColumnDef
630  * nodes representing any columndef list attached to that function within the
631  * ROWS FROM() syntax.
632  *
633  * alias and coldeflist represent any alias and/or columndef list attached
634  * at the top level. (We disallow coldeflist appearing both here and
635  * per-function, but that's checked in parse analysis, not by the grammar.)
636  */
637 typedef struct RangeFunction
638 {
640  bool lateral; /* does it have LATERAL prefix? */
641  bool ordinality; /* does it have WITH ORDINALITY suffix? */
642  bool is_rowsfrom; /* is result of ROWS FROM() syntax? */
643  List *functions; /* per-function information, see above */
644  Alias *alias; /* table alias & optional column aliases */
645  List *coldeflist; /* list of ColumnDef nodes to describe result
646  * of function returning RECORD */
648 
649 /*
650  * RangeTableFunc - raw form of "table functions" such as XMLTABLE
651  *
652  * Note: JSON_TABLE is also a "table function", but it uses JsonTable node,
653  * not RangeTableFunc.
654  */
655 typedef struct RangeTableFunc
656 {
658  bool lateral; /* does it have LATERAL prefix? */
659  Node *docexpr; /* document expression */
660  Node *rowexpr; /* row generator expression */
661  List *namespaces; /* list of namespaces as ResTarget */
662  List *columns; /* list of RangeTableFuncCol */
663  Alias *alias; /* table alias & optional column aliases */
664  ParseLoc location; /* token location, or -1 if unknown */
666 
667 /*
668  * RangeTableFuncCol - one column in a RangeTableFunc->columns
669  *
670  * If for_ordinality is true (FOR ORDINALITY), then the column is an int4
671  * column and the rest of the fields are ignored.
672  */
673 typedef struct RangeTableFuncCol
674 {
676  char *colname; /* name of generated column */
677  TypeName *typeName; /* type of generated column */
678  bool for_ordinality; /* does it have FOR ORDINALITY? */
679  bool is_not_null; /* does it have NOT NULL? */
680  Node *colexpr; /* column filter expression */
681  Node *coldefexpr; /* column default value expression */
682  ParseLoc location; /* token location, or -1 if unknown */
684 
685 /*
686  * RangeTableSample - TABLESAMPLE appearing in a raw FROM clause
687  *
688  * This node, appearing only in raw parse trees, represents
689  * <relation> TABLESAMPLE <method> (<params>) REPEATABLE (<num>)
690  * Currently, the <relation> can only be a RangeVar, but we might in future
691  * allow RangeSubselect and other options. Note that the RangeTableSample
692  * is wrapped around the node representing the <relation>, rather than being
693  * a subfield of it.
694  */
695 typedef struct RangeTableSample
696 {
698  Node *relation; /* relation to be sampled */
699  List *method; /* sampling method name (possibly qualified) */
700  List *args; /* argument(s) for sampling method */
701  Node *repeatable; /* REPEATABLE expression, or NULL if none */
702  ParseLoc location; /* method name location, or -1 if unknown */
704 
705 /*
706  * ColumnDef - column definition (used in various creates)
707  *
708  * If the column has a default value, we may have the value expression
709  * in either "raw" form (an untransformed parse tree) or "cooked" form
710  * (a post-parse-analysis, executable expression tree), depending on
711  * how this ColumnDef node was created (by parsing, or by inheritance
712  * from an existing relation). We should never have both in the same node!
713  *
714  * Similarly, we may have a COLLATE specification in either raw form
715  * (represented as a CollateClause with arg==NULL) or cooked form
716  * (the collation's OID).
717  *
718  * The constraints list may contain a CONSTR_DEFAULT item in a raw
719  * parsetree produced by gram.y, but transformCreateStmt will remove
720  * the item and set raw_default instead. CONSTR_DEFAULT items
721  * should not appear in any subsequent processing.
722  */
723 typedef struct ColumnDef
724 {
726  char *colname; /* name of column */
727  TypeName *typeName; /* type of column */
728  char *compression; /* compression method for column */
729  int inhcount; /* number of times column is inherited */
730  bool is_local; /* column has local (non-inherited) def'n */
731  bool is_not_null; /* NOT NULL constraint specified? */
732  bool is_from_type; /* column definition came from table type */
733  char storage; /* attstorage setting, or 0 for default */
734  char *storage_name; /* attstorage setting name or NULL for default */
735  Node *raw_default; /* default value (untransformed parse tree) */
736  Node *cooked_default; /* default value (transformed expr tree) */
737  char identity; /* attidentity setting */
738  RangeVar *identitySequence; /* to store identity sequence name for
739  * ALTER TABLE ... ADD COLUMN */
740  char generated; /* attgenerated setting */
741  CollateClause *collClause; /* untransformed COLLATE spec, if any */
742  Oid collOid; /* collation OID (InvalidOid if not set) */
743  List *constraints; /* other constraints on column */
744  List *fdwoptions; /* per-column FDW options */
745  ParseLoc location; /* parse location, or -1 if none/unknown */
747 
748 /*
749  * TableLikeClause - CREATE TABLE ( ... LIKE ... ) clause
750  */
751 typedef struct TableLikeClause
752 {
755  bits32 options; /* OR of TableLikeOption flags */
756  Oid relationOid; /* If table has been looked up, its OID */
758 
759 typedef enum TableLikeOption
760 {
772 
773 /*
774  * IndexElem - index parameters (used in CREATE INDEX, and in ON CONFLICT)
775  *
776  * For a plain index attribute, 'name' is the name of the table column to
777  * index, and 'expr' is NULL. For an index expression, 'name' is NULL and
778  * 'expr' is the expression tree.
779  */
780 typedef struct IndexElem
781 {
783  char *name; /* name of attribute to index, or NULL */
784  Node *expr; /* expression to index, or NULL */
785  char *indexcolname; /* name for index column; NULL = default */
786  List *collation; /* name of collation; NIL = default */
787  List *opclass; /* name of desired opclass; NIL = default */
788  List *opclassopts; /* opclass-specific options, or NIL */
789  SortByDir ordering; /* ASC/DESC/default */
790  SortByNulls nulls_ordering; /* FIRST/LAST/default */
792 
793 /*
794  * DefElem - a generic "name = value" option definition
795  *
796  * In some contexts the name can be qualified. Also, certain SQL commands
797  * allow a SET/ADD/DROP action to be attached to option settings, so it's
798  * convenient to carry a field for that too. (Note: currently, it is our
799  * practice that the grammar allows namespace and action only in statements
800  * where they are relevant; C code can just ignore those fields in other
801  * statements.)
802  */
803 typedef enum DefElemAction
804 {
805  DEFELEM_UNSPEC, /* no action given */
810 
811 typedef struct DefElem
812 {
814  char *defnamespace; /* NULL if unqualified name */
815  char *defname;
816  Node *arg; /* typically Integer, Float, String, or
817  * TypeName */
818  DefElemAction defaction; /* unspecified action, or SET/ADD/DROP */
819  ParseLoc location; /* token location, or -1 if unknown */
821 
822 /*
823  * LockingClause - raw representation of FOR [NO KEY] UPDATE/[KEY] SHARE
824  * options
825  *
826  * Note: lockedRels == NIL means "all relations in query". Otherwise it
827  * is a list of RangeVar nodes. (We use RangeVar mainly because it carries
828  * a location field --- currently, parse analysis insists on unqualified
829  * names in LockingClause.)
830  */
831 typedef struct LockingClause
832 {
834  List *lockedRels; /* FOR [KEY] UPDATE/SHARE relations */
836  LockWaitPolicy waitPolicy; /* NOWAIT and SKIP LOCKED */
838 
839 /*
840  * XMLSERIALIZE (in raw parse tree only)
841  */
842 typedef struct XmlSerialize
843 {
845  XmlOptionType xmloption; /* DOCUMENT or CONTENT */
848  bool indent; /* [NO] INDENT */
849  ParseLoc location; /* token location, or -1 if unknown */
851 
852 /* Partitioning related definitions */
853 
854 /*
855  * PartitionElem - parse-time representation of a single partition key
856  *
857  * expr can be either a raw expression tree or a parse-analyzed expression.
858  * We don't store these on-disk, though.
859  */
860 typedef struct PartitionElem
861 {
863  char *name; /* name of column to partition on, or NULL */
864  Node *expr; /* expression to partition on, or NULL */
865  List *collation; /* name of collation; NIL = default */
866  List *opclass; /* name of desired opclass; NIL = default */
867  ParseLoc location; /* token location, or -1 if unknown */
869 
870 typedef enum PartitionStrategy
871 {
876 
877 /*
878  * PartitionSpec - parse-time representation of a partition key specification
879  *
880  * This represents the key space we will be partitioning on.
881  */
882 typedef struct PartitionSpec
883 {
886  List *partParams; /* List of PartitionElems */
887  ParseLoc location; /* token location, or -1 if unknown */
889 
890 /*
891  * PartitionBoundSpec - a partition bound specification
892  *
893  * This represents the portion of the partition key space assigned to a
894  * particular partition. These are stored on disk in pg_class.relpartbound.
895  */
897 {
899 
900  char strategy; /* see PARTITION_STRATEGY codes above */
901  bool is_default; /* is it a default partition bound? */
902 
903  /* Partitioning info for HASH strategy: */
904  int modulus;
906 
907  /* Partitioning info for LIST strategy: */
908  List *listdatums; /* List of Consts (or A_Consts in raw tree) */
909 
910  /* Partitioning info for RANGE strategy: */
911  List *lowerdatums; /* List of PartitionRangeDatums */
912  List *upperdatums; /* List of PartitionRangeDatums */
913 
914  ParseLoc location; /* token location, or -1 if unknown */
915 };
916 
917 /*
918  * PartitionRangeDatum - one of the values in a range partition bound
919  *
920  * This can be MINVALUE, MAXVALUE or a specific bounded value.
921  */
923 {
924  PARTITION_RANGE_DATUM_MINVALUE = -1, /* less than any other value */
925  PARTITION_RANGE_DATUM_VALUE = 0, /* a specific (bounded) value */
926  PARTITION_RANGE_DATUM_MAXVALUE = 1, /* greater than any other value */
928 
929 typedef struct PartitionRangeDatum
930 {
932 
934  Node *value; /* Const (or A_Const in raw tree), if kind is
935  * PARTITION_RANGE_DATUM_VALUE, else NULL */
936 
937  ParseLoc location; /* token location, or -1 if unknown */
939 
940 /*
941  * PartitionDesc - info about single partition for ALTER TABLE SPLIT PARTITION command
942  */
943 typedef struct SinglePartitionSpec
944 {
946 
947  RangeVar *name; /* name of partition */
948  PartitionBoundSpec *bound; /* FOR VALUES, if attaching */
950 
951 /*
952  * PartitionCmd - info for ALTER TABLE/INDEX ATTACH/DETACH PARTITION commands
953  */
954 typedef struct PartitionCmd
955 {
957  RangeVar *name; /* name of partition to attach/detach */
958  PartitionBoundSpec *bound; /* FOR VALUES, if attaching */
959  List *partlist; /* list of partitions, for MERGE/SPLIT
960  * PARTITION command */
963 
964 /****************************************************************************
965  * Nodes for a Query tree
966  ****************************************************************************/
967 
968 /*--------------------
969  * RangeTblEntry -
970  * A range table is a List of RangeTblEntry nodes.
971  *
972  * A range table entry may represent a plain relation, a sub-select in
973  * FROM, or the result of a JOIN clause. (Only explicit JOIN syntax
974  * produces an RTE, not the implicit join resulting from multiple FROM
975  * items. This is because we only need the RTE to deal with SQL features
976  * like outer joins and join-output-column aliasing.) Other special
977  * RTE types also exist, as indicated by RTEKind.
978  *
979  * Note that we consider RTE_RELATION to cover anything that has a pg_class
980  * entry. relkind distinguishes the sub-cases.
981  *
982  * alias is an Alias node representing the AS alias-clause attached to the
983  * FROM expression, or NULL if no clause.
984  *
985  * eref is the table reference name and column reference names (either
986  * real or aliases). Note that system columns (OID etc) are not included
987  * in the column list.
988  * eref->aliasname is required to be present, and should generally be used
989  * to identify the RTE for error messages etc.
990  *
991  * In RELATION RTEs, the colnames in both alias and eref are indexed by
992  * physical attribute number; this means there must be colname entries for
993  * dropped columns. When building an RTE we insert empty strings ("") for
994  * dropped columns. Note however that a stored rule may have nonempty
995  * colnames for columns dropped since the rule was created (and for that
996  * matter the colnames might be out of date due to column renamings).
997  * The same comments apply to FUNCTION RTEs when a function's return type
998  * is a named composite type.
999  *
1000  * In JOIN RTEs, the colnames in both alias and eref are one-to-one with
1001  * joinaliasvars entries. A JOIN RTE will omit columns of its inputs when
1002  * those columns are known to be dropped at parse time. Again, however,
1003  * a stored rule might contain entries for columns dropped since the rule
1004  * was created. (This is only possible for columns not actually referenced
1005  * in the rule.) When loading a stored rule, we replace the joinaliasvars
1006  * items for any such columns with null pointers. (We can't simply delete
1007  * them from the joinaliasvars list, because that would affect the attnums
1008  * of Vars referencing the rest of the list.)
1009  *
1010  * inFromCl marks those range variables that are listed in the FROM clause.
1011  * It's false for RTEs that are added to a query behind the scenes, such
1012  * as the NEW and OLD variables for a rule, or the subqueries of a UNION.
1013  * This flag is not used during parsing (except in transformLockingClause,
1014  * q.v.); the parser now uses a separate "namespace" data structure to
1015  * control visibility. But it is needed by ruleutils.c to determine
1016  * whether RTEs should be shown in decompiled queries.
1017  *
1018  * securityQuals is a list of security barrier quals (boolean expressions),
1019  * to be tested in the listed order before returning a row from the
1020  * relation. It is always NIL in parser output. Entries are added by the
1021  * rewriter to implement security-barrier views and/or row-level security.
1022  * Note that the planner turns each boolean expression into an implicitly
1023  * AND'ed sublist, as is its usual habit with qualification expressions.
1024  *--------------------
1025  */
1026 typedef enum RTEKind
1027 {
1028  RTE_RELATION, /* ordinary relation reference */
1029  RTE_SUBQUERY, /* subquery in FROM */
1030  RTE_JOIN, /* join */
1031  RTE_FUNCTION, /* function in FROM */
1032  RTE_TABLEFUNC, /* TableFunc(.., column list) */
1033  RTE_VALUES, /* VALUES (<exprlist>), (<exprlist>), ... */
1034  RTE_CTE, /* common table expr (WITH list element) */
1035  RTE_NAMEDTUPLESTORE, /* tuplestore, e.g. for AFTER triggers */
1036  RTE_RESULT, /* RTE represents an empty FROM clause; such
1037  * RTEs are added by the planner, they're not
1038  * present during parsing or rewriting */
1040 
1041 typedef struct RangeTblEntry
1042 {
1043  pg_node_attr(custom_read_write)
1044 
1045  NodeTag type;
1046 
1047  /*
1048  * Fields valid in all RTEs:
1049  *
1050  * put alias + eref first to make dump more legible
1051  */
1052  /* user-written alias clause, if any */
1053  Alias *alias pg_node_attr(query_jumble_ignore);
1054  /* expanded reference names */
1055  Alias *eref pg_node_attr(query_jumble_ignore);
1056 
1057  RTEKind rtekind; /* see above */
1058 
1059  /*
1060  * Fields valid for a plain relation RTE (else zero):
1061  *
1062  * inh is true for relation references that should be expanded to include
1063  * inheritance children, if the rel has any. In the parser, this will
1064  * only be true for RTE_RELATION entries. The planner also uses this
1065  * field to mark RTE_SUBQUERY entries that contain UNION ALL queries that
1066  * it has flattened into pulled-up subqueries (creating a structure much
1067  * like the effects of inheritance).
1068  *
1069  * rellockmode is really LOCKMODE, but it's declared int to avoid having
1070  * to include lock-related headers here. It must be RowExclusiveLock if
1071  * the RTE is an INSERT/UPDATE/DELETE/MERGE target, else RowShareLock if
1072  * the RTE is a SELECT FOR UPDATE/FOR SHARE target, else AccessShareLock.
1073  *
1074  * Note: in some cases, rule expansion may result in RTEs that are marked
1075  * with RowExclusiveLock even though they are not the target of the
1076  * current query; this happens if a DO ALSO rule simply scans the original
1077  * target table. We leave such RTEs with their original lockmode so as to
1078  * avoid getting an additional, lesser lock.
1079  *
1080  * perminfoindex is 1-based index of the RTEPermissionInfo belonging to
1081  * this RTE in the containing struct's list of same; 0 if permissions need
1082  * not be checked for this RTE.
1083  *
1084  * As a special case, relid, relkind, rellockmode, and perminfoindex can
1085  * also be set (nonzero) in an RTE_SUBQUERY RTE. This occurs when we
1086  * convert an RTE_RELATION RTE naming a view into an RTE_SUBQUERY
1087  * containing the view's query. We still need to perform run-time locking
1088  * and permission checks on the view, even though it's not directly used
1089  * in the query anymore, and the most expedient way to do that is to
1090  * retain these fields from the old state of the RTE.
1091  *
1092  * As a special case, RTE_NAMEDTUPLESTORE can also set relid to indicate
1093  * that the tuple format of the tuplestore is the same as the referenced
1094  * relation. This allows plans referencing AFTER trigger transition
1095  * tables to be invalidated if the underlying table is altered.
1096  */
1097  /* OID of the relation */
1099  /* inheritance requested? */
1100  bool inh;
1101  /* relation kind (see pg_class.relkind) */
1102  char relkind pg_node_attr(query_jumble_ignore);
1103  /* lock level that query requires on the rel */
1104  int rellockmode pg_node_attr(query_jumble_ignore);
1105  /* index of RTEPermissionInfo entry, or 0 */
1106  Index perminfoindex pg_node_attr(query_jumble_ignore);
1107  /* sampling info, or NULL */
1109 
1110  /*
1111  * Fields valid for a subquery RTE (else NULL):
1112  */
1113  /* the sub-query */
1115  /* is from security_barrier view? */
1116  bool security_barrier pg_node_attr(query_jumble_ignore);
1117 
1118  /*
1119  * Fields valid for a join RTE (else NULL/zero):
1120  *
1121  * joinaliasvars is a list of (usually) Vars corresponding to the columns
1122  * of the join result. An alias Var referencing column K of the join
1123  * result can be replaced by the K'th element of joinaliasvars --- but to
1124  * simplify the task of reverse-listing aliases correctly, we do not do
1125  * that until planning time. In detail: an element of joinaliasvars can
1126  * be a Var of one of the join's input relations, or such a Var with an
1127  * implicit coercion to the join's output column type, or a COALESCE
1128  * expression containing the two input column Vars (possibly coerced).
1129  * Elements beyond the first joinmergedcols entries are always just Vars,
1130  * and are never referenced from elsewhere in the query (that is, join
1131  * alias Vars are generated only for merged columns). We keep these
1132  * entries only because they're needed in expandRTE() and similar code.
1133  *
1134  * Vars appearing within joinaliasvars are marked with varnullingrels sets
1135  * that describe the nulling effects of this join and lower ones. This is
1136  * essential for FULL JOIN cases, because the COALESCE expression only
1137  * describes the semantics correctly if its inputs have been nulled by the
1138  * join. For other cases, it allows expandRTE() to generate a valid
1139  * representation of the join's output without consulting additional
1140  * parser state.
1141  *
1142  * Within a Query loaded from a stored rule, it is possible for non-merged
1143  * joinaliasvars items to be null pointers, which are placeholders for
1144  * (necessarily unreferenced) columns dropped since the rule was made.
1145  * Also, once planning begins, joinaliasvars items can be almost anything,
1146  * as a result of subquery-flattening substitutions.
1147  *
1148  * joinleftcols is an integer list of physical column numbers of the left
1149  * join input rel that are included in the join; likewise joinrighttcols
1150  * for the right join input rel. (Which rels those are can be determined
1151  * from the associated JoinExpr.) If the join is USING/NATURAL, then the
1152  * first joinmergedcols entries in each list identify the merged columns.
1153  * The merged columns come first in the join output, then remaining
1154  * columns of the left input, then remaining columns of the right.
1155  *
1156  * Note that input columns could have been dropped after creation of a
1157  * stored rule, if they are not referenced in the query (in particular,
1158  * merged columns could not be dropped); this is not accounted for in
1159  * joinleftcols/joinrighttcols.
1160  */
1162  /* number of merged (JOIN USING) columns */
1163  int joinmergedcols pg_node_attr(query_jumble_ignore);
1164  /* list of alias-var expansions */
1165  List *joinaliasvars pg_node_attr(query_jumble_ignore);
1166  /* left-side input column numbers */
1167  List *joinleftcols pg_node_attr(query_jumble_ignore);
1168  /* right-side input column numbers */
1169  List *joinrightcols pg_node_attr(query_jumble_ignore);
1170 
1171  /*
1172  * join_using_alias is an alias clause attached directly to JOIN/USING. It
1173  * is different from the alias field (below) in that it does not hide the
1174  * range variables of the tables being joined.
1175  */
1176  Alias *join_using_alias pg_node_attr(query_jumble_ignore);
1177 
1178  /*
1179  * Fields valid for a function RTE (else NIL/zero):
1180  *
1181  * When funcordinality is true, the eref->colnames list includes an alias
1182  * for the ordinality column. The ordinality column is otherwise
1183  * implicit, and must be accounted for "by hand" in places such as
1184  * expandRTE().
1185  */
1186  /* list of RangeTblFunction nodes */
1188  /* is this called WITH ORDINALITY? */
1190 
1191  /*
1192  * Fields valid for a TableFunc RTE (else NULL):
1193  */
1195 
1196  /*
1197  * Fields valid for a values RTE (else NIL):
1198  */
1199  /* list of expression lists */
1201 
1202  /*
1203  * Fields valid for a CTE RTE (else NULL/zero):
1204  */
1205  /* name of the WITH list item */
1206  char *ctename;
1207  /* number of query levels up */
1209  /* is this a recursive self-reference? */
1210  bool self_reference pg_node_attr(query_jumble_ignore);
1211 
1212  /*
1213  * Fields valid for CTE, VALUES, ENR, and TableFunc RTEs (else NIL):
1214  *
1215  * We need these for CTE RTEs so that the types of self-referential
1216  * columns are well-defined. For VALUES RTEs, storing these explicitly
1217  * saves having to re-determine the info by scanning the values_lists. For
1218  * ENRs, we store the types explicitly here (we could get the information
1219  * from the catalogs if 'relid' was supplied, but we'd still need these
1220  * for TupleDesc-based ENRs, so we might as well always store the type
1221  * info here). For TableFuncs, these fields are redundant with data in
1222  * the TableFunc node, but keeping them here allows some code sharing with
1223  * the other cases.
1224  *
1225  * For ENRs only, we have to consider the possibility of dropped columns.
1226  * A dropped column is included in these lists, but it will have zeroes in
1227  * all three lists (as well as an empty-string entry in eref). Testing
1228  * for zero coltype is the standard way to detect a dropped column.
1229  */
1230  /* OID list of column type OIDs */
1231  List *coltypes pg_node_attr(query_jumble_ignore);
1232  /* integer list of column typmods */
1233  List *coltypmods pg_node_attr(query_jumble_ignore);
1234  /* OID list of column collation OIDs */
1235  List *colcollations pg_node_attr(query_jumble_ignore);
1236 
1237  /*
1238  * Fields valid for ENR RTEs (else NULL/zero):
1239  */
1240  /* name of ephemeral named relation */
1241  char *enrname;
1242  /* estimated or actual from caller */
1243  Cardinality enrtuples pg_node_attr(query_jumble_ignore);
1244 
1245  /*
1246  * Fields valid in all RTEs:
1247  */
1248  /* was LATERAL specified? */
1249  bool lateral pg_node_attr(query_jumble_ignore);
1250  /* present in FROM clause? */
1251  bool inFromCl pg_node_attr(query_jumble_ignore);
1252  /* security barrier quals to apply, if any */
1253  List *securityQuals pg_node_attr(query_jumble_ignore);
1255 
1256 /*
1257  * RTEPermissionInfo
1258  * Per-relation information for permission checking. Added to the Query
1259  * node by the parser when adding the corresponding RTE to the query
1260  * range table and subsequently editorialized on by the rewriter if
1261  * needed after rule expansion.
1262  *
1263  * Only the relations directly mentioned in the query are checked for
1264  * access permissions by the core executor, so only their RTEPermissionInfos
1265  * are present in the Query. However, extensions may want to check inheritance
1266  * children too, depending on the value of rte->inh, so it's copied in 'inh'
1267  * for their perusal.
1268  *
1269  * requiredPerms and checkAsUser specify run-time access permissions checks
1270  * to be performed at query startup. The user must have *all* of the
1271  * permissions that are OR'd together in requiredPerms (never 0!). If
1272  * checkAsUser is not zero, then do the permissions checks using the access
1273  * rights of that user, not the current effective user ID. (This allows rules
1274  * to act as setuid gateways.)
1275  *
1276  * For SELECT/INSERT/UPDATE permissions, if the user doesn't have table-wide
1277  * permissions then it is sufficient to have the permissions on all columns
1278  * identified in selectedCols (for SELECT) and/or insertedCols and/or
1279  * updatedCols (INSERT with ON CONFLICT DO UPDATE may have all 3).
1280  * selectedCols, insertedCols and updatedCols are bitmapsets, which cannot have
1281  * negative integer members, so we subtract FirstLowInvalidHeapAttributeNumber
1282  * from column numbers before storing them in these fields. A whole-row Var
1283  * reference is represented by setting the bit for InvalidAttrNumber.
1284  *
1285  * updatedCols is also used in some other places, for example, to determine
1286  * which triggers to fire and in FDWs to know which changed columns they need
1287  * to ship off.
1288  */
1289 typedef struct RTEPermissionInfo
1290 {
1292 
1293  Oid relid; /* relation OID */
1294  bool inh; /* separately check inheritance children? */
1295  AclMode requiredPerms; /* bitmask of required access permissions */
1296  Oid checkAsUser; /* if valid, check access as this role */
1297  Bitmapset *selectedCols; /* columns needing SELECT permission */
1298  Bitmapset *insertedCols; /* columns needing INSERT permission */
1299  Bitmapset *updatedCols; /* columns needing UPDATE permission */
1301 
1302 /*
1303  * RangeTblFunction -
1304  * RangeTblEntry subsidiary data for one function in a FUNCTION RTE.
1305  *
1306  * If the function had a column definition list (required for an
1307  * otherwise-unspecified RECORD result), funccolnames lists the names given
1308  * in the definition list, funccoltypes lists their declared column types,
1309  * funccoltypmods lists their typmods, funccolcollations their collations.
1310  * Otherwise, those fields are NIL.
1311  *
1312  * Notice we don't attempt to store info about the results of functions
1313  * returning named composite types, because those can change from time to
1314  * time. We do however remember how many columns we thought the type had
1315  * (including dropped columns!), so that we can successfully ignore any
1316  * columns added after the query was parsed.
1317  *
1318  * The query jumbling only needs to track the function expression.
1319  */
1320 typedef struct RangeTblFunction
1321 {
1323 
1324  Node *funcexpr; /* expression tree for func call */
1325  /* number of columns it contributes to RTE */
1326  int funccolcount pg_node_attr(query_jumble_ignore);
1327  /* These fields record the contents of a column definition list, if any: */
1328  /* column names (list of String) */
1329  List *funccolnames pg_node_attr(query_jumble_ignore);
1330  /* OID list of column type OIDs */
1331  List *funccoltypes pg_node_attr(query_jumble_ignore);
1332  /* integer list of column typmods */
1333  List *funccoltypmods pg_node_attr(query_jumble_ignore);
1334  /* OID list of column collation OIDs */
1335  List *funccolcollations pg_node_attr(query_jumble_ignore);
1336 
1337  /* This is set during planning for use by the executor: */
1338  /* PARAM_EXEC Param IDs affecting this func */
1339  Bitmapset *funcparams pg_node_attr(query_jumble_ignore);
1341 
1342 /*
1343  * TableSampleClause - TABLESAMPLE appearing in a transformed FROM clause
1344  *
1345  * Unlike RangeTableSample, this is a subnode of the relevant RangeTblEntry.
1346  */
1347 typedef struct TableSampleClause
1348 {
1350  Oid tsmhandler; /* OID of the tablesample handler function */
1351  List *args; /* tablesample argument expression(s) */
1352  Expr *repeatable; /* REPEATABLE expression, or NULL if none */
1354 
1355 /*
1356  * WithCheckOption -
1357  * representation of WITH CHECK OPTION checks to be applied to new tuples
1358  * when inserting/updating an auto-updatable view, or RLS WITH CHECK
1359  * policies to be applied when inserting/updating a relation with RLS.
1360  */
1361 typedef enum WCOKind
1362 {
1363  WCO_VIEW_CHECK, /* WCO on an auto-updatable view */
1364  WCO_RLS_INSERT_CHECK, /* RLS INSERT WITH CHECK policy */
1365  WCO_RLS_UPDATE_CHECK, /* RLS UPDATE WITH CHECK policy */
1366  WCO_RLS_CONFLICT_CHECK, /* RLS ON CONFLICT DO UPDATE USING policy */
1367  WCO_RLS_MERGE_UPDATE_CHECK, /* RLS MERGE UPDATE USING policy */
1368  WCO_RLS_MERGE_DELETE_CHECK, /* RLS MERGE DELETE USING policy */
1370 
1371 typedef struct WithCheckOption
1372 {
1374  WCOKind kind; /* kind of WCO */
1375  char *relname; /* name of relation that specified the WCO */
1376  char *polname; /* name of RLS policy being checked */
1377  Node *qual; /* constraint qual to check */
1378  bool cascaded; /* true for a cascaded WCO on a view */
1380 
1381 /*
1382  * SortGroupClause -
1383  * representation of ORDER BY, GROUP BY, PARTITION BY,
1384  * DISTINCT, DISTINCT ON items
1385  *
1386  * You might think that ORDER BY is only interested in defining ordering,
1387  * and GROUP/DISTINCT are only interested in defining equality. However,
1388  * one way to implement grouping is to sort and then apply a "uniq"-like
1389  * filter. So it's also interesting to keep track of possible sort operators
1390  * for GROUP/DISTINCT, and in particular to try to sort for the grouping
1391  * in a way that will also yield a requested ORDER BY ordering. So we need
1392  * to be able to compare ORDER BY and GROUP/DISTINCT lists, which motivates
1393  * the decision to give them the same representation.
1394  *
1395  * tleSortGroupRef must match ressortgroupref of exactly one entry of the
1396  * query's targetlist; that is the expression to be sorted or grouped by.
1397  * eqop is the OID of the equality operator.
1398  * sortop is the OID of the ordering operator (a "<" or ">" operator),
1399  * or InvalidOid if not available.
1400  * nulls_first means about what you'd expect. If sortop is InvalidOid
1401  * then nulls_first is meaningless and should be set to false.
1402  * hashable is true if eqop is hashable (note this condition also depends
1403  * on the datatype of the input expression).
1404  *
1405  * In an ORDER BY item, all fields must be valid. (The eqop isn't essential
1406  * here, but it's cheap to get it along with the sortop, and requiring it
1407  * to be valid eases comparisons to grouping items.) Note that this isn't
1408  * actually enough information to determine an ordering: if the sortop is
1409  * collation-sensitive, a collation OID is needed too. We don't store the
1410  * collation in SortGroupClause because it's not available at the time the
1411  * parser builds the SortGroupClause; instead, consult the exposed collation
1412  * of the referenced targetlist expression to find out what it is.
1413  *
1414  * In a grouping item, eqop must be valid. If the eqop is a btree equality
1415  * operator, then sortop should be set to a compatible ordering operator.
1416  * We prefer to set eqop/sortop/nulls_first to match any ORDER BY item that
1417  * the query presents for the same tlist item. If there is none, we just
1418  * use the default ordering op for the datatype.
1419  *
1420  * If the tlist item's type has a hash opclass but no btree opclass, then
1421  * we will set eqop to the hash equality operator, sortop to InvalidOid,
1422  * and nulls_first to false. A grouping item of this kind can only be
1423  * implemented by hashing, and of course it'll never match an ORDER BY item.
1424  *
1425  * The hashable flag is provided since we generally have the requisite
1426  * information readily available when the SortGroupClause is constructed,
1427  * and it's relatively expensive to get it again later. Note there is no
1428  * need for a "sortable" flag since OidIsValid(sortop) serves the purpose.
1429  *
1430  * A query might have both ORDER BY and DISTINCT (or DISTINCT ON) clauses.
1431  * In SELECT DISTINCT, the distinctClause list is as long or longer than the
1432  * sortClause list, while in SELECT DISTINCT ON it's typically shorter.
1433  * The two lists must match up to the end of the shorter one --- the parser
1434  * rearranges the distinctClause if necessary to make this true. (This
1435  * restriction ensures that only one sort step is needed to both satisfy the
1436  * ORDER BY and set up for the Unique step. This is semantically necessary
1437  * for DISTINCT ON, and presents no real drawback for DISTINCT.)
1438  */
1439 typedef struct SortGroupClause
1440 {
1442  Index tleSortGroupRef; /* reference into targetlist */
1443  Oid eqop; /* the equality operator ('=' op) */
1444  Oid sortop; /* the ordering operator ('<' op), or 0 */
1445  bool nulls_first; /* do NULLs come before normal values? */
1446  /* can eqop be implemented by hashing? */
1447  bool hashable pg_node_attr(query_jumble_ignore);
1449 
1450 /*
1451  * GroupingSet -
1452  * representation of CUBE, ROLLUP and GROUPING SETS clauses
1453  *
1454  * In a Query with grouping sets, the groupClause contains a flat list of
1455  * SortGroupClause nodes for each distinct expression used. The actual
1456  * structure of the GROUP BY clause is given by the groupingSets tree.
1457  *
1458  * In the raw parser output, GroupingSet nodes (of all types except SIMPLE
1459  * which is not used) are potentially mixed in with the expressions in the
1460  * groupClause of the SelectStmt. (An expression can't contain a GroupingSet,
1461  * but a list may mix GroupingSet and expression nodes.) At this stage, the
1462  * content of each node is a list of expressions, some of which may be RowExprs
1463  * which represent sublists rather than actual row constructors, and nested
1464  * GroupingSet nodes where legal in the grammar. The structure directly
1465  * reflects the query syntax.
1466  *
1467  * In parse analysis, the transformed expressions are used to build the tlist
1468  * and groupClause list (of SortGroupClause nodes), and the groupingSets tree
1469  * is eventually reduced to a fixed format:
1470  *
1471  * EMPTY nodes represent (), and obviously have no content
1472  *
1473  * SIMPLE nodes represent a list of one or more expressions to be treated as an
1474  * atom by the enclosing structure; the content is an integer list of
1475  * ressortgroupref values (see SortGroupClause)
1476  *
1477  * CUBE and ROLLUP nodes contain a list of one or more SIMPLE nodes.
1478  *
1479  * SETS nodes contain a list of EMPTY, SIMPLE, CUBE or ROLLUP nodes, but after
1480  * parse analysis they cannot contain more SETS nodes; enough of the syntactic
1481  * transforms of the spec have been applied that we no longer have arbitrarily
1482  * deep nesting (though we still preserve the use of cube/rollup).
1483  *
1484  * Note that if the groupingSets tree contains no SIMPLE nodes (only EMPTY
1485  * nodes at the leaves), then the groupClause will be empty, but this is still
1486  * an aggregation query (similar to using aggs or HAVING without GROUP BY).
1487  *
1488  * As an example, the following clause:
1489  *
1490  * GROUP BY GROUPING SETS ((a,b), CUBE(c,(d,e)))
1491  *
1492  * looks like this after raw parsing:
1493  *
1494  * SETS( RowExpr(a,b) , CUBE( c, RowExpr(d,e) ) )
1495  *
1496  * and parse analysis converts it to:
1497  *
1498  * SETS( SIMPLE(1,2), CUBE( SIMPLE(3), SIMPLE(4,5) ) )
1499  */
1500 typedef enum GroupingSetKind
1501 {
1508 
1509 typedef struct GroupingSet
1510 {
1512  GroupingSetKind kind pg_node_attr(query_jumble_ignore);
1516 
1517 /*
1518  * WindowClause -
1519  * transformed representation of WINDOW and OVER clauses
1520  *
1521  * A parsed Query's windowClause list contains these structs. "name" is set
1522  * if the clause originally came from WINDOW, and is NULL if it originally
1523  * was an OVER clause (but note that we collapse out duplicate OVERs).
1524  * partitionClause and orderClause are lists of SortGroupClause structs.
1525  * partitionClause is sanitized by the query planner to remove any columns or
1526  * expressions belonging to redundant PathKeys.
1527  * If we have RANGE with offset PRECEDING/FOLLOWING, the semantics of that are
1528  * specified by startInRangeFunc/inRangeColl/inRangeAsc/inRangeNullsFirst
1529  * for the start offset, or endInRangeFunc/inRange* for the end offset.
1530  * winref is an ID number referenced by WindowFunc nodes; it must be unique
1531  * among the members of a Query's windowClause list.
1532  * When refname isn't null, the partitionClause is always copied from there;
1533  * the orderClause might or might not be copied (see copiedOrder); the framing
1534  * options are never copied, per spec.
1535  *
1536  * The information relevant for the query jumbling is the partition clause
1537  * type and its bounds.
1538  */
1539 typedef struct WindowClause
1540 {
1542  /* window name (NULL in an OVER clause) */
1543  char *name pg_node_attr(query_jumble_ignore);
1544  /* referenced window name, if any */
1545  char *refname pg_node_attr(query_jumble_ignore);
1546  List *partitionClause; /* PARTITION BY list */
1547  /* ORDER BY list */
1549  int frameOptions; /* frame_clause options, see WindowDef */
1550  Node *startOffset; /* expression for starting bound, if any */
1551  Node *endOffset; /* expression for ending bound, if any */
1552  /* qual to help short-circuit execution */
1553  List *runCondition pg_node_attr(query_jumble_ignore);
1554  /* in_range function for startOffset */
1555  Oid startInRangeFunc pg_node_attr(query_jumble_ignore);
1556  /* in_range function for endOffset */
1557  Oid endInRangeFunc pg_node_attr(query_jumble_ignore);
1558  /* collation for in_range tests */
1559  Oid inRangeColl pg_node_attr(query_jumble_ignore);
1560  /* use ASC sort order for in_range tests? */
1561  bool inRangeAsc pg_node_attr(query_jumble_ignore);
1562  /* nulls sort first for in_range tests? */
1563  bool inRangeNullsFirst pg_node_attr(query_jumble_ignore);
1564  Index winref; /* ID referenced by window functions */
1565  /* did we copy orderClause from refname? */
1566  bool copiedOrder pg_node_attr(query_jumble_ignore);
1568 
1569 /*
1570  * RowMarkClause -
1571  * parser output representation of FOR [KEY] UPDATE/SHARE clauses
1572  *
1573  * Query.rowMarks contains a separate RowMarkClause node for each relation
1574  * identified as a FOR [KEY] UPDATE/SHARE target. If one of these clauses
1575  * is applied to a subquery, we generate RowMarkClauses for all normal and
1576  * subquery rels in the subquery, but they are marked pushedDown = true to
1577  * distinguish them from clauses that were explicitly written at this query
1578  * level. Also, Query.hasForUpdate tells whether there were explicit FOR
1579  * UPDATE/SHARE/KEY SHARE clauses in the current query level.
1580  */
1581 typedef struct RowMarkClause
1582 {
1584  Index rti; /* range table index of target relation */
1586  LockWaitPolicy waitPolicy; /* NOWAIT and SKIP LOCKED */
1587  bool pushedDown; /* pushed down from higher query level? */
1589 
1590 /*
1591  * WithClause -
1592  * representation of WITH clause
1593  *
1594  * Note: WithClause does not propagate into the Query representation;
1595  * but CommonTableExpr does.
1596  */
1597 typedef struct WithClause
1598 {
1600  List *ctes; /* list of CommonTableExprs */
1601  bool recursive; /* true = WITH RECURSIVE */
1602  ParseLoc location; /* token location, or -1 if unknown */
1604 
1605 /*
1606  * InferClause -
1607  * ON CONFLICT unique index inference clause
1608  *
1609  * Note: InferClause does not propagate into the Query representation.
1610  */
1611 typedef struct InferClause
1612 {
1614  List *indexElems; /* IndexElems to infer unique index */
1615  Node *whereClause; /* qualification (partial-index predicate) */
1616  char *conname; /* Constraint name, or NULL if unnamed */
1617  ParseLoc location; /* token location, or -1 if unknown */
1619 
1620 /*
1621  * OnConflictClause -
1622  * representation of ON CONFLICT clause
1623  *
1624  * Note: OnConflictClause does not propagate into the Query representation.
1625  */
1626 typedef struct OnConflictClause
1627 {
1629  OnConflictAction action; /* DO NOTHING or UPDATE? */
1630  InferClause *infer; /* Optional index inference clause */
1631  List *targetList; /* the target list (of ResTarget) */
1632  Node *whereClause; /* qualifications */
1633  ParseLoc location; /* token location, or -1 if unknown */
1635 
1636 /*
1637  * CommonTableExpr -
1638  * representation of WITH list element
1639  */
1640 
1641 typedef enum CTEMaterialize
1642 {
1643  CTEMaterializeDefault, /* no option specified */
1644  CTEMaterializeAlways, /* MATERIALIZED */
1645  CTEMaterializeNever, /* NOT MATERIALIZED */
1647 
1648 typedef struct CTESearchClause
1649 {
1656 
1657 typedef struct CTECycleClause
1658 {
1666  /* These fields are set during parse analysis: */
1667  Oid cycle_mark_type; /* common type of _value and _default */
1670  Oid cycle_mark_neop; /* <> operator for type */
1672 
1673 typedef struct CommonTableExpr
1674 {
1676 
1677  /*
1678  * Query name (never qualified). The string name is included in the query
1679  * jumbling because RTE_CTE RTEs need it.
1680  */
1681  char *ctename;
1682  /* optional list of column names */
1683  List *aliascolnames pg_node_attr(query_jumble_ignore);
1684  CTEMaterialize ctematerialized; /* is this an optimization fence? */
1685  /* SelectStmt/InsertStmt/etc before parse analysis, Query afterwards: */
1686  Node *ctequery; /* the CTE's subquery */
1687  CTESearchClause *search_clause pg_node_attr(query_jumble_ignore);
1688  CTECycleClause *cycle_clause pg_node_attr(query_jumble_ignore);
1689  ParseLoc location; /* token location, or -1 if unknown */
1690  /* These fields are set during parse analysis: */
1691  /* is this CTE actually recursive? */
1692  bool cterecursive pg_node_attr(query_jumble_ignore);
1693 
1694  /*
1695  * Number of RTEs referencing this CTE (excluding internal
1696  * self-references), irrelevant for query jumbling.
1697  */
1698  int cterefcount pg_node_attr(query_jumble_ignore);
1699  /* list of output column names */
1700  List *ctecolnames pg_node_attr(query_jumble_ignore);
1701  /* OID list of output column type OIDs */
1702  List *ctecoltypes pg_node_attr(query_jumble_ignore);
1703  /* integer list of output column typmods */
1704  List *ctecoltypmods pg_node_attr(query_jumble_ignore);
1705  /* OID list of column collation OIDs */
1706  List *ctecolcollations pg_node_attr(query_jumble_ignore);
1708 
1709 /* Convenience macro to get the output tlist of a CTE's query */
1710 #define GetCTETargetList(cte) \
1711  (AssertMacro(IsA((cte)->ctequery, Query)), \
1712  ((Query *) (cte)->ctequery)->commandType == CMD_SELECT ? \
1713  ((Query *) (cte)->ctequery)->targetList : \
1714  ((Query *) (cte)->ctequery)->returningList)
1715 
1716 /*
1717  * MergeWhenClause -
1718  * raw parser representation of a WHEN clause in a MERGE statement
1719  *
1720  * This is transformed into MergeAction by parse analysis
1721  */
1722 typedef struct MergeWhenClause
1723 {
1725  MergeMatchKind matchKind; /* MATCHED/NOT MATCHED BY SOURCE/TARGET */
1726  CmdType commandType; /* INSERT/UPDATE/DELETE/DO NOTHING */
1727  OverridingKind override; /* OVERRIDING clause */
1728  Node *condition; /* WHEN conditions (raw parser) */
1729  List *targetList; /* INSERT/UPDATE targetlist */
1730  /* the following members are only used in INSERT actions */
1731  List *values; /* VALUES to INSERT, or NULL */
1733 
1734 /*
1735  * TriggerTransition -
1736  * representation of transition row or table naming clause
1737  *
1738  * Only transition tables are initially supported in the syntax, and only for
1739  * AFTER triggers, but other permutations are accepted by the parser so we can
1740  * give a meaningful message from C code.
1741  */
1742 typedef struct TriggerTransition
1743 {
1745  char *name;
1746  bool isNew;
1747  bool isTable;
1749 
1750 /* Nodes for SQL/JSON support */
1751 
1752 /*
1753  * JsonOutput -
1754  * representation of JSON output clause (RETURNING type [FORMAT format])
1755  */
1756 typedef struct JsonOutput
1757 {
1759  TypeName *typeName; /* RETURNING type name, if specified */
1760  JsonReturning *returning; /* RETURNING FORMAT clause and type Oids */
1762 
1763 /*
1764  * JsonArgument -
1765  * representation of argument from JSON PASSING clause
1766  */
1767 typedef struct JsonArgument
1768 {
1770  JsonValueExpr *val; /* argument value expression */
1771  char *name; /* argument name */
1773 
1774 /*
1775  * JsonQuotes -
1776  * representation of [KEEP|OMIT] QUOTES clause for JSON_QUERY()
1777  */
1778 typedef enum JsonQuotes
1779 {
1780  JS_QUOTES_UNSPEC, /* unspecified */
1781  JS_QUOTES_KEEP, /* KEEP QUOTES */
1782  JS_QUOTES_OMIT, /* OMIT QUOTES */
1784 
1785 /*
1786  * JsonFuncExpr -
1787  * untransformed representation of function expressions for
1788  * SQL/JSON query functions
1789  */
1790 typedef struct JsonFuncExpr
1791 {
1793  JsonExprOp op; /* expression type */
1794  char *column_name; /* JSON_TABLE() column name or NULL if this is
1795  * not for a JSON_TABLE() */
1796  JsonValueExpr *context_item; /* context item expression */
1797  Node *pathspec; /* JSON path specification expression */
1798  List *passing; /* list of PASSING clause arguments, if any */
1799  JsonOutput *output; /* output clause, if specified */
1800  JsonBehavior *on_empty; /* ON EMPTY behavior */
1801  JsonBehavior *on_error; /* ON ERROR behavior */
1802  JsonWrapper wrapper; /* array wrapper behavior (JSON_QUERY only) */
1803  JsonQuotes quotes; /* omit or keep quotes? (JSON_QUERY only) */
1804  ParseLoc location; /* token location, or -1 if unknown */
1806 
1807 /*
1808  * JsonTablePathSpec
1809  * untransformed specification of JSON path expression with an optional
1810  * name
1811  */
1812 typedef struct JsonTablePathSpec
1813 {
1815 
1817  char *name;
1819  ParseLoc location; /* location of 'string' */
1821 
1822 /*
1823  * JsonTable -
1824  * untransformed representation of JSON_TABLE
1825  */
1826 typedef struct JsonTable
1827 {
1829  JsonValueExpr *context_item; /* context item expression */
1830  JsonTablePathSpec *pathspec; /* JSON path specification */
1831  List *passing; /* list of PASSING clause arguments, if any */
1832  List *columns; /* list of JsonTableColumn */
1833  JsonBehavior *on_error; /* ON ERROR behavior */
1834  Alias *alias; /* table alias in FROM clause */
1835  bool lateral; /* does it have LATERAL prefix? */
1836  ParseLoc location; /* token location, or -1 if unknown */
1838 
1839 /*
1840  * JsonTableColumnType -
1841  * enumeration of JSON_TABLE column types
1842  */
1844 {
1851 
1852 /*
1853  * JsonTableColumn -
1854  * untransformed representation of JSON_TABLE column
1855  */
1856 typedef struct JsonTableColumn
1857 {
1859  JsonTableColumnType coltype; /* column type */
1860  char *name; /* column name */
1861  TypeName *typeName; /* column type name */
1862  JsonTablePathSpec *pathspec; /* JSON path specification */
1863  JsonFormat *format; /* JSON format clause, if specified */
1864  JsonWrapper wrapper; /* WRAPPER behavior for formatted columns */
1865  JsonQuotes quotes; /* omit or keep quotes on scalar strings? */
1866  List *columns; /* nested columns */
1867  JsonBehavior *on_empty; /* ON EMPTY behavior */
1868  JsonBehavior *on_error; /* ON ERROR behavior */
1869  ParseLoc location; /* token location, or -1 if unknown */
1871 
1872 /*
1873  * JsonKeyValue -
1874  * untransformed representation of JSON object key-value pair for
1875  * JSON_OBJECT() and JSON_OBJECTAGG()
1876  */
1877 typedef struct JsonKeyValue
1878 {
1880  Expr *key; /* key expression */
1881  JsonValueExpr *value; /* JSON value expression */
1883 
1884 /*
1885  * JsonParseExpr -
1886  * untransformed representation of JSON()
1887  */
1888 typedef struct JsonParseExpr
1889 {
1891  JsonValueExpr *expr; /* string expression */
1892  JsonOutput *output; /* RETURNING clause, if specified */
1893  bool unique_keys; /* WITH UNIQUE KEYS? */
1894  ParseLoc location; /* token location, or -1 if unknown */
1896 
1897 /*
1898  * JsonScalarExpr -
1899  * untransformed representation of JSON_SCALAR()
1900  */
1901 typedef struct JsonScalarExpr
1902 {
1904  Expr *expr; /* scalar expression */
1905  JsonOutput *output; /* RETURNING clause, if specified */
1906  ParseLoc location; /* token location, or -1 if unknown */
1908 
1909 /*
1910  * JsonSerializeExpr -
1911  * untransformed representation of JSON_SERIALIZE() function
1912  */
1913 typedef struct JsonSerializeExpr
1914 {
1916  JsonValueExpr *expr; /* json value expression */
1917  JsonOutput *output; /* RETURNING clause, if specified */
1918  ParseLoc location; /* token location, or -1 if unknown */
1920 
1921 /*
1922  * JsonObjectConstructor -
1923  * untransformed representation of JSON_OBJECT() constructor
1924  */
1926 {
1928  List *exprs; /* list of JsonKeyValue pairs */
1929  JsonOutput *output; /* RETURNING clause, if specified */
1930  bool absent_on_null; /* skip NULL values? */
1931  bool unique; /* check key uniqueness? */
1932  ParseLoc location; /* token location, or -1 if unknown */
1934 
1935 /*
1936  * JsonArrayConstructor -
1937  * untransformed representation of JSON_ARRAY(element,...) constructor
1938  */
1939 typedef struct JsonArrayConstructor
1940 {
1942  List *exprs; /* list of JsonValueExpr elements */
1943  JsonOutput *output; /* RETURNING clause, if specified */
1944  bool absent_on_null; /* skip NULL elements? */
1945  ParseLoc location; /* token location, or -1 if unknown */
1947 
1948 /*
1949  * JsonArrayQueryConstructor -
1950  * untransformed representation of JSON_ARRAY(subquery) constructor
1951  */
1953 {
1955  Node *query; /* subquery */
1956  JsonOutput *output; /* RETURNING clause, if specified */
1957  JsonFormat *format; /* FORMAT clause for subquery, if specified */
1958  bool absent_on_null; /* skip NULL elements? */
1959  ParseLoc location; /* token location, or -1 if unknown */
1961 
1962 /*
1963  * JsonAggConstructor -
1964  * common fields of untransformed representation of
1965  * JSON_ARRAYAGG() and JSON_OBJECTAGG()
1966  */
1967 typedef struct JsonAggConstructor
1968 {
1970  JsonOutput *output; /* RETURNING clause, if any */
1971  Node *agg_filter; /* FILTER clause, if any */
1972  List *agg_order; /* ORDER BY clause, if any */
1973  struct WindowDef *over; /* OVER clause, if any */
1974  ParseLoc location; /* token location, or -1 if unknown */
1976 
1977 /*
1978  * JsonObjectAgg -
1979  * untransformed representation of JSON_OBJECTAGG()
1980  */
1981 typedef struct JsonObjectAgg
1982 {
1984  JsonAggConstructor *constructor; /* common fields */
1985  JsonKeyValue *arg; /* object key-value pair */
1986  bool absent_on_null; /* skip NULL values? */
1987  bool unique; /* check key uniqueness? */
1989 
1990 /*
1991  * JsonArrayAgg -
1992  * untransformed representation of JSON_ARRAYAGG()
1993  */
1994 typedef struct JsonArrayAgg
1995 {
1997  JsonAggConstructor *constructor; /* common fields */
1998  JsonValueExpr *arg; /* array element expression */
1999  bool absent_on_null; /* skip NULL elements? */
2001 
2002 
2003 /*****************************************************************************
2004  * Raw Grammar Output Statements
2005  *****************************************************************************/
2006 
2007 /*
2008  * RawStmt --- container for any one statement's raw parse tree
2009  *
2010  * Parse analysis converts a raw parse tree headed by a RawStmt node into
2011  * an analyzed statement headed by a Query node. For optimizable statements,
2012  * the conversion is complex. For utility statements, the parser usually just
2013  * transfers the raw parse tree (sans RawStmt) into the utilityStmt field of
2014  * the Query node, and all the useful work happens at execution time.
2015  *
2016  * stmt_location/stmt_len identify the portion of the source text string
2017  * containing this raw statement (useful for multi-statement strings).
2018  *
2019  * This is irrelevant for query jumbling, as this is not used in parsed
2020  * queries.
2021  */
2022 typedef struct RawStmt
2023 {
2024  pg_node_attr(no_query_jumble)
2025 
2026  NodeTag type;
2027  Node *stmt; /* raw parse tree */
2028  ParseLoc stmt_location; /* start location, or -1 if unknown */
2029  ParseLoc stmt_len; /* length in bytes; 0 means "rest of string" */
2031 
2032 /*****************************************************************************
2033  * Optimizable Statements
2034  *****************************************************************************/
2035 
2036 /* ----------------------
2037  * Insert Statement
2038  *
2039  * The source expression is represented by SelectStmt for both the
2040  * SELECT and VALUES cases. If selectStmt is NULL, then the query
2041  * is INSERT ... DEFAULT VALUES.
2042  * ----------------------
2043  */
2044 typedef struct InsertStmt
2045 {
2047  RangeVar *relation; /* relation to insert into */
2048  List *cols; /* optional: names of the target columns */
2049  Node *selectStmt; /* the source SELECT/VALUES, or NULL */
2050  OnConflictClause *onConflictClause; /* ON CONFLICT clause */
2051  List *returningList; /* list of expressions to return */
2052  WithClause *withClause; /* WITH clause */
2053  OverridingKind override; /* OVERRIDING clause */
2055 
2056 /* ----------------------
2057  * Delete Statement
2058  * ----------------------
2059  */
2060 typedef struct DeleteStmt
2061 {
2063  RangeVar *relation; /* relation to delete from */
2064  List *usingClause; /* optional using clause for more tables */
2065  Node *whereClause; /* qualifications */
2066  List *returningList; /* list of expressions to return */
2067  WithClause *withClause; /* WITH clause */
2069 
2070 /* ----------------------
2071  * Update Statement
2072  * ----------------------
2073  */
2074 typedef struct UpdateStmt
2075 {
2077  RangeVar *relation; /* relation to update */
2078  List *targetList; /* the target list (of ResTarget) */
2079  Node *whereClause; /* qualifications */
2080  List *fromClause; /* optional from clause for more tables */
2081  List *returningList; /* list of expressions to return */
2082  WithClause *withClause; /* WITH clause */
2084 
2085 /* ----------------------
2086  * Merge Statement
2087  * ----------------------
2088  */
2089 typedef struct MergeStmt
2090 {
2092  RangeVar *relation; /* target relation to merge into */
2093  Node *sourceRelation; /* source relation */
2094  Node *joinCondition; /* join condition between source and target */
2095  List *mergeWhenClauses; /* list of MergeWhenClause(es) */
2096  List *returningList; /* list of expressions to return */
2097  WithClause *withClause; /* WITH clause */
2099 
2100 /* ----------------------
2101  * Select Statement
2102  *
2103  * A "simple" SELECT is represented in the output of gram.y by a single
2104  * SelectStmt node; so is a VALUES construct. A query containing set
2105  * operators (UNION, INTERSECT, EXCEPT) is represented by a tree of SelectStmt
2106  * nodes, in which the leaf nodes are component SELECTs and the internal nodes
2107  * represent UNION, INTERSECT, or EXCEPT operators. Using the same node
2108  * type for both leaf and internal nodes allows gram.y to stick ORDER BY,
2109  * LIMIT, etc, clause values into a SELECT statement without worrying
2110  * whether it is a simple or compound SELECT.
2111  * ----------------------
2112  */
2113 typedef enum SetOperation
2114 {
2120 
2121 typedef struct SelectStmt
2122 {
2124 
2125  /*
2126  * These fields are used only in "leaf" SelectStmts.
2127  */
2128  List *distinctClause; /* NULL, list of DISTINCT ON exprs, or
2129  * lcons(NIL,NIL) for all (SELECT DISTINCT) */
2130  IntoClause *intoClause; /* target for SELECT INTO */
2131  List *targetList; /* the target list (of ResTarget) */
2132  List *fromClause; /* the FROM clause */
2133  Node *whereClause; /* WHERE qualification */
2134  List *groupClause; /* GROUP BY clauses */
2135  bool groupDistinct; /* Is this GROUP BY DISTINCT? */
2136  Node *havingClause; /* HAVING conditional-expression */
2137  List *windowClause; /* WINDOW window_name AS (...), ... */
2138 
2139  /*
2140  * In a "leaf" node representing a VALUES list, the above fields are all
2141  * null, and instead this field is set. Note that the elements of the
2142  * sublists are just expressions, without ResTarget decoration. Also note
2143  * that a list element can be DEFAULT (represented as a SetToDefault
2144  * node), regardless of the context of the VALUES list. It's up to parse
2145  * analysis to reject that where not valid.
2146  */
2147  List *valuesLists; /* untransformed list of expression lists */
2148 
2149  /*
2150  * These fields are used in both "leaf" SelectStmts and upper-level
2151  * SelectStmts.
2152  */
2153  List *sortClause; /* sort clause (a list of SortBy's) */
2154  Node *limitOffset; /* # of result tuples to skip */
2155  Node *limitCount; /* # of result tuples to return */
2156  LimitOption limitOption; /* limit type */
2157  List *lockingClause; /* FOR UPDATE (list of LockingClause's) */
2158  WithClause *withClause; /* WITH clause */
2159 
2160  /*
2161  * These fields are used only in upper-level SelectStmts.
2162  */
2163  SetOperation op; /* type of set op */
2164  bool all; /* ALL specified? */
2165  struct SelectStmt *larg; /* left child */
2166  struct SelectStmt *rarg; /* right child */
2167  /* Eventually add fields for CORRESPONDING spec here */
2169 
2170 
2171 /* ----------------------
2172  * Set Operation node for post-analysis query trees
2173  *
2174  * After parse analysis, a SELECT with set operations is represented by a
2175  * top-level Query node containing the leaf SELECTs as subqueries in its
2176  * range table. Its setOperations field shows the tree of set operations,
2177  * with leaf SelectStmt nodes replaced by RangeTblRef nodes, and internal
2178  * nodes replaced by SetOperationStmt nodes. Information about the output
2179  * column types is added, too. (Note that the child nodes do not necessarily
2180  * produce these types directly, but we've checked that their output types
2181  * can be coerced to the output column type.) Also, if it's not UNION ALL,
2182  * information about the types' sort/group semantics is provided in the form
2183  * of a SortGroupClause list (same representation as, eg, DISTINCT).
2184  * The resolved common column collations are provided too; but note that if
2185  * it's not UNION ALL, it's okay for a column to not have a common collation,
2186  * so a member of the colCollations list could be InvalidOid even though the
2187  * column has a collatable type.
2188  * ----------------------
2189  */
2190 typedef struct SetOperationStmt
2191 {
2193  SetOperation op; /* type of set op */
2194  bool all; /* ALL specified? */
2195  Node *larg; /* left child */
2196  Node *rarg; /* right child */
2197  /* Eventually add fields for CORRESPONDING spec here */
2198 
2199  /* Fields derived during parse analysis (irrelevant for query jumbling): */
2200  /* OID list of output column type OIDs */
2201  List *colTypes pg_node_attr(query_jumble_ignore);
2202  /* integer list of output column typmods */
2203  List *colTypmods pg_node_attr(query_jumble_ignore);
2204  /* OID list of output column collation OIDs */
2205  List *colCollations pg_node_attr(query_jumble_ignore);
2206  /* a list of SortGroupClause's */
2207  List *groupClauses pg_node_attr(query_jumble_ignore);
2208  /* groupClauses is NIL if UNION ALL, but must be set otherwise */
2210 
2211 
2212 /*
2213  * RETURN statement (inside SQL function body)
2214  */
2215 typedef struct ReturnStmt
2216 {
2220 
2221 
2222 /* ----------------------
2223  * PL/pgSQL Assignment Statement
2224  *
2225  * Like SelectStmt, this is transformed into a SELECT Query.
2226  * However, the targetlist of the result looks more like an UPDATE.
2227  * ----------------------
2228  */
2229 typedef struct PLAssignStmt
2230 {
2232 
2233  char *name; /* initial column name */
2234  List *indirection; /* subscripts and field names, if any */
2235  int nnames; /* number of names to use in ColumnRef */
2236  SelectStmt *val; /* the PL/pgSQL expression to assign */
2237  ParseLoc location; /* name's token location, or -1 if unknown */
2239 
2240 
2241 /*****************************************************************************
2242  * Other Statements (no optimizations required)
2243  *
2244  * These are not touched by parser/analyze.c except to put them into
2245  * the utilityStmt field of a Query. This is eventually passed to
2246  * ProcessUtility (by-passing rewriting and planning). Some of the
2247  * statements do need attention from parse analysis, and this is
2248  * done by routines in parser/parse_utilcmd.c after ProcessUtility
2249  * receives the command for execution.
2250  * DECLARE CURSOR, EXPLAIN, and CREATE TABLE AS are special cases:
2251  * they contain optimizable statements, which get processed normally
2252  * by parser/analyze.c.
2253  *****************************************************************************/
2254 
2255 /*
2256  * When a command can act on several kinds of objects with only one
2257  * parse structure required, use these constants to designate the
2258  * object type. Note that commands typically don't support all the types.
2259  */
2260 
2261 typedef enum ObjectType
2262 {
2267  OBJECT_ATTRIBUTE, /* type's attribute, when distinct from column */
2316 
2317 /* ----------------------
2318  * Create Schema Statement
2319  *
2320  * NOTE: the schemaElts list contains raw parsetrees for component statements
2321  * of the schema, such as CREATE TABLE, GRANT, etc. These are analyzed and
2322  * executed after the schema itself is created.
2323  * ----------------------
2324  */
2325 typedef struct CreateSchemaStmt
2326 {
2328  char *schemaname; /* the name of the schema to create */
2329  RoleSpec *authrole; /* the owner of the created schema */
2330  List *schemaElts; /* schema components (list of parsenodes) */
2331  bool if_not_exists; /* just do nothing if schema already exists? */
2333 
2334 typedef enum DropBehavior
2335 {
2336  DROP_RESTRICT, /* drop fails if any dependent objects */
2337  DROP_CASCADE, /* remove dependent objects too */
2339 
2340 /* ----------------------
2341  * Alter Table
2342  * ----------------------
2343  */
2344 typedef struct AlterTableStmt
2345 {
2347  RangeVar *relation; /* table to work on */
2348  List *cmds; /* list of subcommands */
2349  ObjectType objtype; /* type of object */
2350  bool missing_ok; /* skip error if table missing */
2352 
2353 typedef enum AlterTableType
2354 {
2355  AT_AddColumn, /* add column */
2356  AT_AddColumnToView, /* implicitly via CREATE OR REPLACE VIEW */
2357  AT_ColumnDefault, /* alter column default */
2358  AT_CookedColumnDefault, /* add a pre-cooked column default */
2359  AT_DropNotNull, /* alter column drop not null */
2360  AT_SetNotNull, /* alter column set not null */
2361  AT_SetAttNotNull, /* set attnotnull w/o a constraint */
2362  AT_SetExpression, /* alter column set expression */
2363  AT_DropExpression, /* alter column drop expression */
2364  AT_SetStatistics, /* alter column set statistics */
2365  AT_SetOptions, /* alter column set ( options ) */
2366  AT_ResetOptions, /* alter column reset ( options ) */
2367  AT_SetStorage, /* alter column set storage */
2368  AT_SetCompression, /* alter column set compression */
2369  AT_DropColumn, /* drop column */
2370  AT_AddIndex, /* add index */
2371  AT_ReAddIndex, /* internal to commands/tablecmds.c */
2372  AT_AddConstraint, /* add constraint */
2373  AT_ReAddConstraint, /* internal to commands/tablecmds.c */
2374  AT_ReAddDomainConstraint, /* internal to commands/tablecmds.c */
2375  AT_AlterConstraint, /* alter constraint */
2376  AT_ValidateConstraint, /* validate constraint */
2377  AT_AddIndexConstraint, /* add constraint using existing index */
2378  AT_DropConstraint, /* drop constraint */
2379  AT_ReAddComment, /* internal to commands/tablecmds.c */
2380  AT_AlterColumnType, /* alter column type */
2381  AT_AlterColumnGenericOptions, /* alter column OPTIONS (...) */
2382  AT_ChangeOwner, /* change owner */
2383  AT_ClusterOn, /* CLUSTER ON */
2384  AT_DropCluster, /* SET WITHOUT CLUSTER */
2385  AT_SetLogged, /* SET LOGGED */
2386  AT_SetUnLogged, /* SET UNLOGGED */
2387  AT_DropOids, /* SET WITHOUT OIDS */
2388  AT_SetAccessMethod, /* SET ACCESS METHOD */
2389  AT_SetTableSpace, /* SET TABLESPACE */
2390  AT_SetRelOptions, /* SET (...) -- AM specific parameters */
2391  AT_ResetRelOptions, /* RESET (...) -- AM specific parameters */
2392  AT_ReplaceRelOptions, /* replace reloption list in its entirety */
2393  AT_EnableTrig, /* ENABLE TRIGGER name */
2394  AT_EnableAlwaysTrig, /* ENABLE ALWAYS TRIGGER name */
2395  AT_EnableReplicaTrig, /* ENABLE REPLICA TRIGGER name */
2396  AT_DisableTrig, /* DISABLE TRIGGER name */
2397  AT_EnableTrigAll, /* ENABLE TRIGGER ALL */
2398  AT_DisableTrigAll, /* DISABLE TRIGGER ALL */
2399  AT_EnableTrigUser, /* ENABLE TRIGGER USER */
2400  AT_DisableTrigUser, /* DISABLE TRIGGER USER */
2401  AT_EnableRule, /* ENABLE RULE name */
2402  AT_EnableAlwaysRule, /* ENABLE ALWAYS RULE name */
2403  AT_EnableReplicaRule, /* ENABLE REPLICA RULE name */
2404  AT_DisableRule, /* DISABLE RULE name */
2405  AT_AddInherit, /* INHERIT parent */
2406  AT_DropInherit, /* NO INHERIT parent */
2407  AT_AddOf, /* OF <type_name> */
2408  AT_DropOf, /* NOT OF */
2409  AT_ReplicaIdentity, /* REPLICA IDENTITY */
2410  AT_EnableRowSecurity, /* ENABLE ROW SECURITY */
2411  AT_DisableRowSecurity, /* DISABLE ROW SECURITY */
2412  AT_ForceRowSecurity, /* FORCE ROW SECURITY */
2413  AT_NoForceRowSecurity, /* NO FORCE ROW SECURITY */
2414  AT_GenericOptions, /* OPTIONS (...) */
2415  AT_AttachPartition, /* ATTACH PARTITION */
2416  AT_DetachPartition, /* DETACH PARTITION */
2417  AT_DetachPartitionFinalize, /* DETACH PARTITION FINALIZE */
2418  AT_SplitPartition, /* SPLIT PARTITION */
2419  AT_MergePartitions, /* MERGE PARTITIONS */
2420  AT_AddIdentity, /* ADD IDENTITY */
2421  AT_SetIdentity, /* SET identity column options */
2422  AT_DropIdentity, /* DROP IDENTITY */
2423  AT_ReAddStatistics, /* internal to commands/tablecmds.c */
2425 
2426 typedef struct ReplicaIdentityStmt
2427 {
2430  char *name;
2432 
2433 typedef struct AlterTableCmd /* one subcommand of an ALTER TABLE */
2434 {
2436  AlterTableType subtype; /* Type of table alteration to apply */
2437  char *name; /* column, constraint, or trigger to act on,
2438  * or tablespace, access method */
2439  int16 num; /* attribute number for columns referenced by
2440  * number */
2442  Node *def; /* definition of new column, index,
2443  * constraint, or parent table */
2444  DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */
2445  bool missing_ok; /* skip error if missing? */
2446  bool recurse; /* exec-time recursion */
2448 
2449 
2450 /* ----------------------
2451  * Alter Collation
2452  * ----------------------
2453  */
2454 typedef struct AlterCollationStmt
2455 {
2459 
2460 
2461 /* ----------------------
2462  * Alter Domain
2463  *
2464  * The fields are used in different ways by the different variants of
2465  * this command.
2466  * ----------------------
2467  */
2468 typedef struct AlterDomainStmt
2469 {
2471  char subtype; /*------------
2472  * T = alter column default
2473  * N = alter column drop not null
2474  * O = alter column set not null
2475  * C = add constraint
2476  * X = drop constraint
2477  *------------
2478  */
2479  List *typeName; /* domain to work on */
2480  char *name; /* column or constraint name to act on */
2481  Node *def; /* definition of default or constraint */
2482  DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */
2483  bool missing_ok; /* skip error if missing? */
2485 
2486 
2487 /* ----------------------
2488  * Grant|Revoke Statement
2489  * ----------------------
2490  */
2491 typedef enum GrantTargetType
2492 {
2493  ACL_TARGET_OBJECT, /* grant on specific named object(s) */
2494  ACL_TARGET_ALL_IN_SCHEMA, /* grant on all objects in given schema(s) */
2495  ACL_TARGET_DEFAULTS, /* ALTER DEFAULT PRIVILEGES */
2497 
2498 typedef struct GrantStmt
2499 {
2501  bool is_grant; /* true = GRANT, false = REVOKE */
2502  GrantTargetType targtype; /* type of the grant target */
2503  ObjectType objtype; /* kind of object being operated on */
2504  List *objects; /* list of RangeVar nodes, ObjectWithArgs
2505  * nodes, or plain names (as String values) */
2506  List *privileges; /* list of AccessPriv nodes */
2507  /* privileges == NIL denotes ALL PRIVILEGES */
2508  List *grantees; /* list of RoleSpec nodes */
2509  bool grant_option; /* grant or revoke grant option */
2511  DropBehavior behavior; /* drop behavior (for REVOKE) */
2513 
2514 /*
2515  * ObjectWithArgs represents a function/procedure/operator name plus parameter
2516  * identification.
2517  *
2518  * objargs includes only the types of the input parameters of the object.
2519  * In some contexts, that will be all we have, and it's enough to look up
2520  * objects according to the traditional Postgres rules (i.e., when only input
2521  * arguments matter).
2522  *
2523  * objfuncargs, if not NIL, carries the full specification of the parameter
2524  * list, including parameter mode annotations.
2525  *
2526  * Some grammar productions can set args_unspecified = true instead of
2527  * providing parameter info. In this case, lookup will succeed only if
2528  * the object name is unique. Note that otherwise, NIL parameter lists
2529  * mean zero arguments.
2530  */
2531 typedef struct ObjectWithArgs
2532 {
2534  List *objname; /* qualified name of function/operator */
2535  List *objargs; /* list of Typename nodes (input args only) */
2536  List *objfuncargs; /* list of FunctionParameter nodes */
2537  bool args_unspecified; /* argument list was omitted? */
2539 
2540 /*
2541  * An access privilege, with optional list of column names
2542  * priv_name == NULL denotes ALL PRIVILEGES (only used with a column list)
2543  * cols == NIL denotes "all columns"
2544  * Note that simple "ALL PRIVILEGES" is represented as a NIL list, not
2545  * an AccessPriv with both fields null.
2546  */
2547 typedef struct AccessPriv
2548 {
2550  char *priv_name; /* string name of privilege */
2551  List *cols; /* list of String */
2553 
2554 /* ----------------------
2555  * Grant/Revoke Role Statement
2556  *
2557  * Note: because of the parsing ambiguity with the GRANT <privileges>
2558  * statement, granted_roles is a list of AccessPriv; the execution code
2559  * should complain if any column lists appear. grantee_roles is a list
2560  * of role names, as String values.
2561  * ----------------------
2562  */
2563 typedef struct GrantRoleStmt
2564 {
2566  List *granted_roles; /* list of roles to be granted/revoked */
2567  List *grantee_roles; /* list of member roles to add/delete */
2568  bool is_grant; /* true = GRANT, false = REVOKE */
2569  List *opt; /* options e.g. WITH GRANT OPTION */
2570  RoleSpec *grantor; /* set grantor to other than current role */
2571  DropBehavior behavior; /* drop behavior (for REVOKE) */
2573 
2574 /* ----------------------
2575  * Alter Default Privileges Statement
2576  * ----------------------
2577  */
2579 {
2581  List *options; /* list of DefElem */
2582  GrantStmt *action; /* GRANT/REVOKE action (with objects=NIL) */
2584 
2585 /* ----------------------
2586  * Copy Statement
2587  *
2588  * We support "COPY relation FROM file", "COPY relation TO file", and
2589  * "COPY (query) TO file". In any given CopyStmt, exactly one of "relation"
2590  * and "query" must be non-NULL.
2591  * ----------------------
2592  */
2593 typedef struct CopyStmt
2594 {
2596  RangeVar *relation; /* the relation to copy */
2597  Node *query; /* the query (SELECT or DML statement with
2598  * RETURNING) to copy, as a raw parse tree */
2599  List *attlist; /* List of column names (as Strings), or NIL
2600  * for all columns */
2601  bool is_from; /* TO or FROM */
2602  bool is_program; /* is 'filename' a program to popen? */
2603  char *filename; /* filename, or NULL for STDIN/STDOUT */
2604  List *options; /* List of DefElem nodes */
2605  Node *whereClause; /* WHERE condition (or NULL) */
2607 
2608 /* ----------------------
2609  * SET Statement (includes RESET)
2610  *
2611  * "SET var TO DEFAULT" and "RESET var" are semantically equivalent, but we
2612  * preserve the distinction in VariableSetKind for CreateCommandTag().
2613  * ----------------------
2614  */
2615 typedef enum VariableSetKind
2616 {
2617  VAR_SET_VALUE, /* SET var = value */
2618  VAR_SET_DEFAULT, /* SET var TO DEFAULT */
2619  VAR_SET_CURRENT, /* SET var FROM CURRENT */
2620  VAR_SET_MULTI, /* special case for SET TRANSACTION ... */
2621  VAR_RESET, /* RESET var */
2622  VAR_RESET_ALL, /* RESET ALL */
2624 
2625 typedef struct VariableSetStmt
2626 {
2629  char *name; /* variable to be set */
2630  List *args; /* List of A_Const nodes */
2631  bool is_local; /* SET LOCAL? */
2633 
2634 /* ----------------------
2635  * Show Statement
2636  * ----------------------
2637  */
2638 typedef struct VariableShowStmt
2639 {
2641  char *name;
2643 
2644 /* ----------------------
2645  * Create Table Statement
2646  *
2647  * NOTE: in the raw gram.y output, ColumnDef and Constraint nodes are
2648  * intermixed in tableElts, and constraints and nnconstraints are NIL. After
2649  * parse analysis, tableElts contains just ColumnDefs, nnconstraints contains
2650  * Constraint nodes of CONSTR_NOTNULL type from various sources, and
2651  * constraints contains just CONSTR_CHECK Constraint nodes.
2652  * ----------------------
2653  */
2654 
2655 typedef struct CreateStmt
2656 {
2658  RangeVar *relation; /* relation to create */
2659  List *tableElts; /* column definitions (list of ColumnDef) */
2660  List *inhRelations; /* relations to inherit from (list of
2661  * RangeVar) */
2662  PartitionBoundSpec *partbound; /* FOR VALUES clause */
2663  PartitionSpec *partspec; /* PARTITION BY clause */
2664  TypeName *ofTypename; /* OF typename */
2665  List *constraints; /* constraints (list of Constraint nodes) */
2666  List *nnconstraints; /* NOT NULL constraints (ditto) */
2667  List *options; /* options from WITH clause */
2668  OnCommitAction oncommit; /* what do we do at COMMIT? */
2669  char *tablespacename; /* table space to use, or NULL */
2670  char *accessMethod; /* table access method */
2671  bool if_not_exists; /* just do nothing if it already exists? */
2673 
2674 /* ----------
2675  * Definitions for constraints in CreateStmt
2676  *
2677  * Note that column defaults are treated as a type of constraint,
2678  * even though that's a bit odd semantically.
2679  *
2680  * For constraints that use expressions (CONSTR_CHECK, CONSTR_DEFAULT)
2681  * we may have the expression in either "raw" form (an untransformed
2682  * parse tree) or "cooked" form (the nodeToString representation of
2683  * an executable expression tree), depending on how this Constraint
2684  * node was created (by parsing, or by inheritance from an existing
2685  * relation). We should never have both in the same node!
2686  *
2687  * FKCONSTR_ACTION_xxx values are stored into pg_constraint.confupdtype
2688  * and pg_constraint.confdeltype columns; FKCONSTR_MATCH_xxx values are
2689  * stored into pg_constraint.confmatchtype. Changing the code values may
2690  * require an initdb!
2691  *
2692  * If skip_validation is true then we skip checking that the existing rows
2693  * in the table satisfy the constraint, and just install the catalog entries
2694  * for the constraint. A new FK constraint is marked as valid iff
2695  * initially_valid is true. (Usually skip_validation and initially_valid
2696  * are inverses, but we can set both true if the table is known empty.)
2697  *
2698  * Constraint attributes (DEFERRABLE etc) are initially represented as
2699  * separate Constraint nodes for simplicity of parsing. parse_utilcmd.c makes
2700  * a pass through the constraints list to insert the info into the appropriate
2701  * Constraint node.
2702  * ----------
2703  */
2704 
2705 typedef enum ConstrType /* types of constraints */
2706 {
2707  CONSTR_NULL, /* not standard SQL, but a lot of people
2708  * expect it */
2718  CONSTR_ATTR_DEFERRABLE, /* attributes for previous constraint node */
2723 
2724 /* Foreign key action codes */
2725 #define FKCONSTR_ACTION_NOACTION 'a'
2726 #define FKCONSTR_ACTION_RESTRICT 'r'
2727 #define FKCONSTR_ACTION_CASCADE 'c'
2728 #define FKCONSTR_ACTION_SETNULL 'n'
2729 #define FKCONSTR_ACTION_SETDEFAULT 'd'
2730 
2731 /* Foreign key matchtype codes */
2732 #define FKCONSTR_MATCH_FULL 'f'
2733 #define FKCONSTR_MATCH_PARTIAL 'p'
2734 #define FKCONSTR_MATCH_SIMPLE 's'
2735 
2736 typedef struct Constraint
2737 {
2739  ConstrType contype; /* see above */
2740  char *conname; /* Constraint name, or NULL if unnamed */
2741  bool deferrable; /* DEFERRABLE? */
2742  bool initdeferred; /* INITIALLY DEFERRED? */
2743  bool skip_validation; /* skip validation of existing rows? */
2744  bool initially_valid; /* mark the new constraint as valid? */
2745  bool is_no_inherit; /* is constraint non-inheritable? */
2746  Node *raw_expr; /* CHECK or DEFAULT expression, as
2747  * untransformed parse tree */
2748  char *cooked_expr; /* CHECK or DEFAULT expression, as
2749  * nodeToString representation */
2750  char generated_when; /* ALWAYS or BY DEFAULT */
2751  int inhcount; /* initial inheritance count to apply, for
2752  * "raw" NOT NULL constraints */
2753  bool nulls_not_distinct; /* null treatment for UNIQUE constraints */
2754  List *keys; /* String nodes naming referenced key
2755  * column(s); for UNIQUE/PK/NOT NULL */
2756  bool without_overlaps; /* WITHOUT OVERLAPS specified */
2757  List *including; /* String nodes naming referenced nonkey
2758  * column(s); for UNIQUE/PK */
2759  List *exclusions; /* list of (IndexElem, operator name) pairs;
2760  * for exclusion constraints */
2761  List *options; /* options from WITH clause */
2762  char *indexname; /* existing index to use; otherwise NULL */
2763  char *indexspace; /* index tablespace; NULL for default */
2764  bool reset_default_tblspc; /* reset default_tablespace prior to
2765  * creating the index */
2766  char *access_method; /* index access method; NULL for default */
2767  Node *where_clause; /* partial index predicate */
2768 
2769  /* Fields used for FOREIGN KEY constraints: */
2770  RangeVar *pktable; /* Primary key table */
2771  List *fk_attrs; /* Attributes of foreign key */
2772  List *pk_attrs; /* Corresponding attrs in PK table */
2773  bool fk_with_period; /* Last attribute of FK uses PERIOD */
2774  bool pk_with_period; /* Last attribute of PK uses PERIOD */
2775  char fk_matchtype; /* FULL, PARTIAL, SIMPLE */
2776  char fk_upd_action; /* ON UPDATE action */
2777  char fk_del_action; /* ON DELETE action */
2778  List *fk_del_set_cols; /* ON DELETE SET NULL/DEFAULT (col1, col2) */
2779  List *old_conpfeqop; /* pg_constraint.conpfeqop of my former self */
2780  Oid old_pktable_oid; /* pg_constraint.confrelid of my former
2781  * self */
2782 
2783  ParseLoc location; /* token location, or -1 if unknown */
2785 
2786 /* ----------------------
2787  * Create/Drop Table Space Statements
2788  * ----------------------
2789  */
2790 
2791 typedef struct CreateTableSpaceStmt
2792 {
2796  char *location;
2799 
2800 typedef struct DropTableSpaceStmt
2801 {
2804  bool missing_ok; /* skip error if missing? */
2806 
2808 {
2812  bool isReset;
2814 
2816 {
2819  ObjectType objtype; /* Object type to move */
2820  List *roles; /* List of roles to move objects of */
2822  bool nowait;
2824 
2825 /* ----------------------
2826  * Create/Alter Extension Statements
2827  * ----------------------
2828  */
2829 
2830 typedef struct CreateExtensionStmt
2831 {
2833  char *extname;
2834  bool if_not_exists; /* just do nothing if it already exists? */
2835  List *options; /* List of DefElem nodes */
2837 
2838 /* Only used for ALTER EXTENSION UPDATE; later might need an action field */
2839 typedef struct AlterExtensionStmt
2840 {
2842  char *extname;
2843  List *options; /* List of DefElem nodes */
2845 
2847 {
2849  char *extname; /* Extension's name */
2850  int action; /* +1 = add object, -1 = drop object */
2851  ObjectType objtype; /* Object's type */
2852  Node *object; /* Qualified name of the object */
2854 
2855 /* ----------------------
2856  * Create/Alter FOREIGN DATA WRAPPER Statements
2857  * ----------------------
2858  */
2859 
2860 typedef struct CreateFdwStmt
2861 {
2863  char *fdwname; /* foreign-data wrapper name */
2864  List *func_options; /* HANDLER/VALIDATOR options */
2865  List *options; /* generic options to FDW */
2867 
2868 typedef struct AlterFdwStmt
2869 {
2871  char *fdwname; /* foreign-data wrapper name */
2872  List *func_options; /* HANDLER/VALIDATOR options */
2873  List *options; /* generic options to FDW */
2875 
2876 /* ----------------------
2877  * Create/Alter FOREIGN SERVER Statements
2878  * ----------------------
2879  */
2880 
2882 {
2884  char *servername; /* server name */
2885  char *servertype; /* optional server type */
2886  char *version; /* optional server version */
2887  char *fdwname; /* FDW name */
2888  bool if_not_exists; /* just do nothing if it already exists? */
2889  List *options; /* generic options to server */
2891 
2893 {
2895  char *servername; /* server name */
2896  char *version; /* optional server version */
2897  List *options; /* generic options to server */
2898  bool has_version; /* version specified */
2900 
2901 /* ----------------------
2902  * Create FOREIGN TABLE Statement
2903  * ----------------------
2904  */
2905 
2907 {
2909  char *servername;
2912 
2913 /* ----------------------
2914  * Create/Drop USER MAPPING Statements
2915  * ----------------------
2916  */
2917 
2919 {
2921  RoleSpec *user; /* user role */
2922  char *servername; /* server name */
2923  bool if_not_exists; /* just do nothing if it already exists? */
2924  List *options; /* generic options to server */
2926 
2927 typedef struct AlterUserMappingStmt
2928 {
2930  RoleSpec *user; /* user role */
2931  char *servername; /* server name */
2932  List *options; /* generic options to server */
2934 
2935 typedef struct DropUserMappingStmt
2936 {
2938  RoleSpec *user; /* user role */
2939  char *servername; /* server name */
2940  bool missing_ok; /* ignore missing mappings */
2942 
2943 /* ----------------------
2944  * Import Foreign Schema Statement
2945  * ----------------------
2946  */
2947 
2949 {
2950  FDW_IMPORT_SCHEMA_ALL, /* all relations wanted */
2951  FDW_IMPORT_SCHEMA_LIMIT_TO, /* include only listed tables in import */
2952  FDW_IMPORT_SCHEMA_EXCEPT, /* exclude listed tables from import */
2954 
2956 {
2958  char *server_name; /* FDW server name */
2959  char *remote_schema; /* remote schema name to query */
2960  char *local_schema; /* local schema to create objects in */
2961  ImportForeignSchemaType list_type; /* type of table list */
2962  List *table_list; /* List of RangeVar */
2963  List *options; /* list of options to pass to FDW */
2965 
2966 /*----------------------
2967  * Create POLICY Statement
2968  *----------------------
2969  */
2970 typedef struct CreatePolicyStmt
2971 {
2973  char *policy_name; /* Policy's name */
2974  RangeVar *table; /* the table name the policy applies to */
2975  char *cmd_name; /* the command name the policy applies to */
2976  bool permissive; /* restrictive or permissive policy */
2977  List *roles; /* the roles associated with the policy */
2978  Node *qual; /* the policy's condition */
2979  Node *with_check; /* the policy's WITH CHECK condition. */
2981 
2982 /*----------------------
2983  * Alter POLICY Statement
2984  *----------------------
2985  */
2986 typedef struct AlterPolicyStmt
2987 {
2989  char *policy_name; /* Policy's name */
2990  RangeVar *table; /* the table name the policy applies to */
2991  List *roles; /* the roles associated with the policy */
2992  Node *qual; /* the policy's condition */
2993  Node *with_check; /* the policy's WITH CHECK condition. */
2995 
2996 /*----------------------
2997  * Create ACCESS METHOD Statement
2998  *----------------------
2999  */
3000 typedef struct CreateAmStmt
3001 {
3003  char *amname; /* access method name */
3004  List *handler_name; /* handler function name */
3005  char amtype; /* type of access method */
3007 
3008 /* ----------------------
3009  * Create TRIGGER Statement
3010  * ----------------------
3011  */
3012 typedef struct CreateTrigStmt
3013 {
3015  bool replace; /* replace trigger if already exists */
3016  bool isconstraint; /* This is a constraint trigger */
3017  char *trigname; /* TRIGGER's name */
3018  RangeVar *relation; /* relation trigger is on */
3019  List *funcname; /* qual. name of function to call */
3020  List *args; /* list of String or NIL */
3021  bool row; /* ROW/STATEMENT */
3022  /* timing uses the TRIGGER_TYPE bits defined in catalog/pg_trigger.h */
3023  int16 timing; /* BEFORE, AFTER, or INSTEAD */
3024  /* events uses the TRIGGER_TYPE bits defined in catalog/pg_trigger.h */
3025  int16 events; /* "OR" of INSERT/UPDATE/DELETE/TRUNCATE */
3026  List *columns; /* column names, or NIL for all columns */
3027  Node *whenClause; /* qual expression, or NULL if none */
3028  /* explicitly named transition data */
3029  List *transitionRels; /* TriggerTransition nodes, or NIL if none */
3030  /* The remaining fields are only used for constraint triggers */
3031  bool deferrable; /* [NOT] DEFERRABLE */
3032  bool initdeferred; /* INITIALLY {DEFERRED|IMMEDIATE} */
3033  RangeVar *constrrel; /* opposite relation, if RI trigger */
3035 
3036 /* ----------------------
3037  * Create EVENT TRIGGER Statement
3038  * ----------------------
3039  */
3040 typedef struct CreateEventTrigStmt
3041 {
3043  char *trigname; /* TRIGGER's name */
3044  char *eventname; /* event's identifier */
3045  List *whenclause; /* list of DefElems indicating filtering */
3046  List *funcname; /* qual. name of function to call */
3048 
3049 /* ----------------------
3050  * Alter EVENT TRIGGER Statement
3051  * ----------------------
3052  */
3053 typedef struct AlterEventTrigStmt
3054 {
3056  char *trigname; /* TRIGGER's name */
3057  char tgenabled; /* trigger's firing configuration WRT
3058  * session_replication_role */
3060 
3061 /* ----------------------
3062  * Create LANGUAGE Statements
3063  * ----------------------
3064  */
3065 typedef struct CreatePLangStmt
3066 {
3068  bool replace; /* T => replace if already exists */
3069  char *plname; /* PL name */
3070  List *plhandler; /* PL call handler function (qual. name) */
3071  List *plinline; /* optional inline function (qual. name) */
3072  List *plvalidator; /* optional validator function (qual. name) */
3073  bool pltrusted; /* PL is trusted */
3075 
3076 /* ----------------------
3077  * Create/Alter/Drop Role Statements
3078  *
3079  * Note: these node types are also used for the backwards-compatible
3080  * Create/Alter/Drop User/Group statements. In the ALTER and DROP cases
3081  * there's really no need to distinguish what the original spelling was,
3082  * but for CREATE we mark the type because the defaults vary.
3083  * ----------------------
3084  */
3085 typedef enum RoleStmtType
3086 {
3091 
3092 typedef struct CreateRoleStmt
3093 {
3095  RoleStmtType stmt_type; /* ROLE/USER/GROUP */
3096  char *role; /* role name */
3097  List *options; /* List of DefElem nodes */
3099 
3100 typedef struct AlterRoleStmt
3101 {
3103  RoleSpec *role; /* role */
3104  List *options; /* List of DefElem nodes */
3105  int action; /* +1 = add members, -1 = drop members */
3107 
3108 typedef struct AlterRoleSetStmt
3109 {
3111  RoleSpec *role; /* role */
3112  char *database; /* database name, or NULL */
3113  VariableSetStmt *setstmt; /* SET or RESET subcommand */
3115 
3116 typedef struct DropRoleStmt
3117 {
3119  List *roles; /* List of roles to remove */
3120  bool missing_ok; /* skip error if a role is missing? */
3122 
3123 /* ----------------------
3124  * {Create|Alter} SEQUENCE Statement
3125  * ----------------------
3126  */
3127 
3128 typedef struct CreateSeqStmt
3129 {
3131  RangeVar *sequence; /* the sequence to create */
3133  Oid ownerId; /* ID of owner, or InvalidOid for default */
3135  bool if_not_exists; /* just do nothing if it already exists? */
3137 
3138 typedef struct AlterSeqStmt
3139 {
3141  RangeVar *sequence; /* the sequence to alter */
3144  bool missing_ok; /* skip error if a role is missing? */
3146 
3147 /* ----------------------
3148  * Create {Aggregate|Operator|Type} Statement
3149  * ----------------------
3150  */
3151 typedef struct DefineStmt
3152 {
3154  ObjectType kind; /* aggregate, operator, type */
3155  bool oldstyle; /* hack to signal old CREATE AGG syntax */
3156  List *defnames; /* qualified name (list of String) */
3157  List *args; /* a list of TypeName (if needed) */
3158  List *definition; /* a list of DefElem */
3159  bool if_not_exists; /* just do nothing if it already exists? */
3160  bool replace; /* replace if already exists? */
3162 
3163 /* ----------------------
3164  * Create Domain Statement
3165  * ----------------------
3166  */
3167 typedef struct CreateDomainStmt
3168 {
3170  List *domainname; /* qualified name (list of String) */
3171  TypeName *typeName; /* the base type */
3172  CollateClause *collClause; /* untransformed COLLATE spec, if any */
3173  List *constraints; /* constraints (list of Constraint nodes) */
3175 
3176 /* ----------------------
3177  * Create Operator Class Statement
3178  * ----------------------
3179  */
3180 typedef struct CreateOpClassStmt
3181 {
3183  List *opclassname; /* qualified name (list of String) */
3184  List *opfamilyname; /* qualified name (ditto); NIL if omitted */
3185  char *amname; /* name of index AM opclass is for */
3186  TypeName *datatype; /* datatype of indexed column */
3187  List *items; /* List of CreateOpClassItem nodes */
3188  bool isDefault; /* Should be marked as default for type? */
3190 
3191 #define OPCLASS_ITEM_OPERATOR 1
3192 #define OPCLASS_ITEM_FUNCTION 2
3193 #define OPCLASS_ITEM_STORAGETYPE 3
3194 
3195 typedef struct CreateOpClassItem
3196 {
3198  int itemtype; /* see codes above */
3199  ObjectWithArgs *name; /* operator or function name and args */
3200  int number; /* strategy num or support proc num */
3201  List *order_family; /* only used for ordering operators */
3202  List *class_args; /* amproclefttype/amprocrighttype or
3203  * amoplefttype/amoprighttype */
3204  /* fields used for a storagetype item: */
3205  TypeName *storedtype; /* datatype stored in index */
3207 
3208 /* ----------------------
3209  * Create Operator Family Statement
3210  * ----------------------
3211  */
3212 typedef struct CreateOpFamilyStmt
3213 {
3215  List *opfamilyname; /* qualified name (list of String) */
3216  char *amname; /* name of index AM opfamily is for */
3218 
3219 /* ----------------------
3220  * Alter Operator Family Statement
3221  * ----------------------
3222  */
3223 typedef struct AlterOpFamilyStmt
3224 {
3226  List *opfamilyname; /* qualified name (list of String) */
3227  char *amname; /* name of index AM opfamily is for */
3228  bool isDrop; /* ADD or DROP the items? */
3229  List *items; /* List of CreateOpClassItem nodes */
3231 
3232 /* ----------------------
3233  * Drop Table|Sequence|View|Index|Type|Domain|Conversion|Schema Statement
3234  * ----------------------
3235  */
3236 
3237 typedef struct DropStmt
3238 {
3240  List *objects; /* list of names */
3241  ObjectType removeType; /* object type */
3242  DropBehavior behavior; /* RESTRICT or CASCADE behavior */
3243  bool missing_ok; /* skip error if object is missing? */
3244  bool concurrent; /* drop index concurrently? */
3246 
3247 /* ----------------------
3248  * Truncate Table Statement
3249  * ----------------------
3250  */
3251 typedef struct TruncateStmt
3252 {
3254  List *relations; /* relations (RangeVars) to be truncated */
3255  bool restart_seqs; /* restart owned sequences? */
3256  DropBehavior behavior; /* RESTRICT or CASCADE behavior */
3258 
3259 /* ----------------------
3260  * Comment On Statement
3261  * ----------------------
3262  */
3263 typedef struct CommentStmt
3264 {
3266  ObjectType objtype; /* Object's type */
3267  Node *object; /* Qualified name of the object */
3268  char *comment; /* Comment to insert, or NULL to remove */
3270 
3271 /* ----------------------
3272  * SECURITY LABEL Statement
3273  * ----------------------
3274  */
3275 typedef struct SecLabelStmt
3276 {
3278  ObjectType objtype; /* Object's type */
3279  Node *object; /* Qualified name of the object */
3280  char *provider; /* Label provider (or NULL) */
3281  char *label; /* New security label to be assigned */
3283 
3284 /* ----------------------
3285  * Declare Cursor Statement
3286  *
3287  * The "query" field is initially a raw parse tree, and is converted to a
3288  * Query node during parse analysis. Note that rewriting and planning
3289  * of the query are always postponed until execution.
3290  * ----------------------
3291  */
3292 #define CURSOR_OPT_BINARY 0x0001 /* BINARY */
3293 #define CURSOR_OPT_SCROLL 0x0002 /* SCROLL explicitly given */
3294 #define CURSOR_OPT_NO_SCROLL 0x0004 /* NO SCROLL explicitly given */
3295 #define CURSOR_OPT_INSENSITIVE 0x0008 /* INSENSITIVE */
3296 #define CURSOR_OPT_ASENSITIVE 0x0010 /* ASENSITIVE */
3297 #define CURSOR_OPT_HOLD 0x0020 /* WITH HOLD */
3298 /* these planner-control flags do not correspond to any SQL grammar: */
3299 #define CURSOR_OPT_FAST_PLAN 0x0100 /* prefer fast-start plan */
3300 #define CURSOR_OPT_GENERIC_PLAN 0x0200 /* force use of generic plan */
3301 #define CURSOR_OPT_CUSTOM_PLAN 0x0400 /* force use of custom plan */
3302 #define CURSOR_OPT_PARALLEL_OK 0x0800 /* parallel mode OK */
3303 
3304 typedef struct DeclareCursorStmt
3305 {
3307  char *portalname; /* name of the portal (cursor) */
3308  int options; /* bitmask of options (see above) */
3309  Node *query; /* the query (see comments above) */
3311 
3312 /* ----------------------
3313  * Close Portal Statement
3314  * ----------------------
3315  */
3316 typedef struct ClosePortalStmt
3317 {
3319  char *portalname; /* name of the portal (cursor) */
3320  /* NULL means CLOSE ALL */
3322 
3323 /* ----------------------
3324  * Fetch Statement (also Move)
3325  * ----------------------
3326  */
3327 typedef enum FetchDirection
3328 {
3329  /* for these, howMany is how many rows to fetch; FETCH_ALL means ALL */
3332  /* for these, howMany indicates a position; only one row is fetched */
3336 
3337 #define FETCH_ALL LONG_MAX
3338 
3339 typedef struct FetchStmt
3340 {
3342  FetchDirection direction; /* see above */
3343  long howMany; /* number of rows, or position argument */
3344  char *portalname; /* name of portal (cursor) */
3345  bool ismove; /* true if MOVE */
3347 
3348 /* ----------------------
3349  * Create Index Statement
3350  *
3351  * This represents creation of an index and/or an associated constraint.
3352  * If isconstraint is true, we should create a pg_constraint entry along
3353  * with the index. But if indexOid isn't InvalidOid, we are not creating an
3354  * index, just a UNIQUE/PKEY constraint using an existing index. isconstraint
3355  * must always be true in this case, and the fields describing the index
3356  * properties are empty.
3357  * ----------------------
3358  */
3359 typedef struct IndexStmt
3360 {
3362  char *idxname; /* name of new index, or NULL for default */
3363  RangeVar *relation; /* relation to build index on */
3364  char *accessMethod; /* name of access method (eg. btree) */
3365  char *tableSpace; /* tablespace, or NULL for default */
3366  List *indexParams; /* columns to index: a list of IndexElem */
3367  List *indexIncludingParams; /* additional columns to index: a list
3368  * of IndexElem */
3369  List *options; /* WITH clause options: a list of DefElem */
3370  Node *whereClause; /* qualification (partial-index predicate) */
3371  List *excludeOpNames; /* exclusion operator names, or NIL if none */
3372  char *idxcomment; /* comment to apply to index, or NULL */
3373  Oid indexOid; /* OID of an existing index, if any */
3374  RelFileNumber oldNumber; /* relfilenumber of existing storage, if any */
3375  SubTransactionId oldCreateSubid; /* rd_createSubid of oldNumber */
3376  SubTransactionId oldFirstRelfilelocatorSubid; /* rd_firstRelfilelocatorSubid
3377  * of oldNumber */
3378  bool unique; /* is index unique? */
3379  bool nulls_not_distinct; /* null treatment for UNIQUE constraints */
3380  bool primary; /* is index a primary key? */
3381  bool isconstraint; /* is it for a pkey/unique constraint? */
3382  bool iswithoutoverlaps; /* is the constraint WITHOUT OVERLAPS? */
3383  bool deferrable; /* is the constraint DEFERRABLE? */
3384  bool initdeferred; /* is the constraint INITIALLY DEFERRED? */
3385  bool transformed; /* true when transformIndexStmt is finished */
3386  bool concurrent; /* should this be a concurrent index build? */
3387  bool if_not_exists; /* just do nothing if index already exists? */
3388  bool reset_default_tblspc; /* reset default_tablespace prior to
3389  * executing */
3391 
3392 /* ----------------------
3393  * Create Statistics Statement
3394  * ----------------------
3395  */
3396 typedef struct CreateStatsStmt
3397 {
3399  List *defnames; /* qualified name (list of String) */
3400  List *stat_types; /* stat types (list of String) */
3401  List *exprs; /* expressions to build statistics on */
3402  List *relations; /* rels to build stats on (list of RangeVar) */
3403  char *stxcomment; /* comment to apply to stats, or NULL */
3404  bool transformed; /* true when transformStatsStmt is finished */
3405  bool if_not_exists; /* do nothing if stats name already exists */
3407 
3408 /*
3409  * StatsElem - statistics parameters (used in CREATE STATISTICS)
3410  *
3411  * For a plain attribute, 'name' is the name of the referenced table column
3412  * and 'expr' is NULL. For an expression, 'name' is NULL and 'expr' is the
3413  * expression tree.
3414  */
3415 typedef struct StatsElem
3416 {
3418  char *name; /* name of attribute to index, or NULL */
3419  Node *expr; /* expression to index, or NULL */
3421 
3422 
3423 /* ----------------------
3424  * Alter Statistics Statement
3425  * ----------------------
3426  */
3427 typedef struct AlterStatsStmt
3428 {
3430  List *defnames; /* qualified name (list of String) */
3431  Node *stxstattarget; /* statistics target */
3432  bool missing_ok; /* skip error if statistics object is missing */
3434 
3435 /* ----------------------
3436  * Create Function Statement
3437  * ----------------------
3438  */
3439 typedef struct CreateFunctionStmt
3440 {
3442  bool is_procedure; /* it's really CREATE PROCEDURE */
3443  bool replace; /* T => replace if already exists */
3444  List *funcname; /* qualified name of function to create */
3445  List *parameters; /* a list of FunctionParameter */
3446  TypeName *returnType; /* the return type */
3447  List *options; /* a list of DefElem */
3450 
3452 {
3453  /* the assigned enum values appear in pg_proc, don't change 'em! */
3454  FUNC_PARAM_IN = 'i', /* input only */
3455  FUNC_PARAM_OUT = 'o', /* output only */
3456  FUNC_PARAM_INOUT = 'b', /* both */
3457  FUNC_PARAM_VARIADIC = 'v', /* variadic (always input) */
3458  FUNC_PARAM_TABLE = 't', /* table function output column */
3459  /* this is not used in pg_proc: */
3460  FUNC_PARAM_DEFAULT = 'd', /* default; effectively same as IN */
3462 
3463 typedef struct FunctionParameter
3464 {
3466  char *name; /* parameter name, or NULL if not given */
3467  TypeName *argType; /* TypeName for parameter type */
3468  FunctionParameterMode mode; /* IN/OUT/etc */
3469  Node *defexpr; /* raw default expr, or NULL if not given */
3471 
3472 typedef struct AlterFunctionStmt
3473 {
3476  ObjectWithArgs *func; /* name and args of function */
3477  List *actions; /* list of DefElem */
3479 
3480 /* ----------------------
3481  * DO Statement
3482  *
3483  * DoStmt is the raw parser output, InlineCodeBlock is the execution-time API
3484  * ----------------------
3485  */
3486 typedef struct DoStmt
3487 {
3489  List *args; /* List of DefElem nodes */
3491 
3492 typedef struct InlineCodeBlock
3493 {
3494  pg_node_attr(nodetag_only) /* this is not a member of parse trees */
3495 
3496  NodeTag type;
3497  char *source_text; /* source text of anonymous code block */
3498  Oid langOid; /* OID of selected language */
3499  bool langIsTrusted; /* trusted property of the language */
3500  bool atomic; /* atomic execution context */
3502 
3503 /* ----------------------
3504  * CALL statement
3505  *
3506  * OUT-mode arguments are removed from the transformed funcexpr. The outargs
3507  * list contains copies of the expressions for all output arguments, in the
3508  * order of the procedure's declared arguments. (outargs is never evaluated,
3509  * but is useful to the caller as a reference for what to assign to.)
3510  * The transformed call state is not relevant in the query jumbling, only the
3511  * function call is.
3512  * ----------------------
3513  */
3514 typedef struct CallStmt
3515 {
3517  /* from the parser */
3518  FuncCall *funccall pg_node_attr(query_jumble_ignore);
3519  /* transformed call, with only input args */
3521  /* transformed output-argument expressions */
3524 
3525 typedef struct CallContext
3526 {
3527  pg_node_attr(nodetag_only) /* this is not a member of parse trees */
3528 
3529  NodeTag type;
3530  bool atomic;
3532 
3533 /* ----------------------
3534  * Alter Object Rename Statement
3535  * ----------------------
3536  */
3537 typedef struct RenameStmt
3538 {
3540  ObjectType renameType; /* OBJECT_TABLE, OBJECT_COLUMN, etc */
3541  ObjectType relationType; /* if column name, associated relation type */
3542  RangeVar *relation; /* in case it's a table */
3543  Node *object; /* in case it's some other object */
3544  char *subname; /* name of contained object (column, rule,
3545  * trigger, etc) */
3546  char *newname; /* the new name */
3547  DropBehavior behavior; /* RESTRICT or CASCADE behavior */
3548  bool missing_ok; /* skip error if missing? */
3550 
3551 /* ----------------------
3552  * ALTER object DEPENDS ON EXTENSION extname
3553  * ----------------------
3554  */
3556 {
3558  ObjectType objectType; /* OBJECT_FUNCTION, OBJECT_TRIGGER, etc */
3559  RangeVar *relation; /* in case a table is involved */
3560  Node *object; /* name of the object */
3561  String *extname; /* extension name */
3562  bool remove; /* set true to remove dep rather than add */
3564 
3565 /* ----------------------
3566  * ALTER object SET SCHEMA Statement
3567  * ----------------------
3568  */
3570 {
3572  ObjectType objectType; /* OBJECT_TABLE, OBJECT_TYPE, etc */
3573  RangeVar *relation; /* in case it's a table */
3574  Node *object; /* in case it's some other object */
3575  char *newschema; /* the new schema */
3576  bool missing_ok; /* skip error if missing? */
3578 
3579 /* ----------------------
3580  * Alter Object Owner Statement
3581  * ----------------------
3582  */
3583 typedef struct AlterOwnerStmt
3584 {
3586  ObjectType objectType; /* OBJECT_TABLE, OBJECT_TYPE, etc */
3587  RangeVar *relation; /* in case it's a table */
3588  Node *object; /* in case it's some other object */
3589  RoleSpec *newowner; /* the new owner */
3591 
3592 /* ----------------------
3593  * Alter Operator Set ( this-n-that )
3594  * ----------------------
3595  */
3596 typedef struct AlterOperatorStmt
3597 {
3599  ObjectWithArgs *opername; /* operator name and argument types */
3600  List *options; /* List of DefElem nodes */
3602 
3603 /* ------------------------
3604  * Alter Type Set ( this-n-that )
3605  * ------------------------
3606  */
3607 typedef struct AlterTypeStmt
3608 {
3610  List *typeName; /* type name (possibly qualified) */
3611  List *options; /* List of DefElem nodes */
3613 
3614 /* ----------------------
3615  * Create Rule Statement
3616  * ----------------------
3617  */
3618 typedef struct RuleStmt
3619 {
3621  RangeVar *relation; /* relation the rule is for */
3622  char *rulename; /* name of the rule */
3623  Node *whereClause; /* qualifications */
3624  CmdType event; /* SELECT, INSERT, etc */
3625  bool instead; /* is a 'do instead'? */
3626  List *actions; /* the action statements */
3627  bool replace; /* OR REPLACE */
3629 
3630 /* ----------------------
3631  * Notify Statement
3632  * ----------------------
3633  */
3634 typedef struct NotifyStmt
3635 {
3637  char *conditionname; /* condition name to notify */
3638  char *payload; /* the payload string, or NULL if none */
3640 
3641 /* ----------------------
3642  * Listen Statement
3643  * ----------------------
3644  */
3645 typedef struct ListenStmt
3646 {
3648  char *conditionname; /* condition name to listen on */
3650 
3651 /* ----------------------
3652  * Unlisten Statement
3653  * ----------------------
3654  */
3655 typedef struct UnlistenStmt
3656 {
3658  char *conditionname; /* name to unlisten on, or NULL for all */
3660 
3661 /* ----------------------
3662  * {Begin|Commit|Rollback} Transaction Statement
3663  * ----------------------
3664  */
3666 {
3668  TRANS_STMT_START, /* semantically identical to BEGIN */
3678 
3679 typedef struct TransactionStmt
3680 {
3682  TransactionStmtKind kind; /* see above */
3683  List *options; /* for BEGIN/START commands */
3684  /* for savepoint commands */
3685  char *savepoint_name pg_node_attr(query_jumble_ignore);
3686  /* for two-phase-commit related commands */
3687  char *gid pg_node_attr(query_jumble_ignore);
3688  bool chain; /* AND CHAIN option */
3689  /* token location, or -1 if unknown */
3690  ParseLoc location pg_node_attr(query_jumble_location);
3692 
3693 /* ----------------------
3694  * Create Type Statement, composite types
3695  * ----------------------
3696  */
3697 typedef struct CompositeTypeStmt
3698 {
3700  RangeVar *typevar; /* the composite type to be created */
3701  List *coldeflist; /* list of ColumnDef nodes */
3703 
3704 /* ----------------------
3705  * Create Type Statement, enum types
3706  * ----------------------
3707  */
3708 typedef struct CreateEnumStmt
3709 {
3711  List *typeName; /* qualified name (list of String) */
3712  List *vals; /* enum values (list of String) */
3714 
3715 /* ----------------------
3716  * Create Type Statement, range types
3717  * ----------------------
3718  */
3719 typedef struct CreateRangeStmt
3720 {
3722  List *typeName; /* qualified name (list of String) */
3723  List *params; /* range parameters (list of DefElem) */
3725 
3726 /* ----------------------
3727  * Alter Type Statement, enum types
3728  * ----------------------
3729  */
3730 typedef struct AlterEnumStmt
3731 {
3733  List *typeName; /* qualified name (list of String) */
3734  char *oldVal; /* old enum value's name, if renaming */
3735  char *newVal; /* new enum value's name */
3736  char *newValNeighbor; /* neighboring enum value, if specified */
3737  bool newValIsAfter; /* place new enum value after neighbor? */
3738  bool skipIfNewValExists; /* no error if new already exists? */
3740 
3741 /* ----------------------
3742  * Create View Statement
3743  * ----------------------
3744  */
3745 typedef enum ViewCheckOption
3746 {
3751 
3752 typedef struct ViewStmt
3753 {
3755  RangeVar *view; /* the view to be created */
3756  List *aliases; /* target column names */
3757  Node *query; /* the SELECT query (as a raw parse tree) */
3758  bool replace; /* replace an existing view? */
3759  List *options; /* options from WITH clause */
3760  ViewCheckOption withCheckOption; /* WITH CHECK OPTION */
3762 
3763 /* ----------------------
3764  * Load Statement
3765  * ----------------------
3766  */
3767 typedef struct LoadStmt
3768 {
3770  char *filename; /* file to load */
3772 
3773 /* ----------------------
3774  * Createdb Statement
3775  * ----------------------
3776  */
3777 typedef struct CreatedbStmt
3778 {
3780  char *dbname; /* name of database to create */
3781  List *options; /* List of DefElem nodes */
3783 
3784 /* ----------------------
3785  * Alter Database
3786  * ----------------------
3787  */
3788 typedef struct AlterDatabaseStmt
3789 {
3791  char *dbname; /* name of database to alter */
3792  List *options; /* List of DefElem nodes */
3794 
3796 {
3798  char *dbname;
3800 
3801 typedef struct AlterDatabaseSetStmt
3802 {
3804  char *dbname; /* database name */
3805  VariableSetStmt *setstmt; /* SET or RESET subcommand */
3807 
3808 /* ----------------------
3809  * Dropdb Statement
3810  * ----------------------
3811  */
3812 typedef struct DropdbStmt
3813 {
3815  char *dbname; /* database to drop */
3816  bool missing_ok; /* skip error if db is missing? */
3817  List *options; /* currently only FORCE is supported */
3819 
3820 /* ----------------------
3821  * Alter System Statement
3822  * ----------------------
3823  */
3824 typedef struct AlterSystemStmt
3825 {
3827  VariableSetStmt *setstmt; /* SET subcommand */
3829 
3830 /* ----------------------
3831  * Cluster Statement (support pbrown's cluster index implementation)
3832  * ----------------------
3833  */
3834 typedef struct ClusterStmt
3835 {
3837  RangeVar *relation; /* relation being indexed, or NULL if all */
3838  char *indexname; /* original index defined */
3839  List *params; /* list of DefElem nodes */
3841 
3842 /* ----------------------
3843  * Vacuum and Analyze Statements
3844  *
3845  * Even though these are nominally two statements, it's convenient to use
3846  * just one node type for both.
3847  * ----------------------
3848  */
3849 typedef struct VacuumStmt
3850 {
3852  List *options; /* list of DefElem nodes */
3853  List *rels; /* list of VacuumRelation, or NIL for all */
3854  bool is_vacuumcmd; /* true for VACUUM, false for ANALYZE */
3856 
3857 /*
3858  * Info about a single target table of VACUUM/ANALYZE.
3859  *
3860  * If the OID field is set, it always identifies the table to process.
3861  * Then the relation field can be NULL; if it isn't, it's used only to report
3862  * failure to open/lock the relation.
3863  */
3864 typedef struct VacuumRelation
3865 {
3867  RangeVar *relation; /* table name to process, or NULL */
3868  Oid oid; /* table's OID; InvalidOid if not looked up */
3869  List *va_cols; /* list of column names, or NIL for all */
3871 
3872 /* ----------------------
3873  * Explain Statement
3874  *
3875  * The "query" field is initially a raw parse tree, and is converted to a
3876  * Query node during parse analysis. Note that rewriting and planning
3877  * of the query are always postponed until execution.
3878  * ----------------------
3879  */
3880 typedef struct ExplainStmt
3881 {
3883  Node *query; /* the query (see comments above) */
3884  List *options; /* list of DefElem nodes */
3886 
3887 /* ----------------------
3888  * CREATE TABLE AS Statement (a/k/a SELECT INTO)
3889  *
3890  * A query written as CREATE TABLE AS will produce this node type natively.
3891  * A query written as SELECT ... INTO will be transformed to this form during
3892  * parse analysis.
3893  * A query written as CREATE MATERIALIZED view will produce this node type,
3894  * during parse analysis, since it needs all the same data.
3895  *
3896  * The "query" field is handled similarly to EXPLAIN, though note that it
3897  * can be a SELECT or an EXECUTE, but not other DML statements.
3898  * ----------------------
3899  */
3900 typedef struct CreateTableAsStmt
3901 {
3903  Node *query; /* the query (see comments above) */
3904  IntoClause *into; /* destination table */
3905  ObjectType objtype; /* OBJECT_TABLE or OBJECT_MATVIEW */
3906  bool is_select_into; /* it was written as SELECT INTO */
3907  bool if_not_exists; /* just do nothing if it already exists? */
3909 
3910 /* ----------------------
3911  * REFRESH MATERIALIZED VIEW Statement
3912  * ----------------------
3913  */
3914 typedef struct RefreshMatViewStmt
3915 {
3917  bool concurrent; /* allow concurrent access? */
3918  bool skipData; /* true for WITH NO DATA */
3919  RangeVar *relation; /* relation to insert into */
3921 
3922 /* ----------------------
3923  * Checkpoint Statement
3924  * ----------------------
3925  */
3926 typedef struct CheckPointStmt
3927 {
3930 
3931 /* ----------------------
3932  * Discard Statement
3933  * ----------------------
3934  */
3935 
3936 typedef enum DiscardMode
3937 {
3943 
3944 typedef struct DiscardStmt
3945 {
3949 
3950 /* ----------------------
3951  * LOCK Statement
3952  * ----------------------
3953  */
3954 typedef struct LockStmt
3955 {
3957  List *relations; /* relations to lock */
3958  int mode; /* lock mode */
3959  bool nowait; /* no wait mode */
3961 
3962 /* ----------------------
3963  * SET CONSTRAINTS Statement
3964  * ----------------------
3965  */
3966 typedef struct ConstraintsSetStmt
3967 {
3969  List *constraints; /* List of names as RangeVars */
3970  bool deferred;
3972 
3973 /* ----------------------
3974  * REINDEX Statement
3975  * ----------------------
3976  */
3977 typedef enum ReindexObjectType
3978 {
3980  REINDEX_OBJECT_TABLE, /* table or materialized view */
3982  REINDEX_OBJECT_SYSTEM, /* system catalogs */
3983  REINDEX_OBJECT_DATABASE, /* database */
3985 
3986 typedef struct ReindexStmt
3987 {
3989  ReindexObjectType kind; /* REINDEX_OBJECT_INDEX, REINDEX_OBJECT_TABLE,
3990  * etc. */
3991  RangeVar *relation; /* Table or index to reindex */
3992  const char *name; /* name of database to reindex */
3993  List *params; /* list of DefElem nodes */
3995 
3996 /* ----------------------
3997  * CREATE CONVERSION Statement
3998  * ----------------------
3999  */
4000 typedef struct CreateConversionStmt
4001 {
4003  List *conversion_name; /* Name of the conversion */
4004  char *for_encoding_name; /* source encoding name */
4005  char *to_encoding_name; /* destination encoding name */
4006  List *func_name; /* qualified conversion function name */
4007  bool def; /* is this a default conversion? */
4009 
4010 /* ----------------------
4011  * CREATE CAST Statement
4012  * ----------------------
4013  */
4014 typedef struct CreateCastStmt
4015 {
4021  bool inout;
4023 
4024 /* ----------------------
4025  * CREATE TRANSFORM Statement
4026  * ----------------------
4027  */
4028 typedef struct CreateTransformStmt
4029 {
4031  bool replace;
4033  char *lang;
4037 
4038 /* ----------------------
4039  * PREPARE Statement
4040  * ----------------------
4041  */
4042 typedef struct PrepareStmt
4043 {
4045  char *name; /* Name of plan, arbitrary */
4046  List *argtypes; /* Types of parameters (List of TypeName) */
4047  Node *query; /* The query itself (as a raw parsetree) */
4049 
4050 
4051 /* ----------------------
4052  * EXECUTE Statement
4053  * ----------------------
4054  */
4055 
4056 typedef struct ExecuteStmt
4057 {
4059  char *name; /* The name of the plan to execute */
4060  List *params; /* Values to assign to parameters */
4062 
4063 
4064 /* ----------------------
4065  * DEALLOCATE Statement
4066  * ----------------------
4067  */
4068 typedef struct DeallocateStmt
4069 {
4071  /* The name of the plan to remove, NULL if DEALLOCATE ALL */
4072  char *name pg_node_attr(query_jumble_ignore);
4073 
4074  /*
4075  * True if DEALLOCATE ALL. This is redundant with "name == NULL", but we
4076  * make it a separate field so that exactly this condition (and not the
4077  * precise name) will be accounted for in query jumbling.
4078  */
4079  bool isall;
4080  /* token location, or -1 if unknown */
4081  ParseLoc location pg_node_attr(query_jumble_location);
4083 
4084 /*
4085  * DROP OWNED statement
4086  */
4087 typedef struct DropOwnedStmt
4088 {
4093 
4094 /*
4095  * REASSIGN OWNED statement
4096  */
4097 typedef struct ReassignOwnedStmt
4098 {
4103 
4104 /*
4105  * TS Dictionary stmts: DefineStmt, RenameStmt and DropStmt are default
4106  */
4108 {
4110  List *dictname; /* qualified name (list of String) */
4111  List *options; /* List of DefElem nodes */
4113 
4114 /*
4115  * TS Configuration stmts: DefineStmt, RenameStmt and DropStmt are default
4116  */
4117 typedef enum AlterTSConfigType
4118 {
4125 
4127 {
4129  AlterTSConfigType kind; /* ALTER_TSCONFIG_ADD_MAPPING, etc */
4130  List *cfgname; /* qualified name (list of String) */
4131 
4132  /*
4133  * dicts will be non-NIL if ADD/ALTER MAPPING was specified. If dicts is
4134  * NIL, but tokentype isn't, DROP MAPPING was specified.
4135  */
4136  List *tokentype; /* list of String */
4137  List *dicts; /* list of list of String */
4138  bool override; /* if true - remove old variant */
4139  bool replace; /* if true - replace dictionary by another */
4140  bool missing_ok; /* for DROP - skip error if missing? */
4142 
4143 typedef struct PublicationTable
4144 {
4146  RangeVar *relation; /* relation to be published */
4147  Node *whereClause; /* qualifications */
4148  List *columns; /* List of columns in a publication table */
4150 
4151 /*
4152  * Publication object type
4153  */
4155 {
4156  PUBLICATIONOBJ_TABLE, /* A table */
4157  PUBLICATIONOBJ_TABLES_IN_SCHEMA, /* All tables in schema */
4158  PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA, /* All tables in first element of
4159  * search_path */
4160  PUBLICATIONOBJ_CONTINUATION, /* Continuation of previous type */
4162 
4163 typedef struct PublicationObjSpec
4164 {
4166  PublicationObjSpecType pubobjtype; /* type of this publication object */
4167  char *name;
4169  ParseLoc location; /* token location, or -1 if unknown */
4171 
4173 {
4175  char *pubname; /* Name of the publication */
4176  List *options; /* List of DefElem nodes */
4177  List *pubobjects; /* Optional list of publication objects */
4178  bool for_all_tables; /* Special publication for all tables in db */
4180 
4182 {
4183  AP_AddObjects, /* add objects to publication */
4184  AP_DropObjects, /* remove objects from publication */
4185  AP_SetObjects, /* set list of objects */
4187 
4188 typedef struct AlterPublicationStmt
4189 {
4191  char *pubname; /* Name of the publication */
4192 
4193  /* parameters used for ALTER PUBLICATION ... WITH */
4194  List *options; /* List of DefElem nodes */
4195 
4196  /*
4197  * Parameters used for ALTER PUBLICATION ... ADD/DROP/SET publication
4198  * objects.
4199  */
4200  List *pubobjects; /* Optional list of publication objects */
4201  bool for_all_tables; /* Special publication for all tables in db */
4202  AlterPublicationAction action; /* What action to perform with the given
4203  * objects */
4205 
4207 {
4209  char *subname; /* Name of the subscription */
4210  char *conninfo; /* Connection string to publisher */
4211  List *publication; /* One or more publication to subscribe to */
4212  List *options; /* List of DefElem nodes */
4214 
4216 {
4226 
4228 {
4230  AlterSubscriptionType kind; /* ALTER_SUBSCRIPTION_OPTIONS, etc */
4231  char *subname; /* Name of the subscription */
4232  char *conninfo; /* Connection string to publisher */
4233  List *publication; /* One or more publication to subscribe to */
4234  List *options; /* List of DefElem nodes */
4236 
4237 typedef struct DropSubscriptionStmt
4238 {
4240  char *subname; /* Name of the subscription */
4241  bool missing_ok; /* Skip error if missing? */
4242  DropBehavior behavior; /* RESTRICT or CASCADE behavior */
4244 
4245 #endif /* PARSENODES_H */
#define PG_INT32_MAX
Definition: c.h:589
signed short int16
Definition: c.h:493
uint32 SubTransactionId
Definition: c.h:656
signed int int32
Definition: c.h:494
uint32 bits32
Definition: c.h:515
unsigned int Index
Definition: c.h:614
LockWaitPolicy
Definition: lockoptions.h:37
LockClauseStrength
Definition: lockoptions.h:22
OnConflictAction
Definition: nodes.h:416
double Cardinality
Definition: nodes.h:252
CmdType
Definition: nodes.h:263
NodeTag
Definition: nodes.h:27
LimitOption
Definition: nodes.h:429
int ParseLoc
Definition: nodes.h:240
JoinType
Definition: nodes.h:288
struct AlterDatabaseRefreshCollStmt AlterDatabaseRefreshCollStmt
struct LoadStmt LoadStmt
RoleSpecType
Definition: parsenodes.h:393
@ ROLESPEC_CURRENT_USER
Definition: parsenodes.h:396
@ ROLESPEC_CSTRING
Definition: parsenodes.h:394
@ ROLESPEC_SESSION_USER
Definition: parsenodes.h:397
@ ROLESPEC_CURRENT_ROLE
Definition: parsenodes.h:395
@ ROLESPEC_PUBLIC
Definition: parsenodes.h:398
struct DropSubscriptionStmt DropSubscriptionStmt
struct CreateEnumStmt CreateEnumStmt
struct RoleSpec RoleSpec
struct CreateFunctionStmt CreateFunctionStmt
struct AlterOwnerStmt AlterOwnerStmt
struct ReturnStmt ReturnStmt
struct CreateAmStmt CreateAmStmt
AlterSubscriptionType
Definition: parsenodes.h:4216
@ ALTER_SUBSCRIPTION_ENABLED
Definition: parsenodes.h:4223
@ ALTER_SUBSCRIPTION_DROP_PUBLICATION
Definition: parsenodes.h:4221
@ ALTER_SUBSCRIPTION_SET_PUBLICATION
Definition: parsenodes.h:4219
@ ALTER_SUBSCRIPTION_REFRESH
Definition: parsenodes.h:4222
@ ALTER_SUBSCRIPTION_SKIP
Definition: parsenodes.h:4224
@ ALTER_SUBSCRIPTION_OPTIONS
Definition: parsenodes.h:4217
@ ALTER_SUBSCRIPTION_CONNECTION
Definition: parsenodes.h:4218
@ ALTER_SUBSCRIPTION_ADD_PUBLICATION
Definition: parsenodes.h:4220
struct TableLikeClause TableLikeClause
struct AlterSystemStmt AlterSystemStmt
struct CopyStmt CopyStmt
TransactionStmtKind
Definition: parsenodes.h:3666
@ TRANS_STMT_ROLLBACK_TO
Definition: parsenodes.h:3673
@ TRANS_STMT_START
Definition: parsenodes.h:3668
@ TRANS_STMT_SAVEPOINT
Definition: parsenodes.h:3671
@ TRANS_STMT_BEGIN
Definition: parsenodes.h:3667
@ TRANS_STMT_ROLLBACK
Definition: parsenodes.h:3670
@ TRANS_STMT_COMMIT_PREPARED
Definition: parsenodes.h:3675
@ TRANS_STMT_COMMIT
Definition: parsenodes.h:3669
@ TRANS_STMT_ROLLBACK_PREPARED
Definition: parsenodes.h:3676
@ TRANS_STMT_PREPARE
Definition: parsenodes.h:3674
@ TRANS_STMT_RELEASE
Definition: parsenodes.h:3672
struct GrantRoleStmt GrantRoleStmt
struct AlterTSDictionaryStmt AlterTSDictionaryStmt
struct OnConflictClause OnConflictClause
struct JsonTablePathSpec JsonTablePathSpec
struct AlterOperatorStmt AlterOperatorStmt
WCOKind
Definition: parsenodes.h:1362
@ WCO_RLS_MERGE_UPDATE_CHECK
Definition: parsenodes.h:1367
@ WCO_RLS_CONFLICT_CHECK
Definition: parsenodes.h:1366
@ WCO_RLS_INSERT_CHECK
Definition: parsenodes.h:1364
@ WCO_VIEW_CHECK
Definition: parsenodes.h:1363
@ WCO_RLS_UPDATE_CHECK
Definition: parsenodes.h:1365
@ WCO_RLS_MERGE_DELETE_CHECK
Definition: parsenodes.h:1368
struct RangeTblFunction RangeTblFunction
struct JsonScalarExpr JsonScalarExpr
JsonTableColumnType
Definition: parsenodes.h:1844
@ JTC_FORMATTED
Definition: parsenodes.h:1848
@ JTC_FOR_ORDINALITY
Definition: parsenodes.h:1845
@ JTC_NESTED
Definition: parsenodes.h:1849
@ JTC_EXISTS
Definition: parsenodes.h:1847
@ JTC_REGULAR
Definition: parsenodes.h:1846
struct JsonArrayAgg JsonArrayAgg
struct A_Indirection A_Indirection
struct XmlSerialize XmlSerialize
SortByNulls
Definition: parsenodes.h:53
@ SORTBY_NULLS_DEFAULT
Definition: parsenodes.h:54
@ SORTBY_NULLS_LAST
Definition: parsenodes.h:56
@ SORTBY_NULLS_FIRST
Definition: parsenodes.h:55
struct DeallocateStmt DeallocateStmt
struct CreateSeqStmt CreateSeqStmt
struct DropTableSpaceStmt DropTableSpaceStmt
struct CreateExtensionStmt CreateExtensionStmt
struct A_Indices A_Indices
struct CreateTableSpaceStmt CreateTableSpaceStmt
GroupingSetKind
Definition: parsenodes.h:1501
@ GROUPING_SET_CUBE
Definition: parsenodes.h:1505
@ GROUPING_SET_SIMPLE
Definition: parsenodes.h:1503
@ GROUPING_SET_ROLLUP
Definition: parsenodes.h:1504
@ GROUPING_SET_SETS
Definition: parsenodes.h:1506
@ GROUPING_SET_EMPTY
Definition: parsenodes.h:1502
struct ReassignOwnedStmt ReassignOwnedStmt
struct ParamRef ParamRef
struct VacuumStmt VacuumStmt
struct NotifyStmt NotifyStmt
SetOperation
Definition: parsenodes.h:2114
@ SETOP_INTERSECT
Definition: parsenodes.h:2117
@ SETOP_UNION
Definition: parsenodes.h:2116
@ SETOP_EXCEPT
Definition: parsenodes.h:2118
@ SETOP_NONE
Definition: parsenodes.h:2115
struct TriggerTransition TriggerTransition
struct ClusterStmt ClusterStmt
struct MergeStmt MergeStmt
struct SelectStmt SelectStmt
struct DropdbStmt DropdbStmt
uint64 AclMode
Definition: parsenodes.h:74
struct FunctionParameter FunctionParameter
struct UnlistenStmt UnlistenStmt
struct InsertStmt InsertStmt
struct AlterFunctionStmt AlterFunctionStmt
struct StatsElem StatsElem
struct AlterRoleSetStmt AlterRoleSetStmt
struct CreateOpFamilyStmt CreateOpFamilyStmt
struct CreatePublicationStmt CreatePublicationStmt
struct InlineCodeBlock InlineCodeBlock
struct CreateDomainStmt CreateDomainStmt
struct AlterDomainStmt AlterDomainStmt
struct AlterDefaultPrivilegesStmt AlterDefaultPrivilegesStmt
struct CreateStatsStmt CreateStatsStmt
JsonQuotes
Definition: parsenodes.h:1779
@ JS_QUOTES_KEEP
Definition: parsenodes.h:1781
@ JS_QUOTES_UNSPEC
Definition: parsenodes.h:1780
@ JS_QUOTES_OMIT
Definition: parsenodes.h:1782
struct JsonOutput JsonOutput
struct UpdateStmt UpdateStmt
struct AlterObjectDependsStmt AlterObjectDependsStmt
struct IndexElem IndexElem
struct AlterCollationStmt AlterCollationStmt
A_Expr_Kind
Definition: parsenodes.h:312
@ AEXPR_BETWEEN
Definition: parsenodes.h:323
@ AEXPR_NULLIF
Definition: parsenodes.h:318
@ AEXPR_NOT_DISTINCT
Definition: parsenodes.h:317
@ AEXPR_BETWEEN_SYM
Definition: parsenodes.h:325
@ AEXPR_NOT_BETWEEN_SYM
Definition: parsenodes.h:326
@ AEXPR_ILIKE
Definition: parsenodes.h:321
@ AEXPR_IN
Definition: parsenodes.h:319
@ AEXPR_NOT_BETWEEN
Definition: parsenodes.h:324
@ AEXPR_DISTINCT
Definition: parsenodes.h:316
@ AEXPR_SIMILAR
Definition: parsenodes.h:322
@ AEXPR_LIKE
Definition: parsenodes.h:320
@ AEXPR_OP
Definition: parsenodes.h:313
@ AEXPR_OP_ANY
Definition: parsenodes.h:314
@ AEXPR_OP_ALL
Definition: parsenodes.h:315
FunctionParameterMode
Definition: parsenodes.h:3452
@ FUNC_PARAM_IN
Definition: parsenodes.h:3454
@ FUNC_PARAM_DEFAULT
Definition: parsenodes.h:3460
@ FUNC_PARAM_OUT
Definition: parsenodes.h:3455
@ FUNC_PARAM_INOUT
Definition: parsenodes.h:3456
@ FUNC_PARAM_TABLE
Definition: parsenodes.h:3458
@ FUNC_PARAM_VARIADIC
Definition: parsenodes.h:3457
struct CreateForeignTableStmt CreateForeignTableStmt
struct CreateOpClassStmt CreateOpClassStmt
struct JsonObjectConstructor JsonObjectConstructor
AlterTSConfigType
Definition: parsenodes.h:4118
@ ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN
Definition: parsenodes.h:4120
@ ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN
Definition: parsenodes.h:4122
@ ALTER_TSCONFIG_REPLACE_DICT
Definition: parsenodes.h:4121
@ ALTER_TSCONFIG_ADD_MAPPING
Definition: parsenodes.h:4119
@ ALTER_TSCONFIG_DROP_MAPPING
Definition: parsenodes.h:4123
struct AlterForeignServerStmt AlterForeignServerStmt
struct ColumnDef ColumnDef
struct CreatedbStmt CreatedbStmt
struct RTEPermissionInfo RTEPermissionInfo
struct AlterEventTrigStmt AlterEventTrigStmt
struct IndexStmt IndexStmt
struct PartitionCmd PartitionCmd
PublicationObjSpecType
Definition: parsenodes.h:4155
@ PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA
Definition: parsenodes.h:4158
@ PUBLICATIONOBJ_TABLES_IN_SCHEMA
Definition: parsenodes.h:4157
@ PUBLICATIONOBJ_TABLE
Definition: parsenodes.h:4156
@ PUBLICATIONOBJ_CONTINUATION
Definition: parsenodes.h:4160
struct JsonArrayConstructor JsonArrayConstructor
PartitionStrategy
Definition: parsenodes.h:871
@ PARTITION_STRATEGY_HASH
Definition: parsenodes.h:874
@ PARTITION_STRATEGY_LIST
Definition: parsenodes.h:872
@ PARTITION_STRATEGY_RANGE
Definition: parsenodes.h:873
ImportForeignSchemaType
Definition: parsenodes.h:2949
@ FDW_IMPORT_SCHEMA_LIMIT_TO
Definition: parsenodes.h:2951
@ FDW_IMPORT_SCHEMA_ALL
Definition: parsenodes.h:2950
@ FDW_IMPORT_SCHEMA_EXCEPT
Definition: parsenodes.h:2952
struct AlterRoleStmt AlterRoleStmt
struct MergeWhenClause MergeWhenClause
struct WindowDef WindowDef
struct CommentStmt CommentStmt
AlterPublicationAction
Definition: parsenodes.h:4182
@ AP_DropObjects
Definition: parsenodes.h:4184
@ AP_SetObjects
Definition: parsenodes.h:4185
@ AP_AddObjects
Definition: parsenodes.h:4183
struct JsonArgument JsonArgument
struct Query Query
struct JsonArrayQueryConstructor JsonArrayQueryConstructor
QuerySource
Definition: parsenodes.h:35
@ QSRC_NON_INSTEAD_RULE
Definition: parsenodes.h:40
@ QSRC_PARSER
Definition: parsenodes.h:37
@ QSRC_QUAL_INSTEAD_RULE
Definition: parsenodes.h:39
@ QSRC_ORIGINAL
Definition: parsenodes.h:36
@ QSRC_INSTEAD_RULE
Definition: parsenodes.h:38
struct WithClause WithClause
struct AlterObjectSchemaStmt AlterObjectSchemaStmt
struct SinglePartitionSpec SinglePartitionSpec
struct MultiAssignRef MultiAssignRef
struct ImportForeignSchemaStmt ImportForeignSchemaStmt
struct ReindexStmt ReindexStmt
struct CreateSubscriptionStmt CreateSubscriptionStmt
struct JsonTableColumn JsonTableColumn
struct A_Const A_Const
struct DeleteStmt DeleteStmt
RTEKind
Definition: parsenodes.h:1027
@ RTE_JOIN
Definition: parsenodes.h:1030
@ RTE_CTE
Definition: parsenodes.h:1034
@ RTE_NAMEDTUPLESTORE
Definition: parsenodes.h:1035
@ RTE_VALUES
Definition: parsenodes.h:1033
@ RTE_SUBQUERY
Definition: parsenodes.h:1029
@ RTE_RESULT
Definition: parsenodes.h:1036
@ RTE_FUNCTION
Definition: parsenodes.h:1031
@ RTE_TABLEFUNC
Definition: parsenodes.h:1032
@ RTE_RELATION
Definition: parsenodes.h:1028
struct AlterSubscriptionStmt AlterSubscriptionStmt
struct AlterStatsStmt AlterStatsStmt
struct AlterPublicationStmt AlterPublicationStmt
struct RangeFunction RangeFunction
struct PLAssignStmt PLAssignStmt
DefElemAction
Definition: parsenodes.h:804
@ DEFELEM_UNSPEC
Definition: parsenodes.h:805
@ DEFELEM_DROP
Definition: parsenodes.h:808
@ DEFELEM_SET
Definition: parsenodes.h:806
@ DEFELEM_ADD
Definition: parsenodes.h:807
struct ColumnRef ColumnRef
ConstrType
Definition: parsenodes.h:2706
@ CONSTR_FOREIGN
Definition: parsenodes.h:2717
@ CONSTR_ATTR_DEFERRED
Definition: parsenodes.h:2720
@ CONSTR_IDENTITY
Definition: parsenodes.h:2711
@ CONSTR_UNIQUE
Definition: parsenodes.h:2715
@ CONSTR_ATTR_NOT_DEFERRABLE
Definition: parsenodes.h:2719
@ CONSTR_DEFAULT
Definition: parsenodes.h:2710
@ CONSTR_NOTNULL
Definition: parsenodes.h:2709
@ CONSTR_ATTR_IMMEDIATE
Definition: parsenodes.h:2721
@ CONSTR_CHECK
Definition: parsenodes.h:2713
@ CONSTR_NULL
Definition: parsenodes.h:2707
@ CONSTR_GENERATED
Definition: parsenodes.h:2712
@ CONSTR_EXCLUSION
Definition: parsenodes.h:2716
@ CONSTR_ATTR_DEFERRABLE
Definition: parsenodes.h:2718
@ CONSTR_PRIMARY
Definition: parsenodes.h:2714
PartitionRangeDatumKind
Definition: parsenodes.h:923
@ PARTITION_RANGE_DATUM_MAXVALUE
Definition: parsenodes.h:926
@ PARTITION_RANGE_DATUM_VALUE
Definition: parsenodes.h:925
@ PARTITION_RANGE_DATUM_MINVALUE
Definition: parsenodes.h:924
struct GroupingSet GroupingSet
struct CreatePolicyStmt CreatePolicyStmt
FetchDirection
Definition: parsenodes.h:3328
@ FETCH_RELATIVE
Definition: parsenodes.h:3334
@ FETCH_ABSOLUTE
Definition: parsenodes.h:3333
@ FETCH_FORWARD
Definition: parsenodes.h:3330
@ FETCH_BACKWARD
Definition: parsenodes.h:3331
VariableSetKind
Definition: parsenodes.h:2616
@ VAR_SET_DEFAULT
Definition: parsenodes.h:2618
@ VAR_RESET
Definition: parsenodes.h:2621
@ VAR_SET_MULTI
Definition: parsenodes.h:2620
@ VAR_SET_VALUE
Definition: parsenodes.h:2617
@ VAR_SET_CURRENT
Definition: parsenodes.h:2619
@ VAR_RESET_ALL
Definition: parsenodes.h:2622
DropBehavior
Definition: parsenodes.h:2335
@ DROP_CASCADE
Definition: parsenodes.h:2337
@ DROP_RESTRICT
Definition: parsenodes.h:2336
ObjectType
Definition: parsenodes.h:2262
@ OBJECT_EVENT_TRIGGER
Definition: parsenodes.h:2277
@ OBJECT_FDW
Definition: parsenodes.h:2279
@ OBJECT_TSPARSER
Definition: parsenodes.h:2310
@ OBJECT_COLLATION
Definition: parsenodes.h:2270
@ OBJECT_USER_MAPPING
Definition: parsenodes.h:2313
@ OBJECT_ACCESS_METHOD
Definition: parsenodes.h:2263
@ OBJECT_OPCLASS
Definition: parsenodes.h:2287
@ OBJECT_DEFACL
Definition: parsenodes.h:2274
@ OBJECT_AGGREGATE
Definition: parsenodes.h:2264
@ OBJECT_MATVIEW
Definition: parsenodes.h:2286
@ OBJECT_SCHEMA
Definition: parsenodes.h:2299
@ OBJECT_POLICY
Definition: parsenodes.h:2291
@ OBJECT_OPERATOR
Definition: parsenodes.h:2288
@ OBJECT_FOREIGN_TABLE
Definition: parsenodes.h:2281
@ OBJECT_TSCONFIGURATION
Definition: parsenodes.h:2308
@ OBJECT_OPFAMILY
Definition: parsenodes.h:2289
@ OBJECT_DOMAIN
Definition: parsenodes.h:2275
@ OBJECT_COLUMN
Definition: parsenodes.h:2269
@ OBJECT_TABLESPACE
Definition: parsenodes.h:2305
@ OBJECT_ROLE
Definition: parsenodes.h:2296
@ OBJECT_ROUTINE
Definition: parsenodes.h:2297
@ OBJECT_LARGEOBJECT
Definition: parsenodes.h:2285
@ OBJECT_PUBLICATION_NAMESPACE
Definition: parsenodes.h:2294
@ OBJECT_PROCEDURE
Definition: parsenodes.h:2292
@ OBJECT_EXTENSION
Definition: parsenodes.h:2278
@ OBJECT_INDEX
Definition: parsenodes.h:2283
@ OBJECT_DEFAULT
Definition: parsenodes.h:2273
@ OBJECT_DATABASE
Definition: parsenodes.h:2272
@ OBJECT_SEQUENCE
Definition: parsenodes.h:2300
@ OBJECT_TSTEMPLATE
Definition: parsenodes.h:2311
@ OBJECT_LANGUAGE
Definition: parsenodes.h:2284
@ OBJECT_AMOP
Definition: parsenodes.h:2265
@ OBJECT_PUBLICATION_REL
Definition: parsenodes.h:2295
@ OBJECT_FOREIGN_SERVER
Definition: parsenodes.h:2280
@ OBJECT_TSDICTIONARY
Definition: parsenodes.h:2309
@ OBJECT_ATTRIBUTE
Definition: parsenodes.h:2267
@ OBJECT_PUBLICATION
Definition: parsenodes.h:2293
@ OBJECT_RULE
Definition: parsenodes.h:2298
@ OBJECT_CONVERSION
Definition: parsenodes.h:2271
@ OBJECT_AMPROC
Definition: parsenodes.h:2266
@ OBJECT_TABLE
Definition: parsenodes.h:2304
@ OBJECT_VIEW
Definition: parsenodes.h:2314
@ OBJECT_PARAMETER_ACL
Definition: parsenodes.h:2290
@ OBJECT_TYPE
Definition: parsenodes.h:2312
@ OBJECT_FUNCTION
Definition: parsenodes.h:2282
@ OBJECT_TABCONSTRAINT
Definition: parsenodes.h:2303
@ OBJECT_DOMCONSTRAINT
Definition: parsenodes.h:2276
@ OBJECT_SUBSCRIPTION
Definition: parsenodes.h:2301
@ OBJECT_STATISTIC_EXT
Definition: parsenodes.h:2302
@ OBJECT_CAST
Definition: parsenodes.h:2268
@ OBJECT_TRIGGER
Definition: parsenodes.h:2307
@ OBJECT_TRANSFORM
Definition: parsenodes.h:2306
struct ListenStmt ListenStmt
struct A_Star A_Star
struct PublicationObjSpec PublicationObjSpec
struct AlterTableSpaceOptionsStmt AlterTableSpaceOptionsStmt
struct CreateRoleStmt CreateRoleStmt
struct AlterTableCmd AlterTableCmd
struct RangeTableSample RangeTableSample
struct DropUserMappingStmt DropUserMappingStmt
ReindexObjectType
Definition: parsenodes.h:3978
@ REINDEX_OBJECT_DATABASE
Definition: parsenodes.h:3983
@ REINDEX_OBJECT_INDEX
Definition: parsenodes.h:3979
@ REINDEX_OBJECT_SCHEMA
Definition: parsenodes.h:3981
@ REINDEX_OBJECT_SYSTEM
Definition: parsenodes.h:3982
@ REINDEX_OBJECT_TABLE
Definition: parsenodes.h:3980
struct CreateForeignServerStmt CreateForeignServerStmt
struct LockingClause LockingClause
AlterTableType
Definition: parsenodes.h:2354
@ AT_AddIndexConstraint
Definition: parsenodes.h:2377
@ AT_MergePartitions
Definition: parsenodes.h:2419
@ AT_DropOf
Definition: parsenodes.h:2408
@ AT_SetOptions
Definition: parsenodes.h:2365
@ AT_DropIdentity
Definition: parsenodes.h:2422
@ AT_SetAttNotNull
Definition: parsenodes.h:2361
@ AT_DisableTrigUser
Definition: parsenodes.h:2400
@ AT_DropNotNull
Definition: parsenodes.h:2359
@ AT_AddOf
Definition: parsenodes.h:2407
@ AT_ResetOptions
Definition: parsenodes.h:2366
@ AT_ReplicaIdentity
Definition: parsenodes.h:2409
@ AT_ReplaceRelOptions
Definition: parsenodes.h:2392
@ AT_EnableRowSecurity
Definition: parsenodes.h:2410
@ AT_AddColumnToView
Definition: parsenodes.h:2356
@ AT_ResetRelOptions
Definition: parsenodes.h:2391
@ AT_EnableReplicaTrig
Definition: parsenodes.h:2395
@ AT_DropOids
Definition: parsenodes.h:2387
@ AT_SetIdentity
Definition: parsenodes.h:2421
@ AT_ReAddStatistics
Definition: parsenodes.h:2423
@ AT_SetUnLogged
Definition: parsenodes.h:2386
@ AT_DisableTrig
Definition: parsenodes.h:2396
@ AT_SetCompression
Definition: parsenodes.h:2368
@ AT_DropExpression
Definition: parsenodes.h:2363
@ AT_AddIndex
Definition: parsenodes.h:2370
@ AT_EnableReplicaRule
Definition: parsenodes.h:2403
@ AT_ReAddIndex
Definition: parsenodes.h:2371
@ AT_DropConstraint
Definition: parsenodes.h:2378
@ AT_SetNotNull
Definition: parsenodes.h:2360
@ AT_ClusterOn
Definition: parsenodes.h:2383
@ AT_AddIdentity
Definition: parsenodes.h:2420
@ AT_ForceRowSecurity
Definition: parsenodes.h:2412
@ AT_EnableAlwaysRule
Definition: parsenodes.h:2402
@ AT_SetAccessMethod
Definition: parsenodes.h:2388
@ AT_AlterColumnType
Definition: parsenodes.h:2380
@ AT_DetachPartitionFinalize
Definition: parsenodes.h:2417
@ AT_AddInherit
Definition: parsenodes.h:2405
@ AT_ReAddDomainConstraint
Definition: parsenodes.h:2374
@ AT_EnableTrig
Definition: parsenodes.h:2393
@ AT_DropColumn
Definition: parsenodes.h:2369
@ AT_ReAddComment
Definition: parsenodes.h:2379
@ AT_AlterColumnGenericOptions
Definition: parsenodes.h:2381
@ AT_DisableTrigAll
Definition: parsenodes.h:2398
@ AT_EnableRule
Definition: parsenodes.h:2401
@ AT_NoForceRowSecurity
Definition: parsenodes.h:2413
@ AT_DetachPartition
Definition: parsenodes.h:2416
@ AT_SetStatistics
Definition: parsenodes.h:2364
@ AT_AttachPartition
Definition: parsenodes.h:2415
@ AT_AddConstraint
Definition: parsenodes.h:2372
@ AT_DropInherit
Definition: parsenodes.h:2406
@ AT_EnableAlwaysTrig
Definition: parsenodes.h:2394
@ AT_SetLogged
Definition: parsenodes.h:2385
@ AT_SetStorage
Definition: parsenodes.h:2367
@ AT_DisableRule
Definition: parsenodes.h:2404
@ AT_DisableRowSecurity
Definition: parsenodes.h:2411
@ AT_SetRelOptions
Definition: parsenodes.h:2390
@ AT_ChangeOwner
Definition: parsenodes.h:2382
@ AT_EnableTrigUser
Definition: parsenodes.h:2399
@ AT_SetExpression
Definition: parsenodes.h:2362
@ AT_ReAddConstraint
Definition: parsenodes.h:2373
@ AT_SetTableSpace
Definition: parsenodes.h:2389
@ AT_GenericOptions
Definition: parsenodes.h:2414
@ AT_ColumnDefault
Definition: parsenodes.h:2357
@ AT_CookedColumnDefault
Definition: parsenodes.h:2358
@ AT_AlterConstraint
Definition: parsenodes.h:2375
@ AT_EnableTrigAll
Definition: parsenodes.h:2397
@ AT_SplitPartition
Definition: parsenodes.h:2418
@ AT_DropCluster
Definition: parsenodes.h:2384
@ AT_ValidateConstraint
Definition: parsenodes.h:2376
@ AT_AddColumn
Definition: parsenodes.h:2355
struct WithCheckOption WithCheckOption
struct LockStmt LockStmt
GrantTargetType
Definition: parsenodes.h:2492
@ ACL_TARGET_DEFAULTS
Definition: parsenodes.h:2495
@ ACL_TARGET_OBJECT
Definition: parsenodes.h:2493
@ ACL_TARGET_ALL_IN_SCHEMA
Definition: parsenodes.h:2494
struct CreateEventTrigStmt CreateEventTrigStmt
struct JsonObjectAgg JsonObjectAgg
struct DropOwnedStmt DropOwnedStmt
struct VariableShowStmt VariableShowStmt
struct CreateTransformStmt CreateTransformStmt
struct AlterUserMappingStmt AlterUserMappingStmt
struct PartitionRangeDatum PartitionRangeDatum
struct A_ArrayExpr A_ArrayExpr
struct JsonFuncExpr JsonFuncExpr
struct RangeTableFunc RangeTableFunc
struct InferClause InferClause
struct RangeSubselect RangeSubselect
struct DropStmt DropStmt
struct CreateOpClassItem CreateOpClassItem
struct PrepareStmt PrepareStmt
struct AlterOpFamilyStmt AlterOpFamilyStmt
struct ConstraintsSetStmt ConstraintsSetStmt
struct JsonParseExpr JsonParseExpr
struct GrantStmt GrantStmt
struct A_Expr A_Expr
struct SetOperationStmt SetOperationStmt
struct SortBy SortBy
struct ViewStmt ViewStmt
struct CreateTrigStmt CreateTrigStmt
struct CTECycleClause CTECycleClause
struct VacuumRelation VacuumRelation
struct RenameStmt RenameStmt
struct DefineStmt DefineStmt
struct CreateStmt CreateStmt
struct CreateSchemaStmt CreateSchemaStmt
DiscardMode
Definition: parsenodes.h:3937
@ DISCARD_ALL
Definition: parsenodes.h:3938
@ DISCARD_PLANS
Definition: parsenodes.h:3939
@ DISCARD_SEQUENCES
Definition: parsenodes.h:3940
@ DISCARD_TEMP
Definition: parsenodes.h:3941
struct VariableSetStmt VariableSetStmt
struct JsonAggConstructor JsonAggConstructor
struct RawStmt RawStmt
struct CommonTableExpr CommonTableExpr
struct TableSampleClause TableSampleClause
struct AlterPolicyStmt AlterPolicyStmt
struct CreateConversionStmt CreateConversionStmt
struct ResTarget ResTarget
struct DropRoleStmt DropRoleStmt
struct DiscardStmt DiscardStmt
struct JsonKeyValue JsonKeyValue
struct AlterExtensionStmt AlterExtensionStmt
struct AlterTableStmt AlterTableStmt
struct TypeCast TypeCast
struct PartitionElem PartitionElem
struct ClosePortalStmt ClosePortalStmt
struct AccessPriv AccessPriv
struct Constraint Constraint
struct CreatePLangStmt CreatePLangStmt
struct CreateRangeStmt CreateRangeStmt
struct CreateUserMappingStmt CreateUserMappingStmt
SortByDir
Definition: parsenodes.h:45
@ SORTBY_USING
Definition: parsenodes.h:49
@ SORTBY_DESC
Definition: parsenodes.h:48
@ SORTBY_ASC
Definition: parsenodes.h:47
@ SORTBY_DEFAULT
Definition: parsenodes.h:46
struct AlterDatabaseSetStmt AlterDatabaseSetStmt
struct AlterTableMoveAllStmt AlterTableMoveAllStmt
struct AlterSeqStmt AlterSeqStmt
struct PublicationTable PublicationTable
struct RowMarkClause RowMarkClause
struct CreateTableAsStmt CreateTableAsStmt
struct TransactionStmt TransactionStmt
struct CreateFdwStmt CreateFdwStmt
struct DeclareCursorStmt DeclareCursorStmt
struct ExecuteStmt ExecuteStmt
struct WindowClause WindowClause
RoleStmtType
Definition: parsenodes.h:3086
@ ROLESTMT_ROLE
Definition: parsenodes.h:3087
@ ROLESTMT_USER
Definition: parsenodes.h:3088
@ ROLESTMT_GROUP
Definition: parsenodes.h:3089
struct RuleStmt RuleStmt
struct SecLabelStmt SecLabelStmt
struct AlterTSConfigurationStmt AlterTSConfigurationStmt
struct AlterDatabaseStmt AlterDatabaseStmt
struct AlterExtensionContentsStmt AlterExtensionContentsStmt
TableLikeOption
Definition: parsenodes.h:760
@ CREATE_TABLE_LIKE_COMMENTS
Definition: parsenodes.h:761
@ CREATE_TABLE_LIKE_GENERATED
Definition: parsenodes.h:765
@ CREATE_TABLE_LIKE_IDENTITY
Definition: parsenodes.h:766
@ CREATE_TABLE_LIKE_COMPRESSION
Definition: parsenodes.h:762
@ CREATE_TABLE_LIKE_STORAGE
Definition: parsenodes.h:769
@ CREATE_TABLE_LIKE_ALL
Definition: parsenodes.h:770
@ CREATE_TABLE_LIKE_INDEXES
Definition: parsenodes.h:767
@ CREATE_TABLE_LIKE_DEFAULTS
Definition: parsenodes.h:764
@ CREATE_TABLE_LIKE_STATISTICS
Definition: parsenodes.h:768
@ CREATE_TABLE_LIKE_CONSTRAINTS
Definition: parsenodes.h:763
struct TypeName TypeName
struct AlterEnumStmt AlterEnumStmt
struct CreateCastStmt CreateCastStmt
struct CheckPointStmt CheckPointStmt
struct RefreshMatViewStmt RefreshMatViewStmt
struct CallStmt CallStmt
struct TruncateStmt TruncateStmt
struct DefElem DefElem
struct AlterFdwStmt AlterFdwStmt
struct RangeTblEntry RangeTblEntry
SetQuantifier
Definition: parsenodes.h:61
@ SET_QUANTIFIER_ALL
Definition: parsenodes.h:63
@ SET_QUANTIFIER_DISTINCT
Definition: parsenodes.h:64
@ SET_QUANTIFIER_DEFAULT
Definition: parsenodes.h:62
ViewCheckOption
Definition: parsenodes.h:3746
@ NO_CHECK_OPTION
Definition: parsenodes.h:3747
@ CASCADED_CHECK_OPTION
Definition: parsenodes.h:3749
@ LOCAL_CHECK_OPTION
Definition: parsenodes.h:3748
struct FuncCall FuncCall
struct RangeTableFuncCol RangeTableFuncCol
struct SortGroupClause SortGroupClause
struct CollateClause CollateClause
struct ExplainStmt ExplainStmt
struct AlterTypeStmt AlterTypeStmt
CTEMaterialize
Definition: parsenodes.h:1642
@ CTEMaterializeNever
Definition: parsenodes.h:1645
@ CTEMaterializeAlways
Definition: parsenodes.h:1644
@ CTEMaterializeDefault
Definition: parsenodes.h:1643
struct CallContext CallContext
struct ObjectWithArgs ObjectWithArgs
struct ReplicaIdentityStmt ReplicaIdentityStmt
struct DoStmt DoStmt
struct CompositeTypeStmt CompositeTypeStmt
struct JsonTable JsonTable
struct FetchStmt FetchStmt
struct JsonSerializeExpr JsonSerializeExpr
struct PartitionSpec PartitionSpec
struct CTESearchClause CTESearchClause
unsigned int Oid
Definition: postgres_ext.h:31
XmlOptionType
Definition: primnodes.h:1561
JsonWrapper
Definition: primnodes.h:1715
OnCommitAction
Definition: primnodes.h:56
JsonExprOp
Definition: primnodes.h:1767
CoercionForm
Definition: primnodes.h:703
OverridingKind
Definition: primnodes.h:26
MergeMatchKind
Definition: primnodes.h:1967
CoercionContext
Definition: primnodes.h:683
Oid RelFileNumber
Definition: relpath.h:25
NodeTag type
Definition: parsenodes.h:491
List * elements
Definition: parsenodes.h:492
ParseLoc location
Definition: parsenodes.h:493
bool isnull
Definition: parsenodes.h:363
union ValUnion val
Definition: parsenodes.h:362
ParseLoc location
Definition: parsenodes.h:364
pg_node_attr(custom_copy_equal, custom_read_write, custom_query_jumble) NodeTag type
ParseLoc location
Definition: parsenodes.h:338
Node * lexpr
Definition: parsenodes.h:336
pg_node_attr(custom_read_write) NodeTag type
List * name
Definition: parsenodes.h:335
A_Expr_Kind kind
Definition: parsenodes.h:334
Node * rexpr
Definition: parsenodes.h:337
bool is_slice
Definition: parsenodes.h:459
Node * uidx
Definition: parsenodes.h:461
NodeTag type
Definition: parsenodes.h:458
Node * lidx
Definition: parsenodes.h:460
NodeTag type
Definition: parsenodes.h:481
List * indirection
Definition: parsenodes.h:483
NodeTag type
Definition: parsenodes.h:447
char * priv_name
Definition: parsenodes.h:2550
NodeTag type
Definition: parsenodes.h:2549
List * cols
Definition: parsenodes.h:2551
VariableSetStmt * setstmt
Definition: parsenodes.h:3805
DropBehavior behavior
Definition: parsenodes.h:2482
char * newValNeighbor
Definition: parsenodes.h:3736
List * typeName
Definition: parsenodes.h:3733
bool skipIfNewValExists
Definition: parsenodes.h:3738
bool newValIsAfter
Definition: parsenodes.h:3737
NodeTag type
Definition: parsenodes.h:3732
List * func_options
Definition: parsenodes.h:2872
List * options
Definition: parsenodes.h:2873
char * fdwname
Definition: parsenodes.h:2871
NodeTag type
Definition: parsenodes.h:2870
ObjectWithArgs * func
Definition: parsenodes.h:3476
ObjectType objtype
Definition: parsenodes.h:3475
ObjectWithArgs * opername
Definition: parsenodes.h:3599
RangeVar * relation
Definition: parsenodes.h:3587
RoleSpec * newowner
Definition: parsenodes.h:3589
ObjectType objectType
Definition: parsenodes.h:3586
char * policy_name
Definition: parsenodes.h:2989
RangeVar * table
Definition: parsenodes.h:2990
AlterPublicationAction action
Definition: parsenodes.h:4202
RoleSpec * role
Definition: parsenodes.h:3111
VariableSetStmt * setstmt
Definition: parsenodes.h:3113
List * options
Definition: parsenodes.h:3104
NodeTag type
Definition: parsenodes.h:3102
RoleSpec * role
Definition: parsenodes.h:3103
List * options
Definition: parsenodes.h:3142
RangeVar * sequence
Definition: parsenodes.h:3141
bool for_identity
Definition: parsenodes.h:3143
NodeTag type
Definition: parsenodes.h:3140
Node * stxstattarget
Definition: parsenodes.h:3431
AlterSubscriptionType kind
Definition: parsenodes.h:4230
VariableSetStmt * setstmt
Definition: parsenodes.h:3827
AlterTSConfigType kind
Definition: parsenodes.h:4129
NodeTag type
Definition: parsenodes.h:2435
RoleSpec * newowner
Definition: parsenodes.h:2441
DropBehavior behavior
Definition: parsenodes.h:2444
AlterTableType subtype
Definition: parsenodes.h:2436
RangeVar * relation
Definition: parsenodes.h:2347
ObjectType objtype
Definition: parsenodes.h:2349
List * options
Definition: parsenodes.h:3611
List * typeName
Definition: parsenodes.h:3610
NodeTag type
Definition: parsenodes.h:3609
Definition: value.h:56
char * cycle_path_column
Definition: parsenodes.h:1664
ParseLoc location
Definition: parsenodes.h:1665
Node * cycle_mark_default
Definition: parsenodes.h:1663
Oid cycle_mark_collation
Definition: parsenodes.h:1669
List * cycle_col_list
Definition: parsenodes.h:1660
char * cycle_mark_column
Definition: parsenodes.h:1661
Node * cycle_mark_value
Definition: parsenodes.h:1662
ParseLoc location
Definition: parsenodes.h:1654
char * search_seq_column
Definition: parsenodes.h:1653
bool search_breadth_first
Definition: parsenodes.h:1652
List * search_col_list
Definition: parsenodes.h:1651
pg_node_attr(nodetag_only) NodeTag type
FuncExpr * funcexpr
Definition: parsenodes.h:3520
NodeTag type
Definition: parsenodes.h:3516
List * outargs
Definition: parsenodes.h:3522
FuncCall *funccall pg_node_attr(query_jumble_ignore)
char * indexname
Definition: parsenodes.h:3838
RangeVar * relation
Definition: parsenodes.h:3837
NodeTag type
Definition: parsenodes.h:3836
List * params
Definition: parsenodes.h:3839
List * collname
Definition: parsenodes.h:385
ParseLoc location
Definition: parsenodes.h:386
NodeTag type
Definition: parsenodes.h:383
bool is_not_null
Definition: parsenodes.h:731
CollateClause * collClause
Definition: parsenodes.h:741
char identity
Definition: parsenodes.h:737
RangeVar * identitySequence
Definition: parsenodes.h:738
List * constraints
Definition: parsenodes.h:743
Node * cooked_default
Definition: parsenodes.h:736
char * storage_name
Definition: parsenodes.h:734
int inhcount
Definition: parsenodes.h:729
char * colname
Definition: parsenodes.h:726
TypeName * typeName
Definition: parsenodes.h:727
char generated
Definition: parsenodes.h:740
NodeTag type
Definition: parsenodes.h:725
bool is_from_type
Definition: parsenodes.h:732
List * fdwoptions
Definition: parsenodes.h:744
Node * raw_default
Definition: parsenodes.h:735
char storage
Definition: parsenodes.h:733
Oid collOid
Definition: parsenodes.h:742
bool is_local
Definition: parsenodes.h:730
char * compression
Definition: parsenodes.h:728
ParseLoc location
Definition: parsenodes.h:745
ParseLoc location
Definition: parsenodes.h:295
List * fields
Definition: parsenodes.h:294
NodeTag type
Definition: parsenodes.h:293
char * comment
Definition: parsenodes.h:3268
ObjectType objtype
Definition: parsenodes.h:3266
NodeTag type
Definition: parsenodes.h:3265
Node * object
Definition: parsenodes.h:3267
int cterefcount pg_node_attr(query_jumble_ignore)
CTEMaterialize ctematerialized
Definition: parsenodes.h:1684
List *aliascolnames pg_node_attr(query_jumble_ignore)
List *ctecolcollations pg_node_attr(query_jumble_ignore)
CTECycleClause *cycle_clause pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition: parsenodes.h:1689
List *ctecoltypes pg_node_attr(query_jumble_ignore)
List *ctecolnames pg_node_attr(query_jumble_ignore)
List *ctecoltypmods pg_node_attr(query_jumble_ignore)
bool cterecursive pg_node_attr(query_jumble_ignore)
CTESearchClause *search_clause pg_node_attr(query_jumble_ignore)
RangeVar * typevar
Definition: parsenodes.h:3700
bool initdeferred
Definition: parsenodes.h:2742
List * exclusions
Definition: parsenodes.h:2759
ParseLoc location
Definition: parsenodes.h:2783
bool reset_default_tblspc
Definition: parsenodes.h:2764
List * keys
Definition: parsenodes.h:2754
List * pk_attrs
Definition: parsenodes.h:2772
List * fk_del_set_cols
Definition: parsenodes.h:2778
bool fk_with_period
Definition: parsenodes.h:2773
Node * where_clause
Definition: parsenodes.h:2767
char * indexname
Definition: parsenodes.h:2762
char * indexspace
Definition: parsenodes.h:2763
ConstrType contype
Definition: parsenodes.h:2739
char * access_method
Definition: parsenodes.h:2766
Oid old_pktable_oid
Definition: parsenodes.h:2780
bool is_no_inherit
Definition: parsenodes.h:2745
List * options
Definition: parsenodes.h:2761
char fk_upd_action
Definition: parsenodes.h:2776
List * old_conpfeqop
Definition: parsenodes.h:2779
char fk_matchtype
Definition: parsenodes.h:2775
bool nulls_not_distinct
Definition: parsenodes.h:2753
bool pk_with_period
Definition: parsenodes.h:2774
char * cooked_expr
Definition: parsenodes.h:2748
bool initially_valid
Definition: parsenodes.h:2744
bool skip_validation
Definition: parsenodes.h:2743
bool without_overlaps
Definition: parsenodes.h:2756
bool deferrable
Definition: parsenodes.h:2741
NodeTag type
Definition: parsenodes.h:2738
Node * raw_expr
Definition: parsenodes.h:2746
char * conname
Definition: parsenodes.h:2740
char generated_when
Definition: parsenodes.h:2750
RangeVar * pktable
Definition: parsenodes.h:2770
List * including
Definition: parsenodes.h:2757
char fk_del_action
Definition: parsenodes.h:2777
List * fk_attrs
Definition: parsenodes.h:2771
bool is_program
Definition: parsenodes.h:2602
RangeVar * relation
Definition: parsenodes.h:2596
List * options
Definition: parsenodes.h:2604
bool is_from
Definition: parsenodes.h:2601
char * filename
Definition: parsenodes.h:2603
NodeTag type
Definition: parsenodes.h:2595
List * attlist
Definition: parsenodes.h:2599
Node * whereClause
Definition: parsenodes.h:2605
Node * query
Definition: parsenodes.h:2597
NodeTag type
Definition: parsenodes.h:3002
List * handler_name
Definition: parsenodes.h:3004
char * amname
Definition: parsenodes.h:3003
TypeName * sourcetype
Definition: parsenodes.h:4017
TypeName * targettype
Definition: parsenodes.h:4018
CoercionContext context
Definition: parsenodes.h:4020
ObjectWithArgs * func
Definition: parsenodes.h:4019
TypeName * typeName
Definition: parsenodes.h:3171
CollateClause * collClause
Definition: parsenodes.h:3172
NodeTag type
Definition: parsenodes.h:2862
List * func_options
Definition: parsenodes.h:2864
char * fdwname
Definition: parsenodes.h:2863
List * options
Definition: parsenodes.h:2865
TypeName * returnType
Definition: parsenodes.h:3446
ObjectWithArgs * name
Definition: parsenodes.h:3199
TypeName * storedtype
Definition: parsenodes.h:3205
TypeName * datatype
Definition: parsenodes.h:3186
List * plvalidator
Definition: parsenodes.h:3072
RangeVar * table
Definition: parsenodes.h:2974
RoleStmtType stmt_type
Definition: parsenodes.h:3095
RoleSpec * authrole
Definition: parsenodes.h:2329
bool if_not_exists
Definition: parsenodes.h:3135
List * options
Definition: parsenodes.h:3132
NodeTag type
Definition: parsenodes.h:3130
RangeVar * sequence
Definition: parsenodes.h:3131
List * tableElts
Definition: parsenodes.h:2659
List * nnconstraints
Definition: parsenodes.h:2666
TypeName * ofTypename
Definition: parsenodes.h:2664
OnCommitAction oncommit
Definition: parsenodes.h:2668
List * options
Definition: parsenodes.h:2667
bool if_not_exists
Definition: parsenodes.h:2671
List * inhRelations
Definition: parsenodes.h:2660
RangeVar * relation
Definition: parsenodes.h:2658
char * tablespacename
Definition: parsenodes.h:2669
PartitionSpec * partspec
Definition: parsenodes.h:2663
NodeTag type
Definition: parsenodes.h:2657
PartitionBoundSpec * partbound
Definition: parsenodes.h:2662
char * accessMethod
Definition: parsenodes.h:2670
List * constraints
Definition: parsenodes.h:2665
IntoClause * into
Definition: parsenodes.h:3904
ObjectType objtype
Definition: parsenodes.h:3905
ObjectWithArgs * tosql
Definition: parsenodes.h:4035
TypeName * type_name
Definition: parsenodes.h:4032
ObjectWithArgs * fromsql
Definition: parsenodes.h:4034
Node * whenClause
Definition: parsenodes.h:3027
List * transitionRels
Definition: parsenodes.h:3029
RangeVar * constrrel
Definition: parsenodes.h:3033
RangeVar * relation
Definition: parsenodes.h:3018
NodeTag type
Definition: parsenodes.h:3779
List * options
Definition: parsenodes.h:3781
char * dbname
Definition: parsenodes.h:3780
char *name pg_node_attr(query_jumble_ignore)
ParseLoc location pg_node_attr(query_jumble_location)
char * defnamespace
Definition: parsenodes.h:814
NodeTag type
Definition: parsenodes.h:813
DefElemAction defaction
Definition: parsenodes.h:818
char * defname
Definition: parsenodes.h:815
ParseLoc location
Definition: parsenodes.h:819
Node * arg
Definition: parsenodes.h:816
bool oldstyle
Definition: parsenodes.h:3155
List * definition
Definition: parsenodes.h:3158
List * defnames
Definition: parsenodes.h:3156
List * args
Definition: parsenodes.h:3157
NodeTag type
Definition: parsenodes.h:3153
ObjectType kind
Definition: parsenodes.h:3154
bool replace
Definition: parsenodes.h:3160
bool if_not_exists
Definition: parsenodes.h:3159
WithClause * withClause
Definition: parsenodes.h:2067
Node * whereClause
Definition: parsenodes.h:2065
RangeVar * relation
Definition: parsenodes.h:2063
List * usingClause
Definition: parsenodes.h:2064
List * returningList
Definition: parsenodes.h:2066
NodeTag type
Definition: parsenodes.h:2062
NodeTag type
Definition: parsenodes.h:3946
DiscardMode target
Definition: parsenodes.h:3947
NodeTag type
Definition: parsenodes.h:3488
List * args
Definition: parsenodes.h:3489
DropBehavior behavior
Definition: parsenodes.h:4091
NodeTag type
Definition: parsenodes.h:4089
NodeTag type
Definition: parsenodes.h:3118
List * roles
Definition: parsenodes.h:3119
bool missing_ok
Definition: parsenodes.h:3243
List * objects
Definition: parsenodes.h:3240
ObjectType removeType
Definition: parsenodes.h:3241
bool concurrent
Definition: parsenodes.h:3244
DropBehavior behavior
Definition: parsenodes.h:3242
NodeTag type
Definition: parsenodes.h:3239
DropBehavior behavior
Definition: parsenodes.h:4242
List * options
Definition: parsenodes.h:3817
char * dbname
Definition: parsenodes.h:3815
bool missing_ok
Definition: parsenodes.h:3816
NodeTag type
Definition: parsenodes.h:3814
List * params
Definition: parsenodes.h:4060
NodeTag type
Definition: parsenodes.h:4058
char * name
Definition: parsenodes.h:4059
NodeTag type
Definition: parsenodes.h:3882
Node * query
Definition: parsenodes.h:3883
List * options
Definition: parsenodes.h:3884
long howMany
Definition: parsenodes.h:3343
bool ismove
Definition: parsenodes.h:3345
FetchDirection direction
Definition: parsenodes.h:3342
char * portalname
Definition: parsenodes.h:3344
NodeTag type
Definition: parsenodes.h:3341
Definition: value.h:48
bool agg_within_group
Definition: parsenodes.h:431
CoercionForm funcformat
Definition: parsenodes.h:435
Node * agg_filter
Definition: parsenodes.h:429
List * agg_order
Definition: parsenodes.h:428
List * funcname
Definition: parsenodes.h:426
List * args
Definition: parsenodes.h:427
bool agg_star
Definition: parsenodes.h:432
bool agg_distinct
Definition: parsenodes.h:433
NodeTag type
Definition: parsenodes.h:425
ParseLoc location
Definition: parsenodes.h:436
bool func_variadic
Definition: parsenodes.h:434
struct WindowDef * over
Definition: parsenodes.h:430
TypeName * argType
Definition: parsenodes.h:3467
FunctionParameterMode mode
Definition: parsenodes.h:3468
DropBehavior behavior
Definition: parsenodes.h:2571
NodeTag type
Definition: parsenodes.h:2565
RoleSpec * grantor
Definition: parsenodes.h:2570
List * grantee_roles
Definition: parsenodes.h:2567
List * granted_roles
Definition: parsenodes.h:2566
ObjectType objtype
Definition: parsenodes.h:2503
bool is_grant
Definition: parsenodes.h:2501
List * objects
Definition: parsenodes.h:2504
bool grant_option
Definition: parsenodes.h:2509
List * grantees
Definition: parsenodes.h:2508
List * privileges
Definition: parsenodes.h:2506
GrantTargetType targtype
Definition: parsenodes.h:2502
NodeTag type
Definition: parsenodes.h:2500
DropBehavior behavior
Definition: parsenodes.h:2511
RoleSpec * grantor
Definition: parsenodes.h:2510
NodeTag type
Definition: parsenodes.h:1511
List * content
Definition: parsenodes.h:1513
GroupingSetKind kind pg_node_attr(query_jumble_ignore)
ParseLoc location
Definition: parsenodes.h:1514
ImportForeignSchemaType list_type
Definition: parsenodes.h:2961
Node * expr
Definition: parsenodes.h:784
SortByDir ordering
Definition: parsenodes.h:789
List * opclassopts
Definition: parsenodes.h:788
NodeTag type
Definition: parsenodes.h:782
char * indexcolname
Definition: parsenodes.h:785
SortByNulls nulls_ordering
Definition: parsenodes.h:790
List * opclass
Definition: parsenodes.h:787
char * name
Definition: parsenodes.h:783
List * collation
Definition: parsenodes.h:786
bool unique
Definition: parsenodes.h:3378
bool reset_default_tblspc
Definition: parsenodes.h:3388
NodeTag type
Definition: parsenodes.h:3361
bool deferrable
Definition: parsenodes.h:3383
List * indexParams
Definition: parsenodes.h:3366
Oid indexOid
Definition: parsenodes.h:3373
bool initdeferred
Definition: parsenodes.h:3384
RangeVar * relation
Definition: parsenodes.h:3363
SubTransactionId oldFirstRelfilelocatorSubid
Definition: parsenodes.h:3376
bool iswithoutoverlaps
Definition: parsenodes.h:3382
bool transformed
Definition: parsenodes.h:3385
List * options
Definition: parsenodes.h:3369
char * tableSpace
Definition: parsenodes.h:3365
SubTransactionId oldCreateSubid
Definition: parsenodes.h:3375
bool isconstraint
Definition: parsenodes.h:3381
List * excludeOpNames
Definition: parsenodes.h:3371
bool nulls_not_distinct
Definition: parsenodes.h:3379
bool concurrent
Definition: parsenodes.h:3386
char * idxname
Definition: parsenodes.h:3362
Node * whereClause
Definition: parsenodes.h:3370
bool if_not_exists
Definition: parsenodes.h:3387
char * accessMethod
Definition: parsenodes.h:3364
char * idxcomment
Definition: parsenodes.h:3372
RelFileNumber oldNumber
Definition: parsenodes.h:3374
bool primary
Definition: parsenodes.h:3380
List * indexIncludingParams
Definition: parsenodes.h:3367
NodeTag type
Definition: parsenodes.h:1613
ParseLoc location
Definition: parsenodes.h:1617
char * conname
Definition: parsenodes.h:1616
List * indexElems
Definition: parsenodes.h:1614
Node * whereClause
Definition: parsenodes.h:1615
pg_node_attr(nodetag_only) NodeTag type
char * source_text
Definition: parsenodes.h:3497
OnConflictClause * onConflictClause
Definition: parsenodes.h:2050
Node * selectStmt
Definition: parsenodes.h:2049
WithClause * withClause
Definition: parsenodes.h:2052
NodeTag type
Definition: parsenodes.h:2046
RangeVar * relation
Definition: parsenodes.h:2047
List * cols
Definition: parsenodes.h:2048
List * returningList
Definition: parsenodes.h:2051
Definition: value.h:29
struct WindowDef * over
Definition: parsenodes.h:1973
JsonOutput * output
Definition: parsenodes.h:1970
JsonValueExpr * val
Definition: parsenodes.h:1770
NodeTag type
Definition: parsenodes.h:1769
bool absent_on_null
Definition: parsenodes.h:1999
NodeTag type
Definition: parsenodes.h:1996
JsonValueExpr * arg
Definition: parsenodes.h:1998
JsonAggConstructor * constructor
Definition: parsenodes.h:1997
JsonOutput * output
Definition: parsenodes.h:1943
JsonOutput * output
Definition: parsenodes.h:1799
char * column_name
Definition: parsenodes.h:1794
JsonWrapper wrapper
Definition: parsenodes.h:1802
JsonQuotes quotes
Definition: parsenodes.h:1803
JsonExprOp op
Definition: parsenodes.h:1793
List * passing
Definition: parsenodes.h:1798
JsonBehavior * on_empty
Definition: parsenodes.h:1800
ParseLoc location
Definition: parsenodes.h:1804
NodeTag type
Definition: parsenodes.h:1792
Node * pathspec
Definition: parsenodes.h:1797
JsonBehavior * on_error
Definition: parsenodes.h:1801
JsonValueExpr * context_item
Definition: parsenodes.h:1796
JsonValueExpr * value
Definition: parsenodes.h:1881
NodeTag type
Definition: parsenodes.h:1879
NodeTag type
Definition: parsenodes.h:1983
JsonAggConstructor * constructor
Definition: parsenodes.h:1984
JsonKeyValue * arg
Definition: parsenodes.h:1985
bool absent_on_null
Definition: parsenodes.h:1986
JsonOutput * output
Definition: parsenodes.h:1929
JsonReturning * returning
Definition: parsenodes.h:1760
TypeName * typeName
Definition: parsenodes.h:1759
NodeTag type
Definition: parsenodes.h:1758
JsonValueExpr * expr
Definition: parsenodes.h:1891
ParseLoc location
Definition: parsenodes.h:1894
JsonOutput * output
Definition: parsenodes.h:1892
NodeTag type
Definition: parsenodes.h:1890
ParseLoc location
Definition: parsenodes.h:1906
JsonOutput * output
Definition: parsenodes.h:1905
JsonOutput * output
Definition: parsenodes.h:1917
JsonValueExpr * expr
Definition: parsenodes.h:1916
ParseLoc location
Definition: parsenodes.h:1869
JsonTableColumnType coltype
Definition: parsenodes.h:1859
JsonBehavior * on_empty
Definition: parsenodes.h:1867
JsonWrapper wrapper
Definition: parsenodes.h:1864
JsonBehavior * on_error
Definition: parsenodes.h:1868
JsonQuotes quotes
Definition: parsenodes.h:1865
JsonFormat * format
Definition: parsenodes.h:1863
TypeName * typeName
Definition: parsenodes.h:1861
JsonTablePathSpec * pathspec
Definition: parsenodes.h:1862
ParseLoc name_location
Definition: parsenodes.h:1818
JsonBehavior * on_error
Definition: parsenodes.h:1833
List * columns
Definition: parsenodes.h:1832
JsonTablePathSpec * pathspec
Definition: parsenodes.h:1830
Alias * alias
Definition: parsenodes.h:1834
NodeTag type
Definition: parsenodes.h:1828
bool lateral
Definition: parsenodes.h:1835
List * passing
Definition: parsenodes.h:1831
JsonValueExpr * context_item
Definition: parsenodes.h:1829
ParseLoc location
Definition: parsenodes.h:1836
Definition: pg_list.h:54
NodeTag type
Definition: parsenodes.h:3647
char * conditionname
Definition: parsenodes.h:3648
NodeTag type
Definition: parsenodes.h:3769
char * filename
Definition: parsenodes.h:3770
NodeTag type
Definition: parsenodes.h:3956
bool nowait
Definition: parsenodes.h:3959
List * relations
Definition: parsenodes.h:3957
List * lockedRels
Definition: parsenodes.h:834
LockClauseStrength strength
Definition: parsenodes.h:835
LockWaitPolicy waitPolicy
Definition: parsenodes.h:836
NodeTag type
Definition: parsenodes.h:833
Node * sourceRelation
Definition: parsenodes.h:2093
List * mergeWhenClauses
Definition: parsenodes.h:2095
RangeVar * relation
Definition: parsenodes.h:2092
Node * joinCondition
Definition: parsenodes.h:2094
List * returningList
Definition: parsenodes.h:2096
WithClause * withClause
Definition: parsenodes.h:2097
NodeTag type
Definition: parsenodes.h:2091
CmdType commandType
Definition: parsenodes.h:1726
MergeMatchKind matchKind
Definition: parsenodes.h:1725
NodeTag type
Definition: parsenodes.h:534
Definition: nodes.h:129
char * payload
Definition: parsenodes.h:3638
char * conditionname
Definition: parsenodes.h:3637
NodeTag type
Definition: parsenodes.h:3636
List * objfuncargs
Definition: parsenodes.h:2536
bool args_unspecified
Definition: parsenodes.h:2537
InferClause * infer
Definition: parsenodes.h:1630
OnConflictAction action
Definition: parsenodes.h:1629
ParseLoc location
Definition: parsenodes.h:1633
NodeTag type
Definition: parsenodes.h:2231
SelectStmt * val
Definition: parsenodes.h:2236
ParseLoc location
Definition: parsenodes.h:2237
List * indirection
Definition: parsenodes.h:2234
ParseLoc location
Definition: parsenodes.h:305
int number
Definition: parsenodes.h:304
NodeTag type
Definition: parsenodes.h:303
PartitionBoundSpec * bound
Definition: parsenodes.h:958
List * partlist
Definition: parsenodes.h:959
bool concurrent
Definition: parsenodes.h:961
RangeVar * name
Definition: parsenodes.h:957
NodeTag type
Definition: parsenodes.h:956
List * collation
Definition: parsenodes.h:865
ParseLoc location
Definition: parsenodes.h:867
NodeTag type
Definition: parsenodes.h:862
List * opclass
Definition: parsenodes.h:866
PartitionRangeDatumKind kind
Definition: parsenodes.h:933
List * partParams
Definition: parsenodes.h:886
NodeTag type
Definition: parsenodes.h:884
ParseLoc location
Definition: parsenodes.h:887
PartitionStrategy strategy
Definition: parsenodes.h:885
List * argtypes
Definition: parsenodes.h:4046
NodeTag type
Definition: parsenodes.h:4044
char * name
Definition: parsenodes.h:4045
Node * query
Definition: parsenodes.h:4047
PublicationObjSpecType pubobjtype
Definition: parsenodes.h:4166
PublicationTable * pubtable
Definition: parsenodes.h:4168
RangeVar * relation
Definition: parsenodes.h:4146
List * rowMarks
Definition: parsenodes.h:217
int mergeTargetRelation pg_node_attr(query_jumble_ignore)
bool hasAggs pg_node_attr(query_jumble_ignore)
bool groupDistinct
Definition: parsenodes.h:201
bool hasRecursive pg_node_attr(query_jumble_ignore)
Node * mergeJoinCondition
Definition: parsenodes.h:189
Node * limitCount
Definition: parsenodes.h:214
List *constraintDeps pg_node_attr(query_jumble_ignore)
FromExpr * jointree
Definition: parsenodes.h:175
List * returningList
Definition: parsenodes.h:198
bool canSetTag pg_node_attr(query_jumble_ignore)
Node * setOperations
Definition: parsenodes.h:219
bool hasSubLinks pg_node_attr(query_jumble_ignore)
List * cteList
Definition: parsenodes.h:166
List *rteperminfos pg_node_attr(query_jumble_ignore)
OnConflictExpr * onConflict
Definition: parsenodes.h:196
OverridingKind override pg_node_attr(query_jumble_ignore)
List * groupClause
Definition: parsenodes.h:200
bool hasTargetSRFs pg_node_attr(query_jumble_ignore)
int resultRelation pg_node_attr(query_jumble_ignore)
Node * havingQual
Definition: parsenodes.h:205
List * rtable
Definition: parsenodes.h:168
ParseLoc stmt_len pg_node_attr(query_jumble_ignore)
bool hasDistinctOn pg_node_attr(query_jumble_ignore)
Node * limitOffset
Definition: parsenodes.h:213
bool isReturn pg_node_attr(query_jumble_ignore)
uint64 queryId pg_node_attr(equal_ignore, query_jumble_ignore, read_write_ignore, read_as(0))
bool hasWindowFuncs pg_node_attr(query_jumble_ignore)
CmdType commandType
Definition: parsenodes.h:121
LimitOption limitOption
Definition: parsenodes.h:215
Node * utilityStmt
Definition: parsenodes.h:136
List * mergeActionList
Definition: parsenodes.h:178
bool hasModifyingCTE pg_node_attr(query_jumble_ignore)
NodeTag type
Definition: parsenodes.h:119
List * windowClause
Definition: parsenodes.h:207
List * targetList
Definition: parsenodes.h:191
List * groupingSets
Definition: parsenodes.h:203
List * distinctClause
Definition: parsenodes.h:209
List *withCheckOptions pg_node_attr(query_jumble_ignore)
bool hasForUpdate pg_node_attr(query_jumble_ignore)
List * sortClause
Definition: parsenodes.h:211
ParseLoc stmt_location
Definition: parsenodes.h:238
bool hasRowSecurity pg_node_attr(query_jumble_ignore)
QuerySource querySource pg_node_attr(query_jumble_ignore)
Bitmapset * selectedCols
Definition: parsenodes.h:1297
AclMode requiredPerms
Definition: parsenodes.h:1295
Bitmapset * insertedCols
Definition: parsenodes.h:1298
Bitmapset * updatedCols
Definition: parsenodes.h:1299
Alias * alias
Definition: parsenodes.h:644
bool is_rowsfrom
Definition: parsenodes.h:642
List * coldeflist
Definition: parsenodes.h:645
List * functions
Definition: parsenodes.h:643
NodeTag type
Definition: parsenodes.h:639
Node * subquery
Definition: parsenodes.h:619
NodeTag type
Definition: parsenodes.h:617
Alias * alias
Definition: parsenodes.h:620
ParseLoc location
Definition: parsenodes.h:682
TypeName * typeName
Definition: parsenodes.h:677
List * namespaces
Definition: parsenodes.h:661
Node * docexpr
Definition: parsenodes.h:659
ParseLoc location
Definition: parsenodes.h:664
Node * rowexpr
Definition: parsenodes.h:660
List * columns
Definition: parsenodes.h:662
NodeTag type
Definition: parsenodes.h:657
Alias * alias
Definition: parsenodes.h:663
ParseLoc location
Definition: parsenodes.h:702
List *joinaliasvars pg_node_attr(query_jumble_ignore)
List *securityQuals pg_node_attr(query_jumble_ignore)
Cardinality enrtuples pg_node_attr(query_jumble_ignore)
char * ctename
Definition: parsenodes.h:1206
TableFunc * tablefunc
Definition: parsenodes.h:1194
Index ctelevelsup
Definition: parsenodes.h:1208
bool inFromCl pg_node_attr(query_jumble_ignore)
bool lateral pg_node_attr(query_jumble_ignore)
List *colcollations pg_node_attr(query_jumble_ignore)
bool security_barrier pg_node_attr(query_jumble_ignore)
bool funcordinality
Definition: parsenodes.h:1189
List *coltypes pg_node_attr(query_jumble_ignore)
struct TableSampleClause * tablesample
Definition: parsenodes.h:1108
Query * subquery
Definition: parsenodes.h:1114
List *joinrightcols pg_node_attr(query_jumble_ignore)
Alias *alias pg_node_attr(query_jumble_ignore)
List * values_lists
Definition: parsenodes.h:1200
char * enrname
Definition: parsenodes.h:1241
JoinType jointype
Definition: parsenodes.h:1161
List *coltypmods pg_node_attr(query_jumble_ignore)
List *joinleftcols pg_node_attr(query_jumble_ignore)
int rellockmode pg_node_attr(query_jumble_ignore)
pg_node_attr(custom_read_write) NodeTag type
char relkind pg_node_attr(query_jumble_ignore)
List * functions
Definition: parsenodes.h:1187
int joinmergedcols pg_node_attr(query_jumble_ignore)
Alias *join_using_alias pg_node_attr(query_jumble_ignore)
Index perminfoindex pg_node_attr(query_jumble_ignore)
bool self_reference pg_node_attr(query_jumble_ignore)
Alias *eref pg_node_attr(query_jumble_ignore)
RTEKind rtekind
Definition: parsenodes.h:1057
Bitmapset *funcparams pg_node_attr(query_jumble_ignore)
List *funccoltypes pg_node_attr(query_jumble_ignore)
int funccolcount pg_node_attr(query_jumble_ignore)
List *funccolcollations pg_node_attr(query_jumble_ignore)
List *funccoltypmods pg_node_attr(query_jumble_ignore)
List *funccolnames pg_node_attr(query_jumble_ignore)
ParseLoc stmt_location
Definition: parsenodes.h:2028
ParseLoc stmt_len
Definition: parsenodes.h:2029
pg_node_attr(no_query_jumble) NodeTag type
Node * stmt
Definition: parsenodes.h:2027
RoleSpec * newrole
Definition: parsenodes.h:4101
RangeVar * relation
Definition: parsenodes.h:3919
const char * name
Definition: parsenodes.h:3992
ReindexObjectType kind
Definition: parsenodes.h:3989
RangeVar * relation
Definition: parsenodes.h:3991
List * params
Definition: parsenodes.h:3993
NodeTag type
Definition: parsenodes.h:3988
RangeVar * relation
Definition: parsenodes.h:3542
bool missing_ok
Definition: parsenodes.h:3548
ObjectType relationType
Definition: parsenodes.h:3541
DropBehavior behavior
Definition: parsenodes.h:3547
ObjectType renameType
Definition: parsenodes.h:3540
NodeTag type
Definition: parsenodes.h:3539
char * newname
Definition: parsenodes.h:3546
char * subname
Definition: parsenodes.h:3544
Node * object
Definition: parsenodes.h:3543
Node * val
Definition: parsenodes.h:519
ParseLoc location
Definition: parsenodes.h:520
List * indirection
Definition: parsenodes.h:518
char * name
Definition: parsenodes.h:517
NodeTag type
Definition: parsenodes.h:516
NodeTag type
Definition: parsenodes.h:2217
Node * returnval
Definition: parsenodes.h:2218
ParseLoc location
Definition: parsenodes.h:406
RoleSpecType roletype
Definition: parsenodes.h:404
NodeTag type
Definition: parsenodes.h:403
char * rolename
Definition: parsenodes.h:405
NodeTag type
Definition: parsenodes.h:1583
LockClauseStrength strength
Definition: parsenodes.h:1585
LockWaitPolicy waitPolicy
Definition: parsenodes.h:1586
char * rulename
Definition: parsenodes.h:3622
Node * whereClause
Definition: parsenodes.h:3623
bool instead
Definition: parsenodes.h:3625
RangeVar * relation
Definition: parsenodes.h:3621
bool replace
Definition: parsenodes.h:3627
CmdType event
Definition: parsenodes.h:3624
List * actions
Definition: parsenodes.h:3626
NodeTag type
Definition: parsenodes.h:3620
ObjectType objtype
Definition: parsenodes.h:3278
NodeTag type
Definition: parsenodes.h:3277
Node * object
Definition: parsenodes.h:3279
char * provider
Definition: parsenodes.h:3280
char * label
Definition: parsenodes.h:3281
LimitOption limitOption
Definition: parsenodes.h:2156
List * sortClause
Definition: parsenodes.h:2153
List * targetList
Definition: parsenodes.h:2131
IntoClause * intoClause
Definition: parsenodes.h:2130
Node * limitOffset
Definition: parsenodes.h:2154
bool groupDistinct
Definition: parsenodes.h:2135
List * fromClause
Definition: parsenodes.h:2132
NodeTag type
Definition: parsenodes.h:2123
List * groupClause
Definition: parsenodes.h:2134
Node * havingClause
Definition: parsenodes.h:2136
List * lockingClause
Definition: parsenodes.h:2157
Node * limitCount
Definition: parsenodes.h:2155
List * windowClause
Definition: parsenodes.h:2137
List * distinctClause
Definition: parsenodes.h:2128
List * valuesLists
Definition: parsenodes.h:2147
struct SelectStmt * larg
Definition: parsenodes.h:2165
struct SelectStmt * rarg
Definition: parsenodes.h:2166
Node * whereClause
Definition: parsenodes.h:2133
SetOperation op
Definition: parsenodes.h:2163
WithClause * withClause
Definition: parsenodes.h:2158
List *groupClauses pg_node_attr(query_jumble_ignore)
List *colTypes pg_node_attr(query_jumble_ignore)
List *colCollations pg_node_attr(query_jumble_ignore)
SetOperation op
Definition: parsenodes.h:2193
List *colTypmods pg_node_attr(query_jumble_ignore)
PartitionBoundSpec * bound
Definition: parsenodes.h:948
SortByNulls sortby_nulls
Definition: parsenodes.h:548
Node * node
Definition: parsenodes.h:546
NodeTag type
Definition: parsenodes.h:545
List * useOp
Definition: parsenodes.h:549
SortByDir sortby_dir
Definition: parsenodes.h:547
ParseLoc location
Definition: parsenodes.h:550
bool hashable pg_node_attr(query_jumble_ignore)
Index tleSortGroupRef
Definition: parsenodes.h:1442
NodeTag type
Definition: parsenodes.h:3417
char * name
Definition: parsenodes.h:3418
Node * expr
Definition: parsenodes.h:3419
Definition: value.h:64
RangeVar * relation
Definition: parsenodes.h:754
char *savepoint_name pg_node_attr(query_jumble_ignore)
TransactionStmtKind kind
Definition: parsenodes.h:3682
char *gid pg_node_attr(query_jumble_ignore)
ParseLoc location pg_node_attr(query_jumble_location)
List * relations
Definition: parsenodes.h:3254
DropBehavior behavior
Definition: parsenodes.h:3256
bool restart_seqs
Definition: parsenodes.h:3255
NodeTag type
Definition: parsenodes.h:3253
TypeName * typeName
Definition: parsenodes.h:374
ParseLoc location
Definition: parsenodes.h:375
Node * arg
Definition: parsenodes.h:373
NodeTag type
Definition: parsenodes.h:372
bool setof
Definition: parsenodes.h:270
Oid typeOid
Definition: parsenodes.h:269
bool pct_type
Definition: parsenodes.h:271
List * names
Definition: parsenodes.h:268
NodeTag type
Definition: parsenodes.h:267
List * arrayBounds
Definition: parsenodes.h:274
int32 typemod
Definition: parsenodes.h:273
ParseLoc location
Definition: parsenodes.h:275
List * typmods
Definition: parsenodes.h:272
NodeTag type
Definition: parsenodes.h:3657
char * conditionname
Definition: parsenodes.h:3658
List * targetList
Definition: parsenodes.h:2078
List * returningList
Definition: parsenodes.h:2081
List * fromClause
Definition: parsenodes.h:2080
NodeTag type
Definition: parsenodes.h:2076
Node * whereClause
Definition: parsenodes.h:2079
RangeVar * relation
Definition: parsenodes.h:2077
WithClause * withClause
Definition: parsenodes.h:2082
RangeVar * relation
Definition: parsenodes.h:3867
NodeTag type
Definition: parsenodes.h:3851
List * options
Definition: parsenodes.h:3852
bool is_vacuumcmd
Definition: parsenodes.h:3854
List * rels
Definition: parsenodes.h:3853
VariableSetKind kind
Definition: parsenodes.h:2628
bool replace
Definition: parsenodes.h:3758
List * options
Definition: parsenodes.h:3759
Node * query
Definition: parsenodes.h:3757
List * aliases
Definition: parsenodes.h:3756
RangeVar * view
Definition: parsenodes.h:3755
NodeTag type
Definition: parsenodes.h:3754
ViewCheckOption withCheckOption
Definition: parsenodes.h:3760
bool inRangeNullsFirst pg_node_attr(query_jumble_ignore)
bool inRangeAsc pg_node_attr(query_jumble_ignore)
Node * startOffset
Definition: parsenodes.h:1550
char *refname pg_node_attr(query_jumble_ignore)
Oid inRangeColl pg_node_attr(query_jumble_ignore)
List * partitionClause
Definition: parsenodes.h:1546
NodeTag type
Definition: parsenodes.h:1541
bool copiedOrder pg_node_attr(query_jumble_ignore)
char *name pg_node_attr(query_jumble_ignore)
Oid startInRangeFunc pg_node_attr(query_jumble_ignore)
Oid endInRangeFunc pg_node_attr(query_jumble_ignore)
Node * endOffset
Definition: parsenodes.h:1551
List *runCondition pg_node_attr(query_jumble_ignore)
List * orderClause
Definition: parsenodes.h:1548
List * orderClause
Definition: parsenodes.h:567
ParseLoc location
Definition: parsenodes.h:571
NodeTag type
Definition: parsenodes.h:563
List * partitionClause
Definition: parsenodes.h:566
Node * startOffset
Definition: parsenodes.h:569
char * refname
Definition: parsenodes.h:565
Node * endOffset
Definition: parsenodes.h:570
int frameOptions
Definition: parsenodes.h:568
char * name
Definition: parsenodes.h:564
List * ctes
Definition: parsenodes.h:1600
NodeTag type
Definition: parsenodes.h:1599
ParseLoc location
Definition: parsenodes.h:1602
bool recursive
Definition: parsenodes.h:1601
ParseLoc location
Definition: parsenodes.h:849
TypeName * typeName
Definition: parsenodes.h:847
Node * expr
Definition: parsenodes.h:846
NodeTag type
Definition: parsenodes.h:844
XmlOptionType xmloption
Definition: parsenodes.h:845
BitString bsval
Definition: parsenodes.h:354
Node node
Definition: parsenodes.h:349
Float fval
Definition: parsenodes.h:351
String sval
Definition: parsenodes.h:353
Boolean boolval
Definition: parsenodes.h:352
Integer ival
Definition: parsenodes.h:350
const char * type
const char * name