PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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.
11  *
12  *
13  * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
14  * Portions Copyright (c) 1994, Regents of the University of California
15  *
16  * src/include/nodes/parsenodes.h
17  *
18  *-------------------------------------------------------------------------
19  */
20 #ifndef PARSENODES_H
21 #define PARSENODES_H
22 
23 #include "nodes/bitmapset.h"
24 #include "nodes/lockoptions.h"
25 #include "nodes/primnodes.h"
26 #include "nodes/value.h"
27 
28 /* Possible sources of a Query */
29 typedef enum QuerySource
30 {
31  QSRC_ORIGINAL, /* original parsetree (explicit query) */
32  QSRC_PARSER, /* added by parse analysis (now unused) */
33  QSRC_INSTEAD_RULE, /* added by unconditional INSTEAD rule */
34  QSRC_QUAL_INSTEAD_RULE, /* added by conditional INSTEAD rule */
35  QSRC_NON_INSTEAD_RULE /* added by non-INSTEAD rule */
36 } QuerySource;
37 
38 /* Sort ordering options for ORDER BY and CREATE INDEX */
39 typedef enum SortByDir
40 {
44  SORTBY_USING /* not allowed in CREATE INDEX ... */
45 } SortByDir;
46 
47 typedef enum SortByNulls
48 {
52 } SortByNulls;
53 
54 /*
55  * Grantable rights are encoded so that we can OR them together in a bitmask.
56  * The present representation of AclItem limits us to 16 distinct rights,
57  * even though AclMode is defined as uint32. See utils/acl.h.
58  *
59  * Caution: changing these codes breaks stored ACLs, hence forces initdb.
60  */
61 typedef uint32 AclMode; /* a bitmask of privilege bits */
62 
63 #define ACL_INSERT (1<<0) /* for relations */
64 #define ACL_SELECT (1<<1)
65 #define ACL_UPDATE (1<<2)
66 #define ACL_DELETE (1<<3)
67 #define ACL_TRUNCATE (1<<4)
68 #define ACL_REFERENCES (1<<5)
69 #define ACL_TRIGGER (1<<6)
70 #define ACL_EXECUTE (1<<7) /* for functions */
71 #define ACL_USAGE (1<<8) /* for languages, namespaces, FDWs, and
72  * servers */
73 #define ACL_CREATE (1<<9) /* for namespaces and databases */
74 #define ACL_CREATE_TEMP (1<<10) /* for databases */
75 #define ACL_CONNECT (1<<11) /* for databases */
76 #define N_ACL_RIGHTS 12 /* 1 plus the last 1<<x */
77 #define ACL_NO_RIGHTS 0
78 /* Currently, SELECT ... FOR [KEY] UPDATE/SHARE requires UPDATE privileges */
79 #define ACL_SELECT_FOR_UPDATE ACL_UPDATE
80 
81 
82 /*****************************************************************************
83  * Query Tree
84  *****************************************************************************/
85 
86 /*
87  * Query -
88  * Parse analysis turns all statements into a Query tree
89  * for further processing by the rewriter and planner.
90  *
91  * Utility statements (i.e. non-optimizable statements) have the
92  * utilityStmt field set, and the Query itself is mostly dummy.
93  * DECLARE CURSOR is a special case: it is represented like a SELECT,
94  * but the original DeclareCursorStmt is stored in utilityStmt.
95  *
96  * Planning converts a Query tree into a Plan tree headed by a PlannedStmt
97  * node --- the Query structure is not used by the executor.
98  */
99 typedef struct Query
100 {
102 
103  CmdType commandType; /* select|insert|update|delete|utility */
104 
105  QuerySource querySource; /* where did I come from? */
106 
107  uint32 queryId; /* query identifier (can be set by plugins) */
108 
109  bool canSetTag; /* do I set the command result tag? */
110 
111  Node *utilityStmt; /* non-null if this is DECLARE CURSOR or a
112  * non-optimizable statement */
113 
114  int resultRelation; /* rtable index of target relation for
115  * INSERT/UPDATE/DELETE; 0 for SELECT */
116 
117  bool hasAggs; /* has aggregates in tlist or havingQual */
118  bool hasWindowFuncs; /* has window functions in tlist */
119  bool hasSubLinks; /* has subquery SubLink */
120  bool hasDistinctOn; /* distinctClause is from DISTINCT ON */
121  bool hasRecursive; /* WITH RECURSIVE was specified */
122  bool hasModifyingCTE; /* has INSERT/UPDATE/DELETE in WITH */
123  bool hasForUpdate; /* FOR [KEY] UPDATE/SHARE was specified */
124  bool hasRowSecurity; /* rewriter has applied some RLS policy */
125 
126  List *cteList; /* WITH list (of CommonTableExpr's) */
127 
128  List *rtable; /* list of range table entries */
129  FromExpr *jointree; /* table join tree (FROM and WHERE clauses) */
130 
131  List *targetList; /* target list (of TargetEntry) */
132 
133  OnConflictExpr *onConflict; /* ON CONFLICT DO [NOTHING | UPDATE] */
134 
135  List *returningList; /* return-values list (of TargetEntry) */
136 
137  List *groupClause; /* a list of SortGroupClause's */
138 
139  List *groupingSets; /* a list of GroupingSet's if present */
140 
141  Node *havingQual; /* qualifications applied to groups */
142 
143  List *windowClause; /* a list of WindowClause's */
144 
145  List *distinctClause; /* a list of SortGroupClause's */
146 
147  List *sortClause; /* a list of SortGroupClause's */
148 
149  Node *limitOffset; /* # of result tuples to skip (int8 expr) */
150  Node *limitCount; /* # of result tuples to return (int8 expr) */
151 
152  List *rowMarks; /* a list of RowMarkClause's */
153 
154  Node *setOperations; /* set-operation tree if this is top level of
155  * a UNION/INTERSECT/EXCEPT query */
156 
157  List *constraintDeps; /* a list of pg_constraint OIDs that the query
158  * depends on to be semantically valid */
159 
160  List *withCheckOptions; /* a list of WithCheckOption's, which
161  * are only added during rewrite and
162  * therefore are not written out as
163  * part of Query. */
164 } Query;
165 
166 
167 /****************************************************************************
168  * Supporting data structures for Parse Trees
169  *
170  * Most of these node types appear in raw parsetrees output by the grammar,
171  * and get transformed to something else by the analyzer. A few of them
172  * are used as-is in transformed querytrees.
173  ****************************************************************************/
174 
175 /*
176  * TypeName - specifies a type in definitions
177  *
178  * For TypeName structures generated internally, it is often easier to
179  * specify the type by OID than by name. If "names" is NIL then the
180  * actual type OID is given by typeOid, otherwise typeOid is unused.
181  * Similarly, if "typmods" is NIL then the actual typmod is expected to
182  * be prespecified in typemod, otherwise typemod is unused.
183  *
184  * If pct_type is TRUE, then names is actually a field name and we look up
185  * the type of that field. Otherwise (the normal case), names is a type
186  * name possibly qualified with schema and database name.
187  */
188 typedef struct TypeName
189 {
191  List *names; /* qualified name (list of Value strings) */
192  Oid typeOid; /* type identified by OID */
193  bool setof; /* is a set? */
194  bool pct_type; /* %TYPE specified? */
195  List *typmods; /* type modifier expression(s) */
196  int32 typemod; /* prespecified type modifier */
197  List *arrayBounds; /* array bounds */
198  int location; /* token location, or -1 if unknown */
199 } TypeName;
200 
201 /*
202  * ColumnRef - specifies a reference to a column, or possibly a whole tuple
203  *
204  * The "fields" list must be nonempty. It can contain string Value nodes
205  * (representing names) and A_Star nodes (representing occurrence of a '*').
206  * Currently, A_Star must appear only as the last list element --- the grammar
207  * is responsible for enforcing this!
208  *
209  * Note: any array subscripting or selection of fields from composite columns
210  * is represented by an A_Indirection node above the ColumnRef. However,
211  * for simplicity in the normal case, initial field selection from a table
212  * name is represented within ColumnRef and not by adding A_Indirection.
213  */
214 typedef struct ColumnRef
215 {
217  List *fields; /* field names (Value strings) or A_Star */
218  int location; /* token location, or -1 if unknown */
219 } ColumnRef;
220 
221 /*
222  * ParamRef - specifies a $n parameter reference
223  */
224 typedef struct ParamRef
225 {
227  int number; /* the number of the parameter */
228  int location; /* token location, or -1 if unknown */
229 } ParamRef;
230 
231 /*
232  * A_Expr - infix, prefix, and postfix expressions
233  */
234 typedef enum A_Expr_Kind
235 {
236  AEXPR_OP, /* normal operator */
237  AEXPR_OP_ANY, /* scalar op ANY (array) */
238  AEXPR_OP_ALL, /* scalar op ALL (array) */
239  AEXPR_DISTINCT, /* IS DISTINCT FROM - name must be "=" */
240  AEXPR_NOT_DISTINCT, /* IS NOT DISTINCT FROM - name must be "=" */
241  AEXPR_NULLIF, /* NULLIF - name must be "=" */
242  AEXPR_OF, /* IS [NOT] OF - name must be "=" or "<>" */
243  AEXPR_IN, /* [NOT] IN - name must be "=" or "<>" */
244  AEXPR_LIKE, /* [NOT] LIKE - name must be "~~" or "!~~" */
245  AEXPR_ILIKE, /* [NOT] ILIKE - name must be "~~*" or "!~~*" */
246  AEXPR_SIMILAR, /* [NOT] SIMILAR - name must be "~" or "!~" */
247  AEXPR_BETWEEN, /* name must be "BETWEEN" */
248  AEXPR_NOT_BETWEEN, /* name must be "NOT BETWEEN" */
249  AEXPR_BETWEEN_SYM, /* name must be "BETWEEN SYMMETRIC" */
250  AEXPR_NOT_BETWEEN_SYM, /* name must be "NOT BETWEEN SYMMETRIC" */
251  AEXPR_PAREN /* nameless dummy node for parentheses */
252 } A_Expr_Kind;
253 
254 typedef struct A_Expr
255 {
257  A_Expr_Kind kind; /* see above */
258  List *name; /* possibly-qualified name of operator */
259  Node *lexpr; /* left argument, or NULL if none */
260  Node *rexpr; /* right argument, or NULL if none */
261  int location; /* token location, or -1 if unknown */
262 } A_Expr;
263 
264 /*
265  * A_Const - a literal constant
266  */
267 typedef struct A_Const
268 {
270  Value val; /* value (includes type info, see value.h) */
271  int location; /* token location, or -1 if unknown */
272 } A_Const;
273 
274 /*
275  * TypeCast - a CAST expression
276  */
277 typedef struct TypeCast
278 {
280  Node *arg; /* the expression being casted */
281  TypeName *typeName; /* the target type */
282  int location; /* token location, or -1 if unknown */
283 } TypeCast;
284 
285 /*
286  * CollateClause - a COLLATE expression
287  */
288 typedef struct CollateClause
289 {
291  Node *arg; /* input expression */
292  List *collname; /* possibly-qualified collation name */
293  int location; /* token location, or -1 if unknown */
294 } CollateClause;
295 
296 /*
297  * RoleSpec - a role name or one of a few special values.
298  */
299 typedef enum RoleSpecType
300 {
301  ROLESPEC_CSTRING, /* role name is stored as a C string */
302  ROLESPEC_CURRENT_USER, /* role spec is CURRENT_USER */
303  ROLESPEC_SESSION_USER, /* role spec is SESSION_USER */
304  ROLESPEC_PUBLIC /* role name is "public" */
305 } RoleSpecType;
306 
307 typedef struct RoleSpec
308 {
310  RoleSpecType roletype; /* Type of this rolespec */
311  char *rolename; /* filled only for ROLESPEC_CSTRING */
312  int location; /* token location, or -1 if unknown */
313 } RoleSpec;
314 
315 /*
316  * FuncCall - a function or aggregate invocation
317  *
318  * agg_order (if not NIL) indicates we saw 'foo(... ORDER BY ...)', or if
319  * agg_within_group is true, it was 'foo(...) WITHIN GROUP (ORDER BY ...)'.
320  * agg_star indicates we saw a 'foo(*)' construct, while agg_distinct
321  * indicates we saw 'foo(DISTINCT ...)'. In any of these cases, the
322  * construct *must* be an aggregate call. Otherwise, it might be either an
323  * aggregate or some other kind of function. However, if FILTER or OVER is
324  * present it had better be an aggregate or window function.
325  *
326  * Normally, you'd initialize this via makeFuncCall() and then only change the
327  * parts of the struct its defaults don't match afterwards, as needed.
328  */
329 typedef struct FuncCall
330 {
332  List *funcname; /* qualified name of function */
333  List *args; /* the arguments (list of exprs) */
334  List *agg_order; /* ORDER BY (list of SortBy) */
335  Node *agg_filter; /* FILTER clause, if any */
336  bool agg_within_group; /* ORDER BY appeared in WITHIN GROUP */
337  bool agg_star; /* argument was really '*' */
338  bool agg_distinct; /* arguments were labeled DISTINCT */
339  bool func_variadic; /* last argument was labeled VARIADIC */
340  struct WindowDef *over; /* OVER clause, if any */
341  int location; /* token location, or -1 if unknown */
342 } FuncCall;
343 
344 /*
345  * A_Star - '*' representing all columns of a table or compound field
346  *
347  * This can appear within ColumnRef.fields, A_Indirection.indirection, and
348  * ResTarget.indirection lists.
349  */
350 typedef struct A_Star
351 {
353 } A_Star;
354 
355 /*
356  * A_Indices - array subscript or slice bounds ([idx] or [lidx:uidx])
357  *
358  * In slice case, either or both of lidx and uidx can be NULL (omitted).
359  * In non-slice case, uidx holds the single subscript and lidx is always NULL.
360  */
361 typedef struct A_Indices
362 {
364  bool is_slice; /* true if slice (i.e., colon present) */
365  Node *lidx; /* slice lower bound, if any */
366  Node *uidx; /* subscript, or slice upper bound if any */
367 } A_Indices;
368 
369 /*
370  * A_Indirection - select a field and/or array element from an expression
371  *
372  * The indirection list can contain A_Indices nodes (representing
373  * subscripting), string Value nodes (representing field selection --- the
374  * string value is the name of the field to select), and A_Star nodes
375  * (representing selection of all fields of a composite type).
376  * For example, a complex selection operation like
377  * (foo).field1[42][7].field2
378  * would be represented with a single A_Indirection node having a 4-element
379  * indirection list.
380  *
381  * Currently, A_Star must appear only as the last list element --- the grammar
382  * is responsible for enforcing this!
383  */
384 typedef struct A_Indirection
385 {
387  Node *arg; /* the thing being selected from */
388  List *indirection; /* subscripts and/or field names and/or * */
389 } A_Indirection;
390 
391 /*
392  * A_ArrayExpr - an ARRAY[] construct
393  */
394 typedef struct A_ArrayExpr
395 {
397  List *elements; /* array element expressions */
398  int location; /* token location, or -1 if unknown */
399 } A_ArrayExpr;
400 
401 /*
402  * ResTarget -
403  * result target (used in target list of pre-transformed parse trees)
404  *
405  * In a SELECT target list, 'name' is the column label from an
406  * 'AS ColumnLabel' clause, or NULL if there was none, and 'val' is the
407  * value expression itself. The 'indirection' field is not used.
408  *
409  * INSERT uses ResTarget in its target-column-names list. Here, 'name' is
410  * the name of the destination column, 'indirection' stores any subscripts
411  * attached to the destination, and 'val' is not used.
412  *
413  * In an UPDATE target list, 'name' is the name of the destination column,
414  * 'indirection' stores any subscripts attached to the destination, and
415  * 'val' is the expression to assign.
416  *
417  * See A_Indirection for more info about what can appear in 'indirection'.
418  */
419 typedef struct ResTarget
420 {
422  char *name; /* column name or NULL */
423  List *indirection; /* subscripts, field names, and '*', or NIL */
424  Node *val; /* the value expression to compute or assign */
425  int location; /* token location, or -1 if unknown */
426 } ResTarget;
427 
428 /*
429  * MultiAssignRef - element of a row source expression for UPDATE
430  *
431  * In an UPDATE target list, when we have SET (a,b,c) = row-valued-expression,
432  * we generate separate ResTarget items for each of a,b,c. Their "val" trees
433  * are MultiAssignRef nodes numbered 1..n, linking to a common copy of the
434  * row-valued-expression (which parse analysis will process only once, when
435  * handling the MultiAssignRef with colno=1).
436  */
437 typedef struct MultiAssignRef
438 {
440  Node *source; /* the row-valued expression */
441  int colno; /* column number for this target (1..n) */
442  int ncolumns; /* number of targets in the construct */
444 
445 /*
446  * SortBy - for ORDER BY clause
447  */
448 typedef struct SortBy
449 {
451  Node *node; /* expression to sort on */
452  SortByDir sortby_dir; /* ASC/DESC/USING/default */
453  SortByNulls sortby_nulls; /* NULLS FIRST/LAST */
454  List *useOp; /* name of op to use, if SORTBY_USING */
455  int location; /* operator location, or -1 if none/unknown */
456 } SortBy;
457 
458 /*
459  * WindowDef - raw representation of WINDOW and OVER clauses
460  *
461  * For entries in a WINDOW list, "name" is the window name being defined.
462  * For OVER clauses, we use "name" for the "OVER window" syntax, or "refname"
463  * for the "OVER (window)" syntax, which is subtly different --- the latter
464  * implies overriding the window frame clause.
465  */
466 typedef struct WindowDef
467 {
469  char *name; /* window's own name */
470  char *refname; /* referenced window name, if any */
471  List *partitionClause; /* PARTITION BY expression list */
472  List *orderClause; /* ORDER BY (list of SortBy) */
473  int frameOptions; /* frame_clause options, see below */
474  Node *startOffset; /* expression for starting bound, if any */
475  Node *endOffset; /* expression for ending bound, if any */
476  int location; /* parse location, or -1 if none/unknown */
477 } WindowDef;
478 
479 /*
480  * frameOptions is an OR of these bits. The NONDEFAULT and BETWEEN bits are
481  * used so that ruleutils.c can tell which properties were specified and
482  * which were defaulted; the correct behavioral bits must be set either way.
483  * The START_foo and END_foo options must come in pairs of adjacent bits for
484  * the convenience of gram.y, even though some of them are useless/invalid.
485  * We will need more bits (and fields) to cover the full SQL:2008 option set.
486  */
487 #define FRAMEOPTION_NONDEFAULT 0x00001 /* any specified? */
488 #define FRAMEOPTION_RANGE 0x00002 /* RANGE behavior */
489 #define FRAMEOPTION_ROWS 0x00004 /* ROWS behavior */
490 #define FRAMEOPTION_BETWEEN 0x00008 /* BETWEEN given? */
491 #define FRAMEOPTION_START_UNBOUNDED_PRECEDING 0x00010 /* start is U. P. */
492 #define FRAMEOPTION_END_UNBOUNDED_PRECEDING 0x00020 /* (disallowed) */
493 #define FRAMEOPTION_START_UNBOUNDED_FOLLOWING 0x00040 /* (disallowed) */
494 #define FRAMEOPTION_END_UNBOUNDED_FOLLOWING 0x00080 /* end is U. F. */
495 #define FRAMEOPTION_START_CURRENT_ROW 0x00100 /* start is C. R. */
496 #define FRAMEOPTION_END_CURRENT_ROW 0x00200 /* end is C. R. */
497 #define FRAMEOPTION_START_VALUE_PRECEDING 0x00400 /* start is V. P. */
498 #define FRAMEOPTION_END_VALUE_PRECEDING 0x00800 /* end is V. P. */
499 #define FRAMEOPTION_START_VALUE_FOLLOWING 0x01000 /* start is V. F. */
500 #define FRAMEOPTION_END_VALUE_FOLLOWING 0x02000 /* end is V. F. */
501 
502 #define FRAMEOPTION_START_VALUE \
503  (FRAMEOPTION_START_VALUE_PRECEDING | FRAMEOPTION_START_VALUE_FOLLOWING)
504 #define FRAMEOPTION_END_VALUE \
505  (FRAMEOPTION_END_VALUE_PRECEDING | FRAMEOPTION_END_VALUE_FOLLOWING)
506 
507 #define FRAMEOPTION_DEFAULTS \
508  (FRAMEOPTION_RANGE | FRAMEOPTION_START_UNBOUNDED_PRECEDING | \
509  FRAMEOPTION_END_CURRENT_ROW)
510 
511 /*
512  * RangeSubselect - subquery appearing in a FROM clause
513  */
514 typedef struct RangeSubselect
515 {
517  bool lateral; /* does it have LATERAL prefix? */
518  Node *subquery; /* the untransformed sub-select clause */
519  Alias *alias; /* table alias & optional column aliases */
521 
522 /*
523  * RangeFunction - function call appearing in a FROM clause
524  *
525  * functions is a List because we use this to represent the construct
526  * ROWS FROM(func1(...), func2(...), ...). Each element of this list is a
527  * two-element sublist, the first element being the untransformed function
528  * call tree, and the second element being a possibly-empty list of ColumnDef
529  * nodes representing any columndef list attached to that function within the
530  * ROWS FROM() syntax.
531  *
532  * alias and coldeflist represent any alias and/or columndef list attached
533  * at the top level. (We disallow coldeflist appearing both here and
534  * per-function, but that's checked in parse analysis, not by the grammar.)
535  */
536 typedef struct RangeFunction
537 {
539  bool lateral; /* does it have LATERAL prefix? */
540  bool ordinality; /* does it have WITH ORDINALITY suffix? */
541  bool is_rowsfrom; /* is result of ROWS FROM() syntax? */
542  List *functions; /* per-function information, see above */
543  Alias *alias; /* table alias & optional column aliases */
544  List *coldeflist; /* list of ColumnDef nodes to describe result
545  * of function returning RECORD */
546 } RangeFunction;
547 
548 /*
549  * RangeTableSample - TABLESAMPLE appearing in a raw FROM clause
550  *
551  * This node, appearing only in raw parse trees, represents
552  * <relation> TABLESAMPLE <method> (<params>) REPEATABLE (<num>)
553  * Currently, the <relation> can only be a RangeVar, but we might in future
554  * allow RangeSubselect and other options. Note that the RangeTableSample
555  * is wrapped around the node representing the <relation>, rather than being
556  * a subfield of it.
557  */
558 typedef struct RangeTableSample
559 {
561  Node *relation; /* relation to be sampled */
562  List *method; /* sampling method name (possibly qualified) */
563  List *args; /* argument(s) for sampling method */
564  Node *repeatable; /* REPEATABLE expression, or NULL if none */
565  int location; /* method name location, or -1 if unknown */
567 
568 /*
569  * ColumnDef - column definition (used in various creates)
570  *
571  * If the column has a default value, we may have the value expression
572  * in either "raw" form (an untransformed parse tree) or "cooked" form
573  * (a post-parse-analysis, executable expression tree), depending on
574  * how this ColumnDef node was created (by parsing, or by inheritance
575  * from an existing relation). We should never have both in the same node!
576  *
577  * Similarly, we may have a COLLATE specification in either raw form
578  * (represented as a CollateClause with arg==NULL) or cooked form
579  * (the collation's OID).
580  *
581  * The constraints list may contain a CONSTR_DEFAULT item in a raw
582  * parsetree produced by gram.y, but transformCreateStmt will remove
583  * the item and set raw_default instead. CONSTR_DEFAULT items
584  * should not appear in any subsequent processing.
585  */
586 typedef struct ColumnDef
587 {
589  char *colname; /* name of column */
590  TypeName *typeName; /* type of column */
591  int inhcount; /* number of times column is inherited */
592  bool is_local; /* column has local (non-inherited) def'n */
593  bool is_not_null; /* NOT NULL constraint specified? */
594  bool is_from_type; /* column definition came from table type */
595  char storage; /* attstorage setting, or 0 for default */
596  Node *raw_default; /* default value (untransformed parse tree) */
597  Node *cooked_default; /* default value (transformed expr tree) */
598  CollateClause *collClause; /* untransformed COLLATE spec, if any */
599  Oid collOid; /* collation OID (InvalidOid if not set) */
600  List *constraints; /* other constraints on column */
601  List *fdwoptions; /* per-column FDW options */
602  int location; /* parse location, or -1 if none/unknown */
603 } ColumnDef;
604 
605 /*
606  * TableLikeClause - CREATE TABLE ( ... LIKE ... ) clause
607  */
608 typedef struct TableLikeClause
609 {
612  bits32 options; /* OR of TableLikeOption flags */
614 
615 typedef enum TableLikeOption
616 {
624 
625 /*
626  * IndexElem - index parameters (used in CREATE INDEX, and in ON CONFLICT)
627  *
628  * For a plain index attribute, 'name' is the name of the table column to
629  * index, and 'expr' is NULL. For an index expression, 'name' is NULL and
630  * 'expr' is the expression tree.
631  */
632 typedef struct IndexElem
633 {
635  char *name; /* name of attribute to index, or NULL */
636  Node *expr; /* expression to index, or NULL */
637  char *indexcolname; /* name for index column; NULL = default */
638  List *collation; /* name of collation; NIL = default */
639  List *opclass; /* name of desired opclass; NIL = default */
640  SortByDir ordering; /* ASC/DESC/default */
641  SortByNulls nulls_ordering; /* FIRST/LAST/default */
642 } IndexElem;
643 
644 /*
645  * DefElem - a generic "name = value" option definition
646  *
647  * In some contexts the name can be qualified. Also, certain SQL commands
648  * allow a SET/ADD/DROP action to be attached to option settings, so it's
649  * convenient to carry a field for that too. (Note: currently, it is our
650  * practice that the grammar allows namespace and action only in statements
651  * where they are relevant; C code can just ignore those fields in other
652  * statements.)
653  */
654 typedef enum DefElemAction
655 {
656  DEFELEM_UNSPEC, /* no action given */
660 } DefElemAction;
661 
662 typedef struct DefElem
663 {
665  char *defnamespace; /* NULL if unqualified name */
666  char *defname;
667  Node *arg; /* a (Value *) or a (TypeName *) */
668  DefElemAction defaction; /* unspecified action, or SET/ADD/DROP */
669 } DefElem;
670 
671 /*
672  * LockingClause - raw representation of FOR [NO KEY] UPDATE/[KEY] SHARE
673  * options
674  *
675  * Note: lockedRels == NIL means "all relations in query". Otherwise it
676  * is a list of RangeVar nodes. (We use RangeVar mainly because it carries
677  * a location field --- currently, parse analysis insists on unqualified
678  * names in LockingClause.)
679  */
680 typedef struct LockingClause
681 {
683  List *lockedRels; /* FOR [KEY] UPDATE/SHARE relations */
685  LockWaitPolicy waitPolicy; /* NOWAIT and SKIP LOCKED */
686 } LockingClause;
687 
688 /*
689  * XMLSERIALIZE (in raw parse tree only)
690  */
691 typedef struct XmlSerialize
692 {
694  XmlOptionType xmloption; /* DOCUMENT or CONTENT */
697  int location; /* token location, or -1 if unknown */
698 } XmlSerialize;
699 
700 
701 /****************************************************************************
702  * Nodes for a Query tree
703  ****************************************************************************/
704 
705 /*--------------------
706  * RangeTblEntry -
707  * A range table is a List of RangeTblEntry nodes.
708  *
709  * A range table entry may represent a plain relation, a sub-select in
710  * FROM, or the result of a JOIN clause. (Only explicit JOIN syntax
711  * produces an RTE, not the implicit join resulting from multiple FROM
712  * items. This is because we only need the RTE to deal with SQL features
713  * like outer joins and join-output-column aliasing.) Other special
714  * RTE types also exist, as indicated by RTEKind.
715  *
716  * Note that we consider RTE_RELATION to cover anything that has a pg_class
717  * entry. relkind distinguishes the sub-cases.
718  *
719  * alias is an Alias node representing the AS alias-clause attached to the
720  * FROM expression, or NULL if no clause.
721  *
722  * eref is the table reference name and column reference names (either
723  * real or aliases). Note that system columns (OID etc) are not included
724  * in the column list.
725  * eref->aliasname is required to be present, and should generally be used
726  * to identify the RTE for error messages etc.
727  *
728  * In RELATION RTEs, the colnames in both alias and eref are indexed by
729  * physical attribute number; this means there must be colname entries for
730  * dropped columns. When building an RTE we insert empty strings ("") for
731  * dropped columns. Note however that a stored rule may have nonempty
732  * colnames for columns dropped since the rule was created (and for that
733  * matter the colnames might be out of date due to column renamings).
734  * The same comments apply to FUNCTION RTEs when a function's return type
735  * is a named composite type.
736  *
737  * In JOIN RTEs, the colnames in both alias and eref are one-to-one with
738  * joinaliasvars entries. A JOIN RTE will omit columns of its inputs when
739  * those columns are known to be dropped at parse time. Again, however,
740  * a stored rule might contain entries for columns dropped since the rule
741  * was created. (This is only possible for columns not actually referenced
742  * in the rule.) When loading a stored rule, we replace the joinaliasvars
743  * items for any such columns with null pointers. (We can't simply delete
744  * them from the joinaliasvars list, because that would affect the attnums
745  * of Vars referencing the rest of the list.)
746  *
747  * inh is TRUE for relation references that should be expanded to include
748  * inheritance children, if the rel has any. This *must* be FALSE for
749  * RTEs other than RTE_RELATION entries.
750  *
751  * inFromCl marks those range variables that are listed in the FROM clause.
752  * It's false for RTEs that are added to a query behind the scenes, such
753  * as the NEW and OLD variables for a rule, or the subqueries of a UNION.
754  * This flag is not used anymore during parsing, since the parser now uses
755  * a separate "namespace" data structure to control visibility, but it is
756  * needed by ruleutils.c to determine whether RTEs should be shown in
757  * decompiled queries.
758  *
759  * requiredPerms and checkAsUser specify run-time access permissions
760  * checks to be performed at query startup. The user must have *all*
761  * of the permissions that are OR'd together in requiredPerms (zero
762  * indicates no permissions checking). If checkAsUser is not zero,
763  * then do the permissions checks using the access rights of that user,
764  * not the current effective user ID. (This allows rules to act as
765  * setuid gateways.) Permissions checks only apply to RELATION RTEs.
766  *
767  * For SELECT/INSERT/UPDATE permissions, if the user doesn't have
768  * table-wide permissions then it is sufficient to have the permissions
769  * on all columns identified in selectedCols (for SELECT) and/or
770  * insertedCols and/or updatedCols (INSERT with ON CONFLICT DO UPDATE may
771  * have all 3). selectedCols, insertedCols and updatedCols are bitmapsets,
772  * which cannot have negative integer members, so we subtract
773  * FirstLowInvalidHeapAttributeNumber from column numbers before storing
774  * them in these fields. A whole-row Var reference is represented by
775  * setting the bit for InvalidAttrNumber.
776  *--------------------
777  */
778 typedef enum RTEKind
779 {
780  RTE_RELATION, /* ordinary relation reference */
781  RTE_SUBQUERY, /* subquery in FROM */
782  RTE_JOIN, /* join */
783  RTE_FUNCTION, /* function in FROM */
784  RTE_VALUES, /* VALUES (<exprlist>), (<exprlist>), ... */
785  RTE_CTE /* common table expr (WITH list element) */
786 } RTEKind;
787 
788 typedef struct RangeTblEntry
789 {
791 
792  RTEKind rtekind; /* see above */
793 
794  /*
795  * XXX the fields applicable to only some rte kinds should be merged into
796  * a union. I didn't do this yet because the diffs would impact a lot of
797  * code that is being actively worked on. FIXME someday.
798  */
799 
800  /*
801  * Fields valid for a plain relation RTE (else zero):
802  */
803  Oid relid; /* OID of the relation */
804  char relkind; /* relation kind (see pg_class.relkind) */
805  struct TableSampleClause *tablesample; /* sampling info, or NULL */
806 
807  /*
808  * Fields valid for a subquery RTE (else NULL):
809  */
810  Query *subquery; /* the sub-query */
811  bool security_barrier; /* is from security_barrier view? */
812 
813  /*
814  * Fields valid for a join RTE (else NULL/zero):
815  *
816  * joinaliasvars is a list of (usually) Vars corresponding to the columns
817  * of the join result. An alias Var referencing column K of the join
818  * result can be replaced by the K'th element of joinaliasvars --- but to
819  * simplify the task of reverse-listing aliases correctly, we do not do
820  * that until planning time. In detail: an element of joinaliasvars can
821  * be a Var of one of the join's input relations, or such a Var with an
822  * implicit coercion to the join's output column type, or a COALESCE
823  * expression containing the two input column Vars (possibly coerced).
824  * Within a Query loaded from a stored rule, it is also possible for
825  * joinaliasvars items to be null pointers, which are placeholders for
826  * (necessarily unreferenced) columns dropped since the rule was made.
827  * Also, once planning begins, joinaliasvars items can be almost anything,
828  * as a result of subquery-flattening substitutions.
829  */
830  JoinType jointype; /* type of join */
831  List *joinaliasvars; /* list of alias-var expansions */
832 
833  /*
834  * Fields valid for a function RTE (else NIL/zero):
835  *
836  * When funcordinality is true, the eref->colnames list includes an alias
837  * for the ordinality column. The ordinality column is otherwise
838  * implicit, and must be accounted for "by hand" in places such as
839  * expandRTE().
840  */
841  List *functions; /* list of RangeTblFunction nodes */
842  bool funcordinality; /* is this called WITH ORDINALITY? */
843 
844  /*
845  * Fields valid for a values RTE (else NIL):
846  */
847  List *values_lists; /* list of expression lists */
848  List *values_collations; /* OID list of column collation OIDs */
849 
850  /*
851  * Fields valid for a CTE RTE (else NULL/zero):
852  */
853  char *ctename; /* name of the WITH list item */
854  Index ctelevelsup; /* number of query levels up */
855  bool self_reference; /* is this a recursive self-reference? */
856  List *ctecoltypes; /* OID list of column type OIDs */
857  List *ctecoltypmods; /* integer list of column typmods */
858  List *ctecolcollations; /* OID list of column collation OIDs */
859 
860  /*
861  * Fields valid in all RTEs:
862  */
863  Alias *alias; /* user-written alias clause, if any */
864  Alias *eref; /* expanded reference names */
865  bool lateral; /* subquery, function, or values is LATERAL? */
866  bool inh; /* inheritance requested? */
867  bool inFromCl; /* present in FROM clause? */
868  AclMode requiredPerms; /* bitmask of required access permissions */
869  Oid checkAsUser; /* if valid, check access as this role */
870  Bitmapset *selectedCols; /* columns needing SELECT permission */
871  Bitmapset *insertedCols; /* columns needing INSERT permission */
872  Bitmapset *updatedCols; /* columns needing UPDATE permission */
873  List *securityQuals; /* any security barrier quals to apply */
874 } RangeTblEntry;
875 
876 /*
877  * RangeTblFunction -
878  * RangeTblEntry subsidiary data for one function in a FUNCTION RTE.
879  *
880  * If the function had a column definition list (required for an
881  * otherwise-unspecified RECORD result), funccolnames lists the names given
882  * in the definition list, funccoltypes lists their declared column types,
883  * funccoltypmods lists their typmods, funccolcollations their collations.
884  * Otherwise, those fields are NIL.
885  *
886  * Notice we don't attempt to store info about the results of functions
887  * returning named composite types, because those can change from time to
888  * time. We do however remember how many columns we thought the type had
889  * (including dropped columns!), so that we can successfully ignore any
890  * columns added after the query was parsed.
891  */
892 typedef struct RangeTblFunction
893 {
895 
896  Node *funcexpr; /* expression tree for func call */
897  int funccolcount; /* number of columns it contributes to RTE */
898  /* These fields record the contents of a column definition list, if any: */
899  List *funccolnames; /* column names (list of String) */
900  List *funccoltypes; /* OID list of column type OIDs */
901  List *funccoltypmods; /* integer list of column typmods */
902  List *funccolcollations; /* OID list of column collation OIDs */
903  /* This is set during planning for use by the executor: */
904  Bitmapset *funcparams; /* PARAM_EXEC Param IDs affecting this func */
906 
907 /*
908  * TableSampleClause - TABLESAMPLE appearing in a transformed FROM clause
909  *
910  * Unlike RangeTableSample, this is a subnode of the relevant RangeTblEntry.
911  */
912 typedef struct TableSampleClause
913 {
915  Oid tsmhandler; /* OID of the tablesample handler function */
916  List *args; /* tablesample argument expression(s) */
917  Expr *repeatable; /* REPEATABLE expression, or NULL if none */
919 
920 /*
921  * WithCheckOption -
922  * representation of WITH CHECK OPTION checks to be applied to new tuples
923  * when inserting/updating an auto-updatable view, or RLS WITH CHECK
924  * policies to be applied when inserting/updating a relation with RLS.
925  */
926 typedef enum WCOKind
927 {
928  WCO_VIEW_CHECK, /* WCO on an auto-updatable view */
929  WCO_RLS_INSERT_CHECK, /* RLS INSERT WITH CHECK policy */
930  WCO_RLS_UPDATE_CHECK, /* RLS UPDATE WITH CHECK policy */
931  WCO_RLS_CONFLICT_CHECK /* RLS ON CONFLICT DO UPDATE USING policy */
932 } WCOKind;
933 
934 typedef struct WithCheckOption
935 {
937  WCOKind kind; /* kind of WCO */
938  char *relname; /* name of relation that specified the WCO */
939  char *polname; /* name of RLS policy being checked */
940  Node *qual; /* constraint qual to check */
941  bool cascaded; /* true for a cascaded WCO on a view */
943 
944 /*
945  * SortGroupClause -
946  * representation of ORDER BY, GROUP BY, PARTITION BY,
947  * DISTINCT, DISTINCT ON items
948  *
949  * You might think that ORDER BY is only interested in defining ordering,
950  * and GROUP/DISTINCT are only interested in defining equality. However,
951  * one way to implement grouping is to sort and then apply a "uniq"-like
952  * filter. So it's also interesting to keep track of possible sort operators
953  * for GROUP/DISTINCT, and in particular to try to sort for the grouping
954  * in a way that will also yield a requested ORDER BY ordering. So we need
955  * to be able to compare ORDER BY and GROUP/DISTINCT lists, which motivates
956  * the decision to give them the same representation.
957  *
958  * tleSortGroupRef must match ressortgroupref of exactly one entry of the
959  * query's targetlist; that is the expression to be sorted or grouped by.
960  * eqop is the OID of the equality operator.
961  * sortop is the OID of the ordering operator (a "<" or ">" operator),
962  * or InvalidOid if not available.
963  * nulls_first means about what you'd expect. If sortop is InvalidOid
964  * then nulls_first is meaningless and should be set to false.
965  * hashable is TRUE if eqop is hashable (note this condition also depends
966  * on the datatype of the input expression).
967  *
968  * In an ORDER BY item, all fields must be valid. (The eqop isn't essential
969  * here, but it's cheap to get it along with the sortop, and requiring it
970  * to be valid eases comparisons to grouping items.) Note that this isn't
971  * actually enough information to determine an ordering: if the sortop is
972  * collation-sensitive, a collation OID is needed too. We don't store the
973  * collation in SortGroupClause because it's not available at the time the
974  * parser builds the SortGroupClause; instead, consult the exposed collation
975  * of the referenced targetlist expression to find out what it is.
976  *
977  * In a grouping item, eqop must be valid. If the eqop is a btree equality
978  * operator, then sortop should be set to a compatible ordering operator.
979  * We prefer to set eqop/sortop/nulls_first to match any ORDER BY item that
980  * the query presents for the same tlist item. If there is none, we just
981  * use the default ordering op for the datatype.
982  *
983  * If the tlist item's type has a hash opclass but no btree opclass, then
984  * we will set eqop to the hash equality operator, sortop to InvalidOid,
985  * and nulls_first to false. A grouping item of this kind can only be
986  * implemented by hashing, and of course it'll never match an ORDER BY item.
987  *
988  * The hashable flag is provided since we generally have the requisite
989  * information readily available when the SortGroupClause is constructed,
990  * and it's relatively expensive to get it again later. Note there is no
991  * need for a "sortable" flag since OidIsValid(sortop) serves the purpose.
992  *
993  * A query might have both ORDER BY and DISTINCT (or DISTINCT ON) clauses.
994  * In SELECT DISTINCT, the distinctClause list is as long or longer than the
995  * sortClause list, while in SELECT DISTINCT ON it's typically shorter.
996  * The two lists must match up to the end of the shorter one --- the parser
997  * rearranges the distinctClause if necessary to make this true. (This
998  * restriction ensures that only one sort step is needed to both satisfy the
999  * ORDER BY and set up for the Unique step. This is semantically necessary
1000  * for DISTINCT ON, and presents no real drawback for DISTINCT.)
1001  */
1002 typedef struct SortGroupClause
1003 {
1005  Index tleSortGroupRef; /* reference into targetlist */
1006  Oid eqop; /* the equality operator ('=' op) */
1007  Oid sortop; /* the ordering operator ('<' op), or 0 */
1008  bool nulls_first; /* do NULLs come before normal values? */
1009  bool hashable; /* can eqop be implemented by hashing? */
1010 } SortGroupClause;
1011 
1012 /*
1013  * GroupingSet -
1014  * representation of CUBE, ROLLUP and GROUPING SETS clauses
1015  *
1016  * In a Query with grouping sets, the groupClause contains a flat list of
1017  * SortGroupClause nodes for each distinct expression used. The actual
1018  * structure of the GROUP BY clause is given by the groupingSets tree.
1019  *
1020  * In the raw parser output, GroupingSet nodes (of all types except SIMPLE
1021  * which is not used) are potentially mixed in with the expressions in the
1022  * groupClause of the SelectStmt. (An expression can't contain a GroupingSet,
1023  * but a list may mix GroupingSet and expression nodes.) At this stage, the
1024  * content of each node is a list of expressions, some of which may be RowExprs
1025  * which represent sublists rather than actual row constructors, and nested
1026  * GroupingSet nodes where legal in the grammar. The structure directly
1027  * reflects the query syntax.
1028  *
1029  * In parse analysis, the transformed expressions are used to build the tlist
1030  * and groupClause list (of SortGroupClause nodes), and the groupingSets tree
1031  * is eventually reduced to a fixed format:
1032  *
1033  * EMPTY nodes represent (), and obviously have no content
1034  *
1035  * SIMPLE nodes represent a list of one or more expressions to be treated as an
1036  * atom by the enclosing structure; the content is an integer list of
1037  * ressortgroupref values (see SortGroupClause)
1038  *
1039  * CUBE and ROLLUP nodes contain a list of one or more SIMPLE nodes.
1040  *
1041  * SETS nodes contain a list of EMPTY, SIMPLE, CUBE or ROLLUP nodes, but after
1042  * parse analysis they cannot contain more SETS nodes; enough of the syntactic
1043  * transforms of the spec have been applied that we no longer have arbitrarily
1044  * deep nesting (though we still preserve the use of cube/rollup).
1045  *
1046  * Note that if the groupingSets tree contains no SIMPLE nodes (only EMPTY
1047  * nodes at the leaves), then the groupClause will be empty, but this is still
1048  * an aggregation query (similar to using aggs or HAVING without GROUP BY).
1049  *
1050  * As an example, the following clause:
1051  *
1052  * GROUP BY GROUPING SETS ((a,b), CUBE(c,(d,e)))
1053  *
1054  * looks like this after raw parsing:
1055  *
1056  * SETS( RowExpr(a,b) , CUBE( c, RowExpr(d,e) ) )
1057  *
1058  * and parse analysis converts it to:
1059  *
1060  * SETS( SIMPLE(1,2), CUBE( SIMPLE(3), SIMPLE(4,5) ) )
1061  */
1062 typedef enum
1063 {
1069 } GroupingSetKind;
1070 
1071 typedef struct GroupingSet
1072 {
1077 } GroupingSet;
1078 
1079 /*
1080  * WindowClause -
1081  * transformed representation of WINDOW and OVER clauses
1082  *
1083  * A parsed Query's windowClause list contains these structs. "name" is set
1084  * if the clause originally came from WINDOW, and is NULL if it originally
1085  * was an OVER clause (but note that we collapse out duplicate OVERs).
1086  * partitionClause and orderClause are lists of SortGroupClause structs.
1087  * winref is an ID number referenced by WindowFunc nodes; it must be unique
1088  * among the members of a Query's windowClause list.
1089  * When refname isn't null, the partitionClause is always copied from there;
1090  * the orderClause might or might not be copied (see copiedOrder); the framing
1091  * options are never copied, per spec.
1092  */
1093 typedef struct WindowClause
1094 {
1096  char *name; /* window name (NULL in an OVER clause) */
1097  char *refname; /* referenced window name, if any */
1098  List *partitionClause; /* PARTITION BY list */
1099  List *orderClause; /* ORDER BY list */
1100  int frameOptions; /* frame_clause options, see WindowDef */
1101  Node *startOffset; /* expression for starting bound, if any */
1102  Node *endOffset; /* expression for ending bound, if any */
1103  Index winref; /* ID referenced by window functions */
1104  bool copiedOrder; /* did we copy orderClause from refname? */
1105 } WindowClause;
1106 
1107 /*
1108  * RowMarkClause -
1109  * parser output representation of FOR [KEY] UPDATE/SHARE clauses
1110  *
1111  * Query.rowMarks contains a separate RowMarkClause node for each relation
1112  * identified as a FOR [KEY] UPDATE/SHARE target. If one of these clauses
1113  * is applied to a subquery, we generate RowMarkClauses for all normal and
1114  * subquery rels in the subquery, but they are marked pushedDown = true to
1115  * distinguish them from clauses that were explicitly written at this query
1116  * level. Also, Query.hasForUpdate tells whether there were explicit FOR
1117  * UPDATE/SHARE/KEY SHARE clauses in the current query level.
1118  */
1119 typedef struct RowMarkClause
1120 {
1122  Index rti; /* range table index of target relation */
1124  LockWaitPolicy waitPolicy; /* NOWAIT and SKIP LOCKED */
1125  bool pushedDown; /* pushed down from higher query level? */
1126 } RowMarkClause;
1127 
1128 /*
1129  * WithClause -
1130  * representation of WITH clause
1131  *
1132  * Note: WithClause does not propagate into the Query representation;
1133  * but CommonTableExpr does.
1134  */
1135 typedef struct WithClause
1136 {
1138  List *ctes; /* list of CommonTableExprs */
1139  bool recursive; /* true = WITH RECURSIVE */
1140  int location; /* token location, or -1 if unknown */
1141 } WithClause;
1142 
1143 /*
1144  * InferClause -
1145  * ON CONFLICT unique index inference clause
1146  *
1147  * Note: InferClause does not propagate into the Query representation.
1148  */
1149 typedef struct InferClause
1150 {
1152  List *indexElems; /* IndexElems to infer unique index */
1153  Node *whereClause; /* qualification (partial-index predicate) */
1154  char *conname; /* Constraint name, or NULL if unnamed */
1155  int location; /* token location, or -1 if unknown */
1156 } InferClause;
1157 
1158 /*
1159  * OnConflictClause -
1160  * representation of ON CONFLICT clause
1161  *
1162  * Note: OnConflictClause does not propagate into the Query representation.
1163  */
1164 typedef struct OnConflictClause
1165 {
1167  OnConflictAction action; /* DO NOTHING or UPDATE? */
1168  InferClause *infer; /* Optional index inference clause */
1169  List *targetList; /* the target list (of ResTarget) */
1170  Node *whereClause; /* qualifications */
1171  int location; /* token location, or -1 if unknown */
1173 
1174 /*
1175  * CommonTableExpr -
1176  * representation of WITH list element
1177  *
1178  * We don't currently support the SEARCH or CYCLE clause.
1179  */
1180 typedef struct CommonTableExpr
1181 {
1183  char *ctename; /* query name (never qualified) */
1184  List *aliascolnames; /* optional list of column names */
1185  /* SelectStmt/InsertStmt/etc before parse analysis, Query afterwards: */
1186  Node *ctequery; /* the CTE's subquery */
1187  int location; /* token location, or -1 if unknown */
1188  /* These fields are set during parse analysis: */
1189  bool cterecursive; /* is this CTE actually recursive? */
1190  int cterefcount; /* number of RTEs referencing this CTE
1191  * (excluding internal self-references) */
1192  List *ctecolnames; /* list of output column names */
1193  List *ctecoltypes; /* OID list of output column type OIDs */
1194  List *ctecoltypmods; /* integer list of output column typmods */
1195  List *ctecolcollations; /* OID list of column collation OIDs */
1196 } CommonTableExpr;
1197 
1198 /* Convenience macro to get the output tlist of a CTE's query */
1199 #define GetCTETargetList(cte) \
1200  (AssertMacro(IsA((cte)->ctequery, Query)), \
1201  ((Query *) (cte)->ctequery)->commandType == CMD_SELECT ? \
1202  ((Query *) (cte)->ctequery)->targetList : \
1203  ((Query *) (cte)->ctequery)->returningList)
1204 
1205 
1206 /*****************************************************************************
1207  * Optimizable Statements
1208  *****************************************************************************/
1209 
1210 /* ----------------------
1211  * Insert Statement
1212  *
1213  * The source expression is represented by SelectStmt for both the
1214  * SELECT and VALUES cases. If selectStmt is NULL, then the query
1215  * is INSERT ... DEFAULT VALUES.
1216  * ----------------------
1217  */
1218 typedef struct InsertStmt
1219 {
1221  RangeVar *relation; /* relation to insert into */
1222  List *cols; /* optional: names of the target columns */
1223  Node *selectStmt; /* the source SELECT/VALUES, or NULL */
1224  OnConflictClause *onConflictClause; /* ON CONFLICT clause */
1225  List *returningList; /* list of expressions to return */
1226  WithClause *withClause; /* WITH clause */
1227 } InsertStmt;
1228 
1229 /* ----------------------
1230  * Delete Statement
1231  * ----------------------
1232  */
1233 typedef struct DeleteStmt
1234 {
1236  RangeVar *relation; /* relation to delete from */
1237  List *usingClause; /* optional using clause for more tables */
1238  Node *whereClause; /* qualifications */
1239  List *returningList; /* list of expressions to return */
1240  WithClause *withClause; /* WITH clause */
1241 } DeleteStmt;
1242 
1243 /* ----------------------
1244  * Update Statement
1245  * ----------------------
1246  */
1247 typedef struct UpdateStmt
1248 {
1250  RangeVar *relation; /* relation to update */
1251  List *targetList; /* the target list (of ResTarget) */
1252  Node *whereClause; /* qualifications */
1253  List *fromClause; /* optional from clause for more tables */
1254  List *returningList; /* list of expressions to return */
1255  WithClause *withClause; /* WITH clause */
1256 } UpdateStmt;
1257 
1258 /* ----------------------
1259  * Select Statement
1260  *
1261  * A "simple" SELECT is represented in the output of gram.y by a single
1262  * SelectStmt node; so is a VALUES construct. A query containing set
1263  * operators (UNION, INTERSECT, EXCEPT) is represented by a tree of SelectStmt
1264  * nodes, in which the leaf nodes are component SELECTs and the internal nodes
1265  * represent UNION, INTERSECT, or EXCEPT operators. Using the same node
1266  * type for both leaf and internal nodes allows gram.y to stick ORDER BY,
1267  * LIMIT, etc, clause values into a SELECT statement without worrying
1268  * whether it is a simple or compound SELECT.
1269  * ----------------------
1270  */
1271 typedef enum SetOperation
1272 {
1277 } SetOperation;
1278 
1279 typedef struct SelectStmt
1280 {
1282 
1283  /*
1284  * These fields are used only in "leaf" SelectStmts.
1285  */
1286  List *distinctClause; /* NULL, list of DISTINCT ON exprs, or
1287  * lcons(NIL,NIL) for all (SELECT DISTINCT) */
1288  IntoClause *intoClause; /* target for SELECT INTO */
1289  List *targetList; /* the target list (of ResTarget) */
1290  List *fromClause; /* the FROM clause */
1291  Node *whereClause; /* WHERE qualification */
1292  List *groupClause; /* GROUP BY clauses */
1293  Node *havingClause; /* HAVING conditional-expression */
1294  List *windowClause; /* WINDOW window_name AS (...), ... */
1295 
1296  /*
1297  * In a "leaf" node representing a VALUES list, the above fields are all
1298  * null, and instead this field is set. Note that the elements of the
1299  * sublists are just expressions, without ResTarget decoration. Also note
1300  * that a list element can be DEFAULT (represented as a SetToDefault
1301  * node), regardless of the context of the VALUES list. It's up to parse
1302  * analysis to reject that where not valid.
1303  */
1304  List *valuesLists; /* untransformed list of expression lists */
1305 
1306  /*
1307  * These fields are used in both "leaf" SelectStmts and upper-level
1308  * SelectStmts.
1309  */
1310  List *sortClause; /* sort clause (a list of SortBy's) */
1311  Node *limitOffset; /* # of result tuples to skip */
1312  Node *limitCount; /* # of result tuples to return */
1313  List *lockingClause; /* FOR UPDATE (list of LockingClause's) */
1314  WithClause *withClause; /* WITH clause */
1315 
1316  /*
1317  * These fields are used only in upper-level SelectStmts.
1318  */
1319  SetOperation op; /* type of set op */
1320  bool all; /* ALL specified? */
1321  struct SelectStmt *larg; /* left child */
1322  struct SelectStmt *rarg; /* right child */
1323  /* Eventually add fields for CORRESPONDING spec here */
1324 } SelectStmt;
1325 
1326 
1327 /* ----------------------
1328  * Set Operation node for post-analysis query trees
1329  *
1330  * After parse analysis, a SELECT with set operations is represented by a
1331  * top-level Query node containing the leaf SELECTs as subqueries in its
1332  * range table. Its setOperations field shows the tree of set operations,
1333  * with leaf SelectStmt nodes replaced by RangeTblRef nodes, and internal
1334  * nodes replaced by SetOperationStmt nodes. Information about the output
1335  * column types is added, too. (Note that the child nodes do not necessarily
1336  * produce these types directly, but we've checked that their output types
1337  * can be coerced to the output column type.) Also, if it's not UNION ALL,
1338  * information about the types' sort/group semantics is provided in the form
1339  * of a SortGroupClause list (same representation as, eg, DISTINCT).
1340  * The resolved common column collations are provided too; but note that if
1341  * it's not UNION ALL, it's okay for a column to not have a common collation,
1342  * so a member of the colCollations list could be InvalidOid even though the
1343  * column has a collatable type.
1344  * ----------------------
1345  */
1346 typedef struct SetOperationStmt
1347 {
1349  SetOperation op; /* type of set op */
1350  bool all; /* ALL specified? */
1351  Node *larg; /* left child */
1352  Node *rarg; /* right child */
1353  /* Eventually add fields for CORRESPONDING spec here */
1354 
1355  /* Fields derived during parse analysis: */
1356  List *colTypes; /* OID list of output column type OIDs */
1357  List *colTypmods; /* integer list of output column typmods */
1358  List *colCollations; /* OID list of output column collation OIDs */
1359  List *groupClauses; /* a list of SortGroupClause's */
1360  /* groupClauses is NIL if UNION ALL, but must be set otherwise */
1362 
1363 
1364 /*****************************************************************************
1365  * Other Statements (no optimizations required)
1366  *
1367  * These are not touched by parser/analyze.c except to put them into
1368  * the utilityStmt field of a Query. This is eventually passed to
1369  * ProcessUtility (by-passing rewriting and planning). Some of the
1370  * statements do need attention from parse analysis, and this is
1371  * done by routines in parser/parse_utilcmd.c after ProcessUtility
1372  * receives the command for execution.
1373  *****************************************************************************/
1374 
1375 /*
1376  * When a command can act on several kinds of objects with only one
1377  * parse structure required, use these constants to designate the
1378  * object type. Note that commands typically don't support all the types.
1379  */
1380 
1381 typedef enum ObjectType
1382 {
1387  OBJECT_ATTRIBUTE, /* type's attribute, when distinct from column */
1427 } ObjectType;
1428 
1429 /* ----------------------
1430  * Create Schema Statement
1431  *
1432  * NOTE: the schemaElts list contains raw parsetrees for component statements
1433  * of the schema, such as CREATE TABLE, GRANT, etc. These are analyzed and
1434  * executed after the schema itself is created.
1435  * ----------------------
1436  */
1437 typedef struct CreateSchemaStmt
1438 {
1440  char *schemaname; /* the name of the schema to create */
1441  Node *authrole; /* the owner of the created schema */
1442  List *schemaElts; /* schema components (list of parsenodes) */
1443  bool if_not_exists; /* just do nothing if schema already exists? */
1445 
1446 typedef enum DropBehavior
1447 {
1448  DROP_RESTRICT, /* drop fails if any dependent objects */
1449  DROP_CASCADE /* remove dependent objects too */
1450 } DropBehavior;
1451 
1452 /* ----------------------
1453  * Alter Table
1454  * ----------------------
1455  */
1456 typedef struct AlterTableStmt
1457 {
1459  RangeVar *relation; /* table to work on */
1460  List *cmds; /* list of subcommands */
1461  ObjectType relkind; /* type of object */
1462  bool missing_ok; /* skip error if table missing */
1463 } AlterTableStmt;
1464 
1465 typedef enum AlterTableType
1466 {
1467  AT_AddColumn, /* add column */
1468  AT_AddColumnRecurse, /* internal to commands/tablecmds.c */
1469  AT_AddColumnToView, /* implicitly via CREATE OR REPLACE VIEW */
1470  AT_ColumnDefault, /* alter column default */
1471  AT_DropNotNull, /* alter column drop not null */
1472  AT_SetNotNull, /* alter column set not null */
1473  AT_SetStatistics, /* alter column set statistics */
1474  AT_SetOptions, /* alter column set ( options ) */
1475  AT_ResetOptions, /* alter column reset ( options ) */
1476  AT_SetStorage, /* alter column set storage */
1477  AT_DropColumn, /* drop column */
1478  AT_DropColumnRecurse, /* internal to commands/tablecmds.c */
1479  AT_AddIndex, /* add index */
1480  AT_ReAddIndex, /* internal to commands/tablecmds.c */
1481  AT_AddConstraint, /* add constraint */
1482  AT_AddConstraintRecurse, /* internal to commands/tablecmds.c */
1483  AT_ReAddConstraint, /* internal to commands/tablecmds.c */
1484  AT_AlterConstraint, /* alter constraint */
1485  AT_ValidateConstraint, /* validate constraint */
1486  AT_ValidateConstraintRecurse, /* internal to commands/tablecmds.c */
1487  AT_ProcessedConstraint, /* pre-processed add constraint (local in
1488  * parser/parse_utilcmd.c) */
1489  AT_AddIndexConstraint, /* add constraint using existing index */
1490  AT_DropConstraint, /* drop constraint */
1491  AT_DropConstraintRecurse, /* internal to commands/tablecmds.c */
1492  AT_ReAddComment, /* internal to commands/tablecmds.c */
1493  AT_AlterColumnType, /* alter column type */
1494  AT_AlterColumnGenericOptions, /* alter column OPTIONS (...) */
1495  AT_ChangeOwner, /* change owner */
1496  AT_ClusterOn, /* CLUSTER ON */
1497  AT_DropCluster, /* SET WITHOUT CLUSTER */
1498  AT_SetLogged, /* SET LOGGED */
1499  AT_SetUnLogged, /* SET UNLOGGED */
1500  AT_AddOids, /* SET WITH OIDS */
1501  AT_AddOidsRecurse, /* internal to commands/tablecmds.c */
1502  AT_DropOids, /* SET WITHOUT OIDS */
1503  AT_SetTableSpace, /* SET TABLESPACE */
1504  AT_SetRelOptions, /* SET (...) -- AM specific parameters */
1505  AT_ResetRelOptions, /* RESET (...) -- AM specific parameters */
1506  AT_ReplaceRelOptions, /* replace reloption list in its entirety */
1507  AT_EnableTrig, /* ENABLE TRIGGER name */
1508  AT_EnableAlwaysTrig, /* ENABLE ALWAYS TRIGGER name */
1509  AT_EnableReplicaTrig, /* ENABLE REPLICA TRIGGER name */
1510  AT_DisableTrig, /* DISABLE TRIGGER name */
1511  AT_EnableTrigAll, /* ENABLE TRIGGER ALL */
1512  AT_DisableTrigAll, /* DISABLE TRIGGER ALL */
1513  AT_EnableTrigUser, /* ENABLE TRIGGER USER */
1514  AT_DisableTrigUser, /* DISABLE TRIGGER USER */
1515  AT_EnableRule, /* ENABLE RULE name */
1516  AT_EnableAlwaysRule, /* ENABLE ALWAYS RULE name */
1517  AT_EnableReplicaRule, /* ENABLE REPLICA RULE name */
1518  AT_DisableRule, /* DISABLE RULE name */
1519  AT_AddInherit, /* INHERIT parent */
1520  AT_DropInherit, /* NO INHERIT parent */
1521  AT_AddOf, /* OF <type_name> */
1522  AT_DropOf, /* NOT OF */
1523  AT_ReplicaIdentity, /* REPLICA IDENTITY */
1524  AT_EnableRowSecurity, /* ENABLE ROW SECURITY */
1525  AT_DisableRowSecurity, /* DISABLE ROW SECURITY */
1526  AT_ForceRowSecurity, /* FORCE ROW SECURITY */
1527  AT_NoForceRowSecurity, /* NO FORCE ROW SECURITY */
1528  AT_GenericOptions /* OPTIONS (...) */
1529 } AlterTableType;
1530 
1531 typedef struct ReplicaIdentityStmt
1532 {
1535  char *name;
1537 
1538 typedef struct AlterTableCmd /* one subcommand of an ALTER TABLE */
1539 {
1541  AlterTableType subtype; /* Type of table alteration to apply */
1542  char *name; /* column, constraint, or trigger to act on,
1543  * or tablespace */
1544  Node *newowner; /* RoleSpec */
1545  Node *def; /* definition of new column, index,
1546  * constraint, or parent table */
1547  DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */
1548  bool missing_ok; /* skip error if missing? */
1549 } AlterTableCmd;
1550 
1551 
1552 /* ----------------------
1553  * Alter Domain
1554  *
1555  * The fields are used in different ways by the different variants of
1556  * this command.
1557  * ----------------------
1558  */
1559 typedef struct AlterDomainStmt
1560 {
1562  char subtype; /*------------
1563  * T = alter column default
1564  * N = alter column drop not null
1565  * O = alter column set not null
1566  * C = add constraint
1567  * X = drop constraint
1568  *------------
1569  */
1570  List *typeName; /* domain to work on */
1571  char *name; /* column or constraint name to act on */
1572  Node *def; /* definition of default or constraint */
1573  DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */
1574  bool missing_ok; /* skip error if missing? */
1575 } AlterDomainStmt;
1576 
1577 
1578 /* ----------------------
1579  * Grant|Revoke Statement
1580  * ----------------------
1581  */
1582 typedef enum GrantTargetType
1583 {
1584  ACL_TARGET_OBJECT, /* grant on specific named object(s) */
1585  ACL_TARGET_ALL_IN_SCHEMA, /* grant on all objects in given schema(s) */
1586  ACL_TARGET_DEFAULTS /* ALTER DEFAULT PRIVILEGES */
1587 } GrantTargetType;
1588 
1589 typedef enum GrantObjectType
1590 {
1591  ACL_OBJECT_COLUMN, /* column */
1592  ACL_OBJECT_RELATION, /* table, view */
1593  ACL_OBJECT_SEQUENCE, /* sequence */
1594  ACL_OBJECT_DATABASE, /* database */
1595  ACL_OBJECT_DOMAIN, /* domain */
1596  ACL_OBJECT_FDW, /* foreign-data wrapper */
1597  ACL_OBJECT_FOREIGN_SERVER, /* foreign server */
1598  ACL_OBJECT_FUNCTION, /* function */
1599  ACL_OBJECT_LANGUAGE, /* procedural language */
1600  ACL_OBJECT_LARGEOBJECT, /* largeobject */
1601  ACL_OBJECT_NAMESPACE, /* namespace */
1602  ACL_OBJECT_TABLESPACE, /* tablespace */
1603  ACL_OBJECT_TYPE /* type */
1604 } GrantObjectType;
1605 
1606 typedef struct GrantStmt
1607 {
1609  bool is_grant; /* true = GRANT, false = REVOKE */
1610  GrantTargetType targtype; /* type of the grant target */
1611  GrantObjectType objtype; /* kind of object being operated on */
1612  List *objects; /* list of RangeVar nodes, FuncWithArgs nodes,
1613  * or plain names (as Value strings) */
1614  List *privileges; /* list of AccessPriv nodes */
1615  /* privileges == NIL denotes ALL PRIVILEGES */
1616  List *grantees; /* list of RoleSpec nodes */
1617  bool grant_option; /* grant or revoke grant option */
1618  DropBehavior behavior; /* drop behavior (for REVOKE) */
1619 } GrantStmt;
1620 
1621 /*
1622  * Note: FuncWithArgs carries only the types of the input parameters of the
1623  * function. So it is sufficient to identify an existing function, but it
1624  * is not enough info to define a function nor to call it.
1625  */
1626 typedef struct FuncWithArgs
1627 {
1629  List *funcname; /* qualified name of function */
1630  List *funcargs; /* list of Typename nodes */
1631 } FuncWithArgs;
1632 
1633 /*
1634  * An access privilege, with optional list of column names
1635  * priv_name == NULL denotes ALL PRIVILEGES (only used with a column list)
1636  * cols == NIL denotes "all columns"
1637  * Note that simple "ALL PRIVILEGES" is represented as a NIL list, not
1638  * an AccessPriv with both fields null.
1639  */
1640 typedef struct AccessPriv
1641 {
1643  char *priv_name; /* string name of privilege */
1644  List *cols; /* list of Value strings */
1645 } AccessPriv;
1646 
1647 /* ----------------------
1648  * Grant/Revoke Role Statement
1649  *
1650  * Note: because of the parsing ambiguity with the GRANT <privileges>
1651  * statement, granted_roles is a list of AccessPriv; the execution code
1652  * should complain if any column lists appear. grantee_roles is a list
1653  * of role names, as Value strings.
1654  * ----------------------
1655  */
1656 typedef struct GrantRoleStmt
1657 {
1659  List *granted_roles; /* list of roles to be granted/revoked */
1660  List *grantee_roles; /* list of member roles to add/delete */
1661  bool is_grant; /* true = GRANT, false = REVOKE */
1662  bool admin_opt; /* with admin option */
1663  Node *grantor; /* set grantor to other than current role */
1664  DropBehavior behavior; /* drop behavior (for REVOKE) */
1665 } GrantRoleStmt;
1666 
1667 /* ----------------------
1668  * Alter Default Privileges Statement
1669  * ----------------------
1670  */
1672 {
1674  List *options; /* list of DefElem */
1675  GrantStmt *action; /* GRANT/REVOKE action (with objects=NIL) */
1677 
1678 /* ----------------------
1679  * Copy Statement
1680  *
1681  * We support "COPY relation FROM file", "COPY relation TO file", and
1682  * "COPY (query) TO file". In any given CopyStmt, exactly one of "relation"
1683  * and "query" must be non-NULL.
1684  * ----------------------
1685  */
1686 typedef struct CopyStmt
1687 {
1689  RangeVar *relation; /* the relation to copy */
1690  Node *query; /* the query (SELECT or DML statement with
1691  * RETURNING) to copy */
1692  List *attlist; /* List of column names (as Strings), or NIL
1693  * for all columns */
1694  bool is_from; /* TO or FROM */
1695  bool is_program; /* is 'filename' a program to popen? */
1696  char *filename; /* filename, or NULL for STDIN/STDOUT */
1697  List *options; /* List of DefElem nodes */
1698 } CopyStmt;
1699 
1700 /* ----------------------
1701  * SET Statement (includes RESET)
1702  *
1703  * "SET var TO DEFAULT" and "RESET var" are semantically equivalent, but we
1704  * preserve the distinction in VariableSetKind for CreateCommandTag().
1705  * ----------------------
1706  */
1707 typedef enum
1708 {
1709  VAR_SET_VALUE, /* SET var = value */
1710  VAR_SET_DEFAULT, /* SET var TO DEFAULT */
1711  VAR_SET_CURRENT, /* SET var FROM CURRENT */
1712  VAR_SET_MULTI, /* special case for SET TRANSACTION ... */
1713  VAR_RESET, /* RESET var */
1714  VAR_RESET_ALL /* RESET ALL */
1715 } VariableSetKind;
1716 
1717 typedef struct VariableSetStmt
1718 {
1721  char *name; /* variable to be set */
1722  List *args; /* List of A_Const nodes */
1723  bool is_local; /* SET LOCAL? */
1724 } VariableSetStmt;
1725 
1726 /* ----------------------
1727  * Show Statement
1728  * ----------------------
1729  */
1730 typedef struct VariableShowStmt
1731 {
1733  char *name;
1735 
1736 /* ----------------------
1737  * Create Table Statement
1738  *
1739  * NOTE: in the raw gram.y output, ColumnDef and Constraint nodes are
1740  * intermixed in tableElts, and constraints is NIL. After parse analysis,
1741  * tableElts contains just ColumnDefs, and constraints contains just
1742  * Constraint nodes (in fact, only CONSTR_CHECK nodes, in the present
1743  * implementation).
1744  * ----------------------
1745  */
1746 
1747 typedef struct CreateStmt
1748 {
1750  RangeVar *relation; /* relation to create */
1751  List *tableElts; /* column definitions (list of ColumnDef) */
1752  List *inhRelations; /* relations to inherit from (list of
1753  * inhRelation) */
1754  TypeName *ofTypename; /* OF typename */
1755  List *constraints; /* constraints (list of Constraint nodes) */
1756  List *options; /* options from WITH clause */
1757  OnCommitAction oncommit; /* what do we do at COMMIT? */
1758  char *tablespacename; /* table space to use, or NULL */
1759  bool if_not_exists; /* just do nothing if it already exists? */
1760 } CreateStmt;
1761 
1762 /* ----------
1763  * Definitions for constraints in CreateStmt
1764  *
1765  * Note that column defaults are treated as a type of constraint,
1766  * even though that's a bit odd semantically.
1767  *
1768  * For constraints that use expressions (CONSTR_CHECK, CONSTR_DEFAULT)
1769  * we may have the expression in either "raw" form (an untransformed
1770  * parse tree) or "cooked" form (the nodeToString representation of
1771  * an executable expression tree), depending on how this Constraint
1772  * node was created (by parsing, or by inheritance from an existing
1773  * relation). We should never have both in the same node!
1774  *
1775  * FKCONSTR_ACTION_xxx values are stored into pg_constraint.confupdtype
1776  * and pg_constraint.confdeltype columns; FKCONSTR_MATCH_xxx values are
1777  * stored into pg_constraint.confmatchtype. Changing the code values may
1778  * require an initdb!
1779  *
1780  * If skip_validation is true then we skip checking that the existing rows
1781  * in the table satisfy the constraint, and just install the catalog entries
1782  * for the constraint. A new FK constraint is marked as valid iff
1783  * initially_valid is true. (Usually skip_validation and initially_valid
1784  * are inverses, but we can set both true if the table is known empty.)
1785  *
1786  * Constraint attributes (DEFERRABLE etc) are initially represented as
1787  * separate Constraint nodes for simplicity of parsing. parse_utilcmd.c makes
1788  * a pass through the constraints list to insert the info into the appropriate
1789  * Constraint node.
1790  * ----------
1791  */
1792 
1793 typedef enum ConstrType /* types of constraints */
1794 {
1795  CONSTR_NULL, /* not standard SQL, but a lot of people
1796  * expect it */
1804  CONSTR_ATTR_DEFERRABLE, /* attributes for previous constraint node */
1808 } ConstrType;
1809 
1810 /* Foreign key action codes */
1811 #define FKCONSTR_ACTION_NOACTION 'a'
1812 #define FKCONSTR_ACTION_RESTRICT 'r'
1813 #define FKCONSTR_ACTION_CASCADE 'c'
1814 #define FKCONSTR_ACTION_SETNULL 'n'
1815 #define FKCONSTR_ACTION_SETDEFAULT 'd'
1816 
1817 /* Foreign key matchtype codes */
1818 #define FKCONSTR_MATCH_FULL 'f'
1819 #define FKCONSTR_MATCH_PARTIAL 'p'
1820 #define FKCONSTR_MATCH_SIMPLE 's'
1821 
1822 typedef struct Constraint
1823 {
1825  ConstrType contype; /* see above */
1826 
1827  /* Fields used for most/all constraint types: */
1828  char *conname; /* Constraint name, or NULL if unnamed */
1829  bool deferrable; /* DEFERRABLE? */
1830  bool initdeferred; /* INITIALLY DEFERRED? */
1831  int location; /* token location, or -1 if unknown */
1832 
1833  /* Fields used for constraints with expressions (CHECK and DEFAULT): */
1834  bool is_no_inherit; /* is constraint non-inheritable? */
1835  Node *raw_expr; /* expr, as untransformed parse tree */
1836  char *cooked_expr; /* expr, as nodeToString representation */
1837 
1838  /* Fields used for unique constraints (UNIQUE and PRIMARY KEY): */
1839  List *keys; /* String nodes naming referenced column(s) */
1840 
1841  /* Fields used for EXCLUSION constraints: */
1842  List *exclusions; /* list of (IndexElem, operator name) pairs */
1843 
1844  /* Fields used for index constraints (UNIQUE, PRIMARY KEY, EXCLUSION): */
1845  List *options; /* options from WITH clause */
1846  char *indexname; /* existing index to use; otherwise NULL */
1847  char *indexspace; /* index tablespace; NULL for default */
1848  /* These could be, but currently are not, used for UNIQUE/PKEY: */
1849  char *access_method; /* index access method; NULL for default */
1850  Node *where_clause; /* partial index predicate */
1851 
1852  /* Fields used for FOREIGN KEY constraints: */
1853  RangeVar *pktable; /* Primary key table */
1854  List *fk_attrs; /* Attributes of foreign key */
1855  List *pk_attrs; /* Corresponding attrs in PK table */
1856  char fk_matchtype; /* FULL, PARTIAL, SIMPLE */
1857  char fk_upd_action; /* ON UPDATE action */
1858  char fk_del_action; /* ON DELETE action */
1859  List *old_conpfeqop; /* pg_constraint.conpfeqop of my former self */
1860  Oid old_pktable_oid; /* pg_constraint.confrelid of my former self */
1861 
1862  /* Fields used for constraints that allow a NOT VALID specification */
1863  bool skip_validation; /* skip validation of existing rows? */
1864  bool initially_valid; /* mark the new constraint as valid? */
1865 } Constraint;
1866 
1867 /* ----------------------
1868  * Create/Drop Table Space Statements
1869  * ----------------------
1870  */
1871 
1872 typedef struct CreateTableSpaceStmt
1873 {
1877  char *location;
1880 
1881 typedef struct DropTableSpaceStmt
1882 {
1885  bool missing_ok; /* skip error if missing? */
1887 
1889 {
1893  bool isReset;
1895 
1897 {
1900  ObjectType objtype; /* Object type to move */
1901  List *roles; /* List of roles to move objects of */
1903  bool nowait;
1905 
1906 /* ----------------------
1907  * Create/Alter Extension Statements
1908  * ----------------------
1909  */
1910 
1911 typedef struct CreateExtensionStmt
1912 {
1914  char *extname;
1915  bool if_not_exists; /* just do nothing if it already exists? */
1916  List *options; /* List of DefElem nodes */
1918 
1919 /* Only used for ALTER EXTENSION UPDATE; later might need an action field */
1920 typedef struct AlterExtensionStmt
1921 {
1923  char *extname;
1924  List *options; /* List of DefElem nodes */
1926 
1928 {
1930  char *extname; /* Extension's name */
1931  int action; /* +1 = add object, -1 = drop object */
1932  ObjectType objtype; /* Object's type */
1933  List *objname; /* Qualified name of the object */
1934  List *objargs; /* Arguments if needed (eg, for functions) */
1936 
1937 /* ----------------------
1938  * Create/Alter FOREIGN DATA WRAPPER Statements
1939  * ----------------------
1940  */
1941 
1942 typedef struct CreateFdwStmt
1943 {
1945  char *fdwname; /* foreign-data wrapper name */
1946  List *func_options; /* HANDLER/VALIDATOR options */
1947  List *options; /* generic options to FDW */
1948 } CreateFdwStmt;
1949 
1950 typedef struct AlterFdwStmt
1951 {
1953  char *fdwname; /* foreign-data wrapper name */
1954  List *func_options; /* HANDLER/VALIDATOR options */
1955  List *options; /* generic options to FDW */
1956 } AlterFdwStmt;
1957 
1958 /* ----------------------
1959  * Create/Alter FOREIGN SERVER Statements
1960  * ----------------------
1961  */
1962 
1964 {
1966  char *servername; /* server name */
1967  char *servertype; /* optional server type */
1968  char *version; /* optional server version */
1969  char *fdwname; /* FDW name */
1970  List *options; /* generic options to server */
1972 
1974 {
1976  char *servername; /* server name */
1977  char *version; /* optional server version */
1978  List *options; /* generic options to server */
1979  bool has_version; /* version specified */
1981 
1982 /* ----------------------
1983  * Create FOREIGN TABLE Statement
1984  * ----------------------
1985  */
1986 
1988 {
1990  char *servername;
1993 
1994 /* ----------------------
1995  * Create/Drop USER MAPPING Statements
1996  * ----------------------
1997  */
1998 
2000 {
2002  Node *user; /* user role */
2003  char *servername; /* server name */
2004  List *options; /* generic options to server */
2006 
2007 typedef struct AlterUserMappingStmt
2008 {
2010  Node *user; /* user role */
2011  char *servername; /* server name */
2012  List *options; /* generic options to server */
2014 
2015 typedef struct DropUserMappingStmt
2016 {
2018  Node *user; /* user role */
2019  char *servername; /* server name */
2020  bool missing_ok; /* ignore missing mappings */
2022 
2023 /* ----------------------
2024  * Import Foreign Schema Statement
2025  * ----------------------
2026  */
2027 
2029 {
2030  FDW_IMPORT_SCHEMA_ALL, /* all relations wanted */
2031  FDW_IMPORT_SCHEMA_LIMIT_TO, /* include only listed tables in import */
2032  FDW_IMPORT_SCHEMA_EXCEPT /* exclude listed tables from import */
2034 
2036 {
2038  char *server_name; /* FDW server name */
2039  char *remote_schema; /* remote schema name to query */
2040  char *local_schema; /* local schema to create objects in */
2041  ImportForeignSchemaType list_type; /* type of table list */
2042  List *table_list; /* List of RangeVar */
2043  List *options; /* list of options to pass to FDW */
2045 
2046 /*----------------------
2047  * Create POLICY Statement
2048  *----------------------
2049  */
2050 typedef struct CreatePolicyStmt
2051 {
2053  char *policy_name; /* Policy's name */
2054  RangeVar *table; /* the table name the policy applies to */
2055  char *cmd_name; /* the command name the policy applies to */
2056  List *roles; /* the roles associated with the policy */
2057  Node *qual; /* the policy's condition */
2058  Node *with_check; /* the policy's WITH CHECK condition. */
2060 
2061 /*----------------------
2062  * Alter POLICY Statement
2063  *----------------------
2064  */
2065 typedef struct AlterPolicyStmt
2066 {
2068  char *policy_name; /* Policy's name */
2069  RangeVar *table; /* the table name the policy applies to */
2070  List *roles; /* the roles associated with the policy */
2071  Node *qual; /* the policy's condition */
2072  Node *with_check; /* the policy's WITH CHECK condition. */
2073 } AlterPolicyStmt;
2074 
2075 /*----------------------
2076  * Create ACCESS METHOD Statement
2077  *----------------------
2078  */
2079 typedef struct CreateAmStmt
2080 {
2082  char *amname; /* access method name */
2083  List *handler_name; /* handler function name */
2084  char amtype; /* type of access method */
2085 } CreateAmStmt;
2086 
2087 /* ----------------------
2088  * Create TRIGGER Statement
2089  * ----------------------
2090  */
2091 typedef struct CreateTrigStmt
2092 {
2094  char *trigname; /* TRIGGER's name */
2095  RangeVar *relation; /* relation trigger is on */
2096  List *funcname; /* qual. name of function to call */
2097  List *args; /* list of (T_String) Values or NIL */
2098  bool row; /* ROW/STATEMENT */
2099  /* timing uses the TRIGGER_TYPE bits defined in catalog/pg_trigger.h */
2100  int16 timing; /* BEFORE, AFTER, or INSTEAD */
2101  /* events uses the TRIGGER_TYPE bits defined in catalog/pg_trigger.h */
2102  int16 events; /* "OR" of INSERT/UPDATE/DELETE/TRUNCATE */
2103  List *columns; /* column names, or NIL for all columns */
2104  Node *whenClause; /* qual expression, or NULL if none */
2105  bool isconstraint; /* This is a constraint trigger */
2106  /* The remaining fields are only used for constraint triggers */
2107  bool deferrable; /* [NOT] DEFERRABLE */
2108  bool initdeferred; /* INITIALLY {DEFERRED|IMMEDIATE} */
2109  RangeVar *constrrel; /* opposite relation, if RI trigger */
2110 } CreateTrigStmt;
2111 
2112 /* ----------------------
2113  * Create EVENT TRIGGER Statement
2114  * ----------------------
2115  */
2116 typedef struct CreateEventTrigStmt
2117 {
2119  char *trigname; /* TRIGGER's name */
2120  char *eventname; /* event's identifier */
2121  List *whenclause; /* list of DefElems indicating filtering */
2122  List *funcname; /* qual. name of function to call */
2124 
2125 /* ----------------------
2126  * Alter EVENT TRIGGER Statement
2127  * ----------------------
2128  */
2129 typedef struct AlterEventTrigStmt
2130 {
2132  char *trigname; /* TRIGGER's name */
2133  char tgenabled; /* trigger's firing configuration WRT
2134  * session_replication_role */
2136 
2137 /* ----------------------
2138  * Create/Drop PROCEDURAL LANGUAGE Statements
2139  * Create PROCEDURAL LANGUAGE Statements
2140  * ----------------------
2141  */
2142 typedef struct CreatePLangStmt
2143 {
2145  bool replace; /* T => replace if already exists */
2146  char *plname; /* PL name */
2147  List *plhandler; /* PL call handler function (qual. name) */
2148  List *plinline; /* optional inline function (qual. name) */
2149  List *plvalidator; /* optional validator function (qual. name) */
2150  bool pltrusted; /* PL is trusted */
2151 } CreatePLangStmt;
2152 
2153 /* ----------------------
2154  * Create/Alter/Drop Role Statements
2155  *
2156  * Note: these node types are also used for the backwards-compatible
2157  * Create/Alter/Drop User/Group statements. In the ALTER and DROP cases
2158  * there's really no need to distinguish what the original spelling was,
2159  * but for CREATE we mark the type because the defaults vary.
2160  * ----------------------
2161  */
2162 typedef enum RoleStmtType
2163 {
2167 } RoleStmtType;
2168 
2169 typedef struct CreateRoleStmt
2170 {
2172  RoleStmtType stmt_type; /* ROLE/USER/GROUP */
2173  char *role; /* role name */
2174  List *options; /* List of DefElem nodes */
2175 } CreateRoleStmt;
2176 
2177 typedef struct AlterRoleStmt
2178 {
2180  Node *role; /* role */
2181  List *options; /* List of DefElem nodes */
2182  int action; /* +1 = add members, -1 = drop members */
2183 } AlterRoleStmt;
2184 
2185 typedef struct AlterRoleSetStmt
2186 {
2188  Node *role; /* role */
2189  char *database; /* database name, or NULL */
2190  VariableSetStmt *setstmt; /* SET or RESET subcommand */
2192 
2193 typedef struct DropRoleStmt
2194 {
2196  List *roles; /* List of roles to remove */
2197  bool missing_ok; /* skip error if a role is missing? */
2198 } DropRoleStmt;
2199 
2200 /* ----------------------
2201  * {Create|Alter} SEQUENCE Statement
2202  * ----------------------
2203  */
2204 
2205 typedef struct CreateSeqStmt
2206 {
2208  RangeVar *sequence; /* the sequence to create */
2210  Oid ownerId; /* ID of owner, or InvalidOid for default */
2211  bool if_not_exists; /* just do nothing if it already exists? */
2212 } CreateSeqStmt;
2213 
2214 typedef struct AlterSeqStmt
2215 {
2217  RangeVar *sequence; /* the sequence to alter */
2219  bool missing_ok; /* skip error if a role is missing? */
2220 } AlterSeqStmt;
2221 
2222 /* ----------------------
2223  * Create {Aggregate|Operator|Type} Statement
2224  * ----------------------
2225  */
2226 typedef struct DefineStmt
2227 {
2229  ObjectType kind; /* aggregate, operator, type */
2230  bool oldstyle; /* hack to signal old CREATE AGG syntax */
2231  List *defnames; /* qualified name (list of Value strings) */
2232  List *args; /* a list of TypeName (if needed) */
2233  List *definition; /* a list of DefElem */
2234 } DefineStmt;
2235 
2236 /* ----------------------
2237  * Create Domain Statement
2238  * ----------------------
2239  */
2240 typedef struct CreateDomainStmt
2241 {
2243  List *domainname; /* qualified name (list of Value strings) */
2244  TypeName *typeName; /* the base type */
2245  CollateClause *collClause; /* untransformed COLLATE spec, if any */
2246  List *constraints; /* constraints (list of Constraint nodes) */
2248 
2249 /* ----------------------
2250  * Create Operator Class Statement
2251  * ----------------------
2252  */
2253 typedef struct CreateOpClassStmt
2254 {
2256  List *opclassname; /* qualified name (list of Value strings) */
2257  List *opfamilyname; /* qualified name (ditto); NIL if omitted */
2258  char *amname; /* name of index AM opclass is for */
2259  TypeName *datatype; /* datatype of indexed column */
2260  List *items; /* List of CreateOpClassItem nodes */
2261  bool isDefault; /* Should be marked as default for type? */
2263 
2264 #define OPCLASS_ITEM_OPERATOR 1
2265 #define OPCLASS_ITEM_FUNCTION 2
2266 #define OPCLASS_ITEM_STORAGETYPE 3
2267 
2268 typedef struct CreateOpClassItem
2269 {
2271  int itemtype; /* see codes above */
2272  /* fields used for an operator or function item: */
2273  List *name; /* operator or function name */
2274  List *args; /* argument types */
2275  int number; /* strategy num or support proc num */
2276  List *order_family; /* only used for ordering operators */
2277  List *class_args; /* only used for functions */
2278  /* fields used for a storagetype item: */
2279  TypeName *storedtype; /* datatype stored in index */
2281 
2282 /* ----------------------
2283  * Create Operator Family Statement
2284  * ----------------------
2285  */
2286 typedef struct CreateOpFamilyStmt
2287 {
2289  List *opfamilyname; /* qualified name (list of Value strings) */
2290  char *amname; /* name of index AM opfamily is for */
2292 
2293 /* ----------------------
2294  * Alter Operator Family Statement
2295  * ----------------------
2296  */
2297 typedef struct AlterOpFamilyStmt
2298 {
2300  List *opfamilyname; /* qualified name (list of Value strings) */
2301  char *amname; /* name of index AM opfamily is for */
2302  bool isDrop; /* ADD or DROP the items? */
2303  List *items; /* List of CreateOpClassItem nodes */
2305 
2306 /* ----------------------
2307  * Drop Table|Sequence|View|Index|Type|Domain|Conversion|Schema Statement
2308  * ----------------------
2309  */
2310 
2311 typedef struct DropStmt
2312 {
2314  List *objects; /* list of sublists of names (as Values) */
2315  List *arguments; /* list of sublists of arguments (as Values) */
2316  ObjectType removeType; /* object type */
2317  DropBehavior behavior; /* RESTRICT or CASCADE behavior */
2318  bool missing_ok; /* skip error if object is missing? */
2319  bool concurrent; /* drop index concurrently? */
2320 } DropStmt;
2321 
2322 /* ----------------------
2323  * Truncate Table Statement
2324  * ----------------------
2325  */
2326 typedef struct TruncateStmt
2327 {
2329  List *relations; /* relations (RangeVars) to be truncated */
2330  bool restart_seqs; /* restart owned sequences? */
2331  DropBehavior behavior; /* RESTRICT or CASCADE behavior */
2332 } TruncateStmt;
2333 
2334 /* ----------------------
2335  * Comment On Statement
2336  * ----------------------
2337  */
2338 typedef struct CommentStmt
2339 {
2341  ObjectType objtype; /* Object's type */
2342  List *objname; /* Qualified name of the object */
2343  List *objargs; /* Arguments if needed (eg, for functions) */
2344  char *comment; /* Comment to insert, or NULL to remove */
2345 } CommentStmt;
2346 
2347 /* ----------------------
2348  * SECURITY LABEL Statement
2349  * ----------------------
2350  */
2351 typedef struct SecLabelStmt
2352 {
2354  ObjectType objtype; /* Object's type */
2355  List *objname; /* Qualified name of the object */
2356  List *objargs; /* Arguments if needed (eg, for functions) */
2357  char *provider; /* Label provider (or NULL) */
2358  char *label; /* New security label to be assigned */
2359 } SecLabelStmt;
2360 
2361 /* ----------------------
2362  * Declare Cursor Statement
2363  *
2364  * Note: the "query" field of DeclareCursorStmt is only used in the raw grammar
2365  * output. After parse analysis it's set to null, and the Query points to the
2366  * DeclareCursorStmt, not vice versa.
2367  * ----------------------
2368  */
2369 #define CURSOR_OPT_BINARY 0x0001 /* BINARY */
2370 #define CURSOR_OPT_SCROLL 0x0002 /* SCROLL explicitly given */
2371 #define CURSOR_OPT_NO_SCROLL 0x0004 /* NO SCROLL explicitly given */
2372 #define CURSOR_OPT_INSENSITIVE 0x0008 /* INSENSITIVE */
2373 #define CURSOR_OPT_HOLD 0x0010 /* WITH HOLD */
2374 /* these planner-control flags do not correspond to any SQL grammar: */
2375 #define CURSOR_OPT_FAST_PLAN 0x0020 /* prefer fast-start plan */
2376 #define CURSOR_OPT_GENERIC_PLAN 0x0040 /* force use of generic plan */
2377 #define CURSOR_OPT_CUSTOM_PLAN 0x0080 /* force use of custom plan */
2378 #define CURSOR_OPT_PARALLEL_OK 0x0100 /* parallel mode OK */
2379 
2380 typedef struct DeclareCursorStmt
2381 {
2383  char *portalname; /* name of the portal (cursor) */
2384  int options; /* bitmask of options (see above) */
2385  Node *query; /* the raw SELECT query */
2387 
2388 /* ----------------------
2389  * Close Portal Statement
2390  * ----------------------
2391  */
2392 typedef struct ClosePortalStmt
2393 {
2395  char *portalname; /* name of the portal (cursor) */
2396  /* NULL means CLOSE ALL */
2397 } ClosePortalStmt;
2398 
2399 /* ----------------------
2400  * Fetch Statement (also Move)
2401  * ----------------------
2402  */
2403 typedef enum FetchDirection
2404 {
2405  /* for these, howMany is how many rows to fetch; FETCH_ALL means ALL */
2408  /* for these, howMany indicates a position; only one row is fetched */
2411 } FetchDirection;
2412 
2413 #define FETCH_ALL LONG_MAX
2414 
2415 typedef struct FetchStmt
2416 {
2418  FetchDirection direction; /* see above */
2419  long howMany; /* number of rows, or position argument */
2420  char *portalname; /* name of portal (cursor) */
2421  bool ismove; /* TRUE if MOVE */
2422 } FetchStmt;
2423 
2424 /* ----------------------
2425  * Create Index Statement
2426  *
2427  * This represents creation of an index and/or an associated constraint.
2428  * If isconstraint is true, we should create a pg_constraint entry along
2429  * with the index. But if indexOid isn't InvalidOid, we are not creating an
2430  * index, just a UNIQUE/PKEY constraint using an existing index. isconstraint
2431  * must always be true in this case, and the fields describing the index
2432  * properties are empty.
2433  * ----------------------
2434  */
2435 typedef struct IndexStmt
2436 {
2438  char *idxname; /* name of new index, or NULL for default */
2439  RangeVar *relation; /* relation to build index on */
2440  char *accessMethod; /* name of access method (eg. btree) */
2441  char *tableSpace; /* tablespace, or NULL for default */
2442  List *indexParams; /* columns to index: a list of IndexElem */
2443  List *options; /* WITH clause options: a list of DefElem */
2444  Node *whereClause; /* qualification (partial-index predicate) */
2445  List *excludeOpNames; /* exclusion operator names, or NIL if none */
2446  char *idxcomment; /* comment to apply to index, or NULL */
2447  Oid indexOid; /* OID of an existing index, if any */
2448  Oid oldNode; /* relfilenode of existing storage, if any */
2449  bool unique; /* is index unique? */
2450  bool primary; /* is index a primary key? */
2451  bool isconstraint; /* is it for a pkey/unique constraint? */
2452  bool deferrable; /* is the constraint DEFERRABLE? */
2453  bool initdeferred; /* is the constraint INITIALLY DEFERRED? */
2454  bool transformed; /* true when transformIndexStmt is finished */
2455  bool concurrent; /* should this be a concurrent index build? */
2456  bool if_not_exists; /* just do nothing if index already exists? */
2457 } IndexStmt;
2458 
2459 /* ----------------------
2460  * Create Function Statement
2461  * ----------------------
2462  */
2463 typedef struct CreateFunctionStmt
2464 {
2466  bool replace; /* T => replace if already exists */
2467  List *funcname; /* qualified name of function to create */
2468  List *parameters; /* a list of FunctionParameter */
2469  TypeName *returnType; /* the return type */
2470  List *options; /* a list of DefElem */
2471  List *withClause; /* a list of DefElem */
2473 
2475 {
2476  /* the assigned enum values appear in pg_proc, don't change 'em! */
2477  FUNC_PARAM_IN = 'i', /* input only */
2478  FUNC_PARAM_OUT = 'o', /* output only */
2479  FUNC_PARAM_INOUT = 'b', /* both */
2480  FUNC_PARAM_VARIADIC = 'v', /* variadic (always input) */
2481  FUNC_PARAM_TABLE = 't' /* table function output column */
2483 
2484 typedef struct FunctionParameter
2485 {
2487  char *name; /* parameter name, or NULL if not given */
2488  TypeName *argType; /* TypeName for parameter type */
2489  FunctionParameterMode mode; /* IN/OUT/etc */
2490  Node *defexpr; /* raw default expr, or NULL if not given */
2492 
2493 typedef struct AlterFunctionStmt
2494 {
2496  FuncWithArgs *func; /* name and args of function */
2497  List *actions; /* list of DefElem */
2499 
2500 /* ----------------------
2501  * DO Statement
2502  *
2503  * DoStmt is the raw parser output, InlineCodeBlock is the execution-time API
2504  * ----------------------
2505  */
2506 typedef struct DoStmt
2507 {
2509  List *args; /* List of DefElem nodes */
2510 } DoStmt;
2511 
2512 typedef struct InlineCodeBlock
2513 {
2515  char *source_text; /* source text of anonymous code block */
2516  Oid langOid; /* OID of selected language */
2517  bool langIsTrusted; /* trusted property of the language */
2518 } InlineCodeBlock;
2519 
2520 /* ----------------------
2521  * Alter Object Rename Statement
2522  * ----------------------
2523  */
2524 typedef struct RenameStmt
2525 {
2527  ObjectType renameType; /* OBJECT_TABLE, OBJECT_COLUMN, etc */
2528  ObjectType relationType; /* if column name, associated relation type */
2529  RangeVar *relation; /* in case it's a table */
2530  List *object; /* in case it's some other object */
2531  List *objarg; /* argument types, if applicable */
2532  char *subname; /* name of contained object (column, rule,
2533  * trigger, etc) */
2534  char *newname; /* the new name */
2535  DropBehavior behavior; /* RESTRICT or CASCADE behavior */
2536  bool missing_ok; /* skip error if missing? */
2537 } RenameStmt;
2538 
2539 /* ----------------------
2540  * ALTER object DEPENDS ON EXTENSION extname
2541  * ----------------------
2542  */
2544 {
2546  ObjectType objectType; /* OBJECT_FUNCTION, OBJECT_TRIGGER, etc */
2547  RangeVar *relation; /* in case a table is involved */
2548  List *objname; /* name of the object */
2549  List *objargs; /* argument types, if applicable */
2550  Value *extname; /* extension name */
2552 
2553 /* ----------------------
2554  * ALTER object SET SCHEMA Statement
2555  * ----------------------
2556  */
2558 {
2560  ObjectType objectType; /* OBJECT_TABLE, OBJECT_TYPE, etc */
2561  RangeVar *relation; /* in case it's a table */
2562  List *object; /* in case it's some other object */
2563  List *objarg; /* argument types, if applicable */
2564  char *newschema; /* the new schema */
2565  bool missing_ok; /* skip error if missing? */
2567 
2568 /* ----------------------
2569  * Alter Object Owner Statement
2570  * ----------------------
2571  */
2572 typedef struct AlterOwnerStmt
2573 {
2575  ObjectType objectType; /* OBJECT_TABLE, OBJECT_TYPE, etc */
2576  RangeVar *relation; /* in case it's a table */
2577  List *object; /* in case it's some other object */
2578  List *objarg; /* argument types, if applicable */
2579  Node *newowner; /* the new owner */
2580 } AlterOwnerStmt;
2581 
2582 
2583 /* ----------------------
2584  * Alter Operator Set Restrict, Join
2585  * ----------------------
2586  */
2587 typedef struct AlterOperatorStmt
2588 {
2590  List *opername; /* operator name */
2591  List *operargs; /* operator's argument TypeNames */
2592  List *options; /* List of DefElem nodes */
2594 
2595 
2596 /* ----------------------
2597  * Create Rule Statement
2598  * ----------------------
2599  */
2600 typedef struct RuleStmt
2601 {
2603  RangeVar *relation; /* relation the rule is for */
2604  char *rulename; /* name of the rule */
2605  Node *whereClause; /* qualifications */
2606  CmdType event; /* SELECT, INSERT, etc */
2607  bool instead; /* is a 'do instead'? */
2608  List *actions; /* the action statements */
2609  bool replace; /* OR REPLACE */
2610 } RuleStmt;
2611 
2612 /* ----------------------
2613  * Notify Statement
2614  * ----------------------
2615  */
2616 typedef struct NotifyStmt
2617 {
2619  char *conditionname; /* condition name to notify */
2620  char *payload; /* the payload string, or NULL if none */
2621 } NotifyStmt;
2622 
2623 /* ----------------------
2624  * Listen Statement
2625  * ----------------------
2626  */
2627 typedef struct ListenStmt
2628 {
2630  char *conditionname; /* condition name to listen on */
2631 } ListenStmt;
2632 
2633 /* ----------------------
2634  * Unlisten Statement
2635  * ----------------------
2636  */
2637 typedef struct UnlistenStmt
2638 {
2640  char *conditionname; /* name to unlisten on, or NULL for all */
2641 } UnlistenStmt;
2642 
2643 /* ----------------------
2644  * {Begin|Commit|Rollback} Transaction Statement
2645  * ----------------------
2646  */
2648 {
2650  TRANS_STMT_START, /* semantically identical to BEGIN */
2660 
2661 typedef struct TransactionStmt
2662 {
2664  TransactionStmtKind kind; /* see above */
2665  List *options; /* for BEGIN/START and savepoint commands */
2666  char *gid; /* for two-phase-commit related commands */
2667 } TransactionStmt;
2668 
2669 /* ----------------------
2670  * Create Type Statement, composite types
2671  * ----------------------
2672  */
2673 typedef struct CompositeTypeStmt
2674 {
2676  RangeVar *typevar; /* the composite type to be created */
2677  List *coldeflist; /* list of ColumnDef nodes */
2679 
2680 /* ----------------------
2681  * Create Type Statement, enum types
2682  * ----------------------
2683  */
2684 typedef struct CreateEnumStmt
2685 {
2687  List *typeName; /* qualified name (list of Value strings) */
2688  List *vals; /* enum values (list of Value strings) */
2689 } CreateEnumStmt;
2690 
2691 /* ----------------------
2692  * Create Type Statement, range types
2693  * ----------------------
2694  */
2695 typedef struct CreateRangeStmt
2696 {
2698  List *typeName; /* qualified name (list of Value strings) */
2699  List *params; /* range parameters (list of DefElem) */
2700 } CreateRangeStmt;
2701 
2702 /* ----------------------
2703  * Alter Type Statement, enum types
2704  * ----------------------
2705  */
2706 typedef struct AlterEnumStmt
2707 {
2709  List *typeName; /* qualified name (list of Value strings) */
2710  char *newVal; /* new enum value's name */
2711  char *newValNeighbor; /* neighboring enum value, if specified */
2712  bool newValIsAfter; /* place new enum value after neighbor? */
2713  bool skipIfExists; /* no error if label already exists */
2714 } AlterEnumStmt;
2715 
2716 /* ----------------------
2717  * Create View Statement
2718  * ----------------------
2719  */
2720 typedef enum ViewCheckOption
2721 {
2725 } ViewCheckOption;
2726 
2727 typedef struct ViewStmt
2728 {
2730  RangeVar *view; /* the view to be created */
2731  List *aliases; /* target column names */
2732  Node *query; /* the SELECT query */
2733  bool replace; /* replace an existing view? */
2734  List *options; /* options from WITH clause */
2735  ViewCheckOption withCheckOption; /* WITH CHECK OPTION */
2736 } ViewStmt;
2737 
2738 /* ----------------------
2739  * Load Statement
2740  * ----------------------
2741  */
2742 typedef struct LoadStmt
2743 {
2745  char *filename; /* file to load */
2746 } LoadStmt;
2747 
2748 /* ----------------------
2749  * Createdb Statement
2750  * ----------------------
2751  */
2752 typedef struct CreatedbStmt
2753 {
2755  char *dbname; /* name of database to create */
2756  List *options; /* List of DefElem nodes */
2757 } CreatedbStmt;
2758 
2759 /* ----------------------
2760  * Alter Database
2761  * ----------------------
2762  */
2763 typedef struct AlterDatabaseStmt
2764 {
2766  char *dbname; /* name of database to alter */
2767  List *options; /* List of DefElem nodes */
2769 
2770 typedef struct AlterDatabaseSetStmt
2771 {
2773  char *dbname; /* database name */
2774  VariableSetStmt *setstmt; /* SET or RESET subcommand */
2776 
2777 /* ----------------------
2778  * Dropdb Statement
2779  * ----------------------
2780  */
2781 typedef struct DropdbStmt
2782 {
2784  char *dbname; /* database to drop */
2785  bool missing_ok; /* skip error if db is missing? */
2786 } DropdbStmt;
2787 
2788 /* ----------------------
2789  * Alter System Statement
2790  * ----------------------
2791  */
2792 typedef struct AlterSystemStmt
2793 {
2795  VariableSetStmt *setstmt; /* SET subcommand */
2796 } AlterSystemStmt;
2797 
2798 /* ----------------------
2799  * Cluster Statement (support pbrown's cluster index implementation)
2800  * ----------------------
2801  */
2802 typedef struct ClusterStmt
2803 {
2805  RangeVar *relation; /* relation being indexed, or NULL if all */
2806  char *indexname; /* original index defined */
2807  bool verbose; /* print progress info */
2808 } ClusterStmt;
2809 
2810 /* ----------------------
2811  * Vacuum and Analyze Statements
2812  *
2813  * Even though these are nominally two statements, it's convenient to use
2814  * just one node type for both. Note that at least one of VACOPT_VACUUM
2815  * and VACOPT_ANALYZE must be set in options.
2816  * ----------------------
2817  */
2818 typedef enum VacuumOption
2819 {
2820  VACOPT_VACUUM = 1 << 0, /* do VACUUM */
2821  VACOPT_ANALYZE = 1 << 1, /* do ANALYZE */
2822  VACOPT_VERBOSE = 1 << 2, /* print progress info */
2823  VACOPT_FREEZE = 1 << 3, /* FREEZE option */
2824  VACOPT_FULL = 1 << 4, /* FULL (non-concurrent) vacuum */
2825  VACOPT_NOWAIT = 1 << 5, /* don't wait to get lock (autovacuum only) */
2826  VACOPT_SKIPTOAST = 1 << 6, /* don't process the TOAST table, if any */
2827  VACOPT_DISABLE_PAGE_SKIPPING = 1 << 7 /* don't skip any pages */
2828 } VacuumOption;
2829 
2830 typedef struct VacuumStmt
2831 {
2833  int options; /* OR of VacuumOption flags */
2834  RangeVar *relation; /* single table to process, or NULL */
2835  List *va_cols; /* list of column names, or NIL for all */
2836 } VacuumStmt;
2837 
2838 /* ----------------------
2839  * Explain Statement
2840  *
2841  * The "query" field is either a raw parse tree (SelectStmt, InsertStmt, etc)
2842  * or a Query node if parse analysis has been done. Note that rewriting and
2843  * planning of the query are always postponed until execution of EXPLAIN.
2844  * ----------------------
2845  */
2846 typedef struct ExplainStmt
2847 {
2849  Node *query; /* the query (see comments above) */
2850  List *options; /* list of DefElem nodes */
2851 } ExplainStmt;
2852 
2853 /* ----------------------
2854  * CREATE TABLE AS Statement (a/k/a SELECT INTO)
2855  *
2856  * A query written as CREATE TABLE AS will produce this node type natively.
2857  * A query written as SELECT ... INTO will be transformed to this form during
2858  * parse analysis.
2859  * A query written as CREATE MATERIALIZED view will produce this node type,
2860  * during parse analysis, since it needs all the same data.
2861  *
2862  * The "query" field is handled similarly to EXPLAIN, though note that it
2863  * can be a SELECT or an EXECUTE, but not other DML statements.
2864  * ----------------------
2865  */
2866 typedef struct CreateTableAsStmt
2867 {
2869  Node *query; /* the query (see comments above) */
2870  IntoClause *into; /* destination table */
2871  ObjectType relkind; /* OBJECT_TABLE or OBJECT_MATVIEW */
2872  bool is_select_into; /* it was written as SELECT INTO */
2873  bool if_not_exists; /* just do nothing if it already exists? */
2875 
2876 /* ----------------------
2877  * REFRESH MATERIALIZED VIEW Statement
2878  * ----------------------
2879  */
2880 typedef struct RefreshMatViewStmt
2881 {
2883  bool concurrent; /* allow concurrent access? */
2884  bool skipData; /* true for WITH NO DATA */
2885  RangeVar *relation; /* relation to insert into */
2887 
2888 /* ----------------------
2889  * Checkpoint Statement
2890  * ----------------------
2891  */
2892 typedef struct CheckPointStmt
2893 {
2895 } CheckPointStmt;
2896 
2897 /* ----------------------
2898  * Discard Statement
2899  * ----------------------
2900  */
2901 
2902 typedef enum DiscardMode
2903 {
2908 } DiscardMode;
2909 
2910 typedef struct DiscardStmt
2911 {
2914 } DiscardStmt;
2915 
2916 /* ----------------------
2917  * LOCK Statement
2918  * ----------------------
2919  */
2920 typedef struct LockStmt
2921 {
2923  List *relations; /* relations to lock */
2924  int mode; /* lock mode */
2925  bool nowait; /* no wait mode */
2926 } LockStmt;
2927 
2928 /* ----------------------
2929  * SET CONSTRAINTS Statement
2930  * ----------------------
2931  */
2932 typedef struct ConstraintsSetStmt
2933 {
2935  List *constraints; /* List of names as RangeVars */
2936  bool deferred;
2938 
2939 /* ----------------------
2940  * REINDEX Statement
2941  * ----------------------
2942  */
2943 
2944 /* Reindex options */
2945 #define REINDEXOPT_VERBOSE 1 << 0 /* print progress info */
2946 
2947 typedef enum ReindexObjectType
2948 {
2950  REINDEX_OBJECT_TABLE, /* table or materialized view */
2952  REINDEX_OBJECT_SYSTEM, /* system catalogs */
2955 
2956 typedef struct ReindexStmt
2957 {
2959  ReindexObjectType kind; /* REINDEX_OBJECT_INDEX, REINDEX_OBJECT_TABLE,
2960  * etc. */
2961  RangeVar *relation; /* Table or index to reindex */
2962  const char *name; /* name of database to reindex */
2963  int options; /* Reindex options flags */
2964 } ReindexStmt;
2965 
2966 /* ----------------------
2967  * CREATE CONVERSION Statement
2968  * ----------------------
2969  */
2970 typedef struct CreateConversionStmt
2971 {
2973  List *conversion_name; /* Name of the conversion */
2974  char *for_encoding_name; /* source encoding name */
2975  char *to_encoding_name; /* destination encoding name */
2976  List *func_name; /* qualified conversion function name */
2977  bool def; /* is this a default conversion? */
2979 
2980 /* ----------------------
2981  * CREATE CAST Statement
2982  * ----------------------
2983  */
2984 typedef struct CreateCastStmt
2985 {
2991  bool inout;
2992 } CreateCastStmt;
2993 
2994 /* ----------------------
2995  * CREATE TRANSFORM Statement
2996  * ----------------------
2997  */
2998 typedef struct CreateTransformStmt
2999 {
3001  bool replace;
3003  char *lang;
3007 
3008 /* ----------------------
3009  * PREPARE Statement
3010  * ----------------------
3011  */
3012 typedef struct PrepareStmt
3013 {
3015  char *name; /* Name of plan, arbitrary */
3016  List *argtypes; /* Types of parameters (List of TypeName) */
3017  Node *query; /* The query itself (as a raw parsetree) */
3018 } PrepareStmt;
3019 
3020 
3021 /* ----------------------
3022  * EXECUTE Statement
3023  * ----------------------
3024  */
3025 
3026 typedef struct ExecuteStmt
3027 {
3029  char *name; /* The name of the plan to execute */
3030  List *params; /* Values to assign to parameters */
3031 } ExecuteStmt;
3032 
3033 
3034 /* ----------------------
3035  * DEALLOCATE Statement
3036  * ----------------------
3037  */
3038 typedef struct DeallocateStmt
3039 {
3041  char *name; /* The name of the plan to remove */
3042  /* NULL means DEALLOCATE ALL */
3043 } DeallocateStmt;
3044 
3045 /*
3046  * DROP OWNED statement
3047  */
3048 typedef struct DropOwnedStmt
3049 {
3053 } DropOwnedStmt;
3054 
3055 /*
3056  * REASSIGN OWNED statement
3057  */
3058 typedef struct ReassignOwnedStmt
3059 {
3064 
3065 /*
3066  * TS Dictionary stmts: DefineStmt, RenameStmt and DropStmt are default
3067  */
3069 {
3071  List *dictname; /* qualified name (list of Value strings) */
3072  List *options; /* List of DefElem nodes */
3074 
3075 /*
3076  * TS Configuration stmts: DefineStmt, RenameStmt and DropStmt are default
3077  */
3078 typedef enum AlterTSConfigType
3079 {
3086 
3088 {
3090  AlterTSConfigType kind; /* ALTER_TSCONFIG_ADD_MAPPING, etc */
3091  List *cfgname; /* qualified name (list of Value strings) */
3092 
3093  /*
3094  * dicts will be non-NIL if ADD/ALTER MAPPING was specified. If dicts is
3095  * NIL, but tokentype isn't, DROP MAPPING was specified.
3096  */
3097  List *tokentype; /* list of Value strings */
3098  List *dicts; /* list of list of Value strings */
3099  bool override; /* if true - remove old variant */
3100  bool replace; /* if true - replace dictionary by another */
3101  bool missing_ok; /* for DROP - skip error if missing? */
3103 
3104 #endif /* PARSENODES_H */
struct CreateFdwStmt CreateFdwStmt
bool deferrable
Definition: parsenodes.h:2452
RangeVar * relation
Definition: parsenodes.h:1750
ObjectType objtype
Definition: parsenodes.h:2341
bool replace
Definition: parsenodes.h:2733
List * lockedRels
Definition: parsenodes.h:683
struct FetchStmt FetchStmt
signed short int16
Definition: c.h:252
List * indirection
Definition: parsenodes.h:423
Node * limitOffset
Definition: parsenodes.h:149
struct AlterDatabaseSetStmt AlterDatabaseSetStmt
List * partitionClause
Definition: parsenodes.h:471
SortByDir
Definition: parsenodes.h:39
char * refname
Definition: parsenodes.h:1097
NodeTag type
Definition: parsenodes.h:2618
struct SelectStmt * larg
Definition: parsenodes.h:1321
bool primary
Definition: parsenodes.h:2450
bool copiedOrder
Definition: parsenodes.h:1104
OnCommitAction oncommit
Definition: parsenodes.h:1757
TypeName * sourcetype
Definition: parsenodes.h:2987
ConstrType
Definition: parsenodes.h:1793
NodeTag type
Definition: parsenodes.h:3050
List * fromClause
Definition: parsenodes.h:1253
struct DropTableSpaceStmt DropTableSpaceStmt
struct ViewStmt ViewStmt
List * inhRelations
Definition: parsenodes.h:1752
NodeTag type
Definition: parsenodes.h:2958
uint32 queryId
Definition: parsenodes.h:107
bool nowait
Definition: parsenodes.h:2925
struct CreateSchemaStmt CreateSchemaStmt
Alias * alias
Definition: parsenodes.h:543
Oid typeOid
Definition: parsenodes.h:192
ObjectType objtype
Definition: parsenodes.h:2354
List * keys
Definition: parsenodes.h:1839
GrantObjectType
Definition: parsenodes.h:1589
struct CreateForeignTableStmt CreateForeignTableStmt
NodeTag type
Definition: parsenodes.h:2328
NodeTag type
Definition: parsenodes.h:2729
List * exclusions
Definition: parsenodes.h:1842
struct TableLikeClause TableLikeClause
List * joinaliasvars
Definition: parsenodes.h:831
Node * val
Definition: parsenodes.h:424
SortByDir ordering
Definition: parsenodes.h:640
List * objname
Definition: parsenodes.h:2342
Node * subquery
Definition: parsenodes.h:518
NodeTag type
Definition: parsenodes.h:2508
NodeTag type
Definition: parsenodes.h:2313
List * sortClause
Definition: parsenodes.h:147
struct CreateExtensionStmt CreateExtensionStmt
List * old_conpfeqop
Definition: parsenodes.h:1859
struct WindowDef WindowDef
struct FuncCall FuncCall
FetchDirection
Definition: parsenodes.h:2403
List * content
Definition: parsenodes.h:1075
List * names
Definition: parsenodes.h:191
IntoClause * intoClause
Definition: parsenodes.h:1288
A_Expr_Kind kind
Definition: parsenodes.h:257
struct DeclareCursorStmt DeclareCursorStmt
List * options
Definition: parsenodes.h:2443
struct CopyStmt CopyStmt
char storage
Definition: parsenodes.h:595
DropBehavior behavior
Definition: parsenodes.h:1573
VariableSetKind kind
Definition: parsenodes.h:1720
List * attlist
Definition: parsenodes.h:1692
struct VacuumStmt VacuumStmt
List * fromClause
Definition: parsenodes.h:1290
char * subname
Definition: parsenodes.h:2532
SortByDir sortby_dir
Definition: parsenodes.h:452
NodeTag type
Definition: parsenodes.h:2848
Alias * alias
Definition: parsenodes.h:863
NodeTag type
Definition: parsenodes.h:2708
NodeTag type
Definition: parsenodes.h:450
bool is_local
Definition: parsenodes.h:592
ObjectType renameType
Definition: parsenodes.h:2527
struct AlterDomainStmt AlterDomainStmt
struct CreateCastStmt CreateCastStmt
RangeVar * relation
Definition: parsenodes.h:1236
FromExpr * jointree
Definition: parsenodes.h:129
TransactionStmtKind
Definition: parsenodes.h:2647
char * name
Definition: parsenodes.h:422
struct LoadStmt LoadStmt
int frameOptions
Definition: parsenodes.h:473
OnConflictExpr * onConflict
Definition: parsenodes.h:133
NodeTag type
Definition: parsenodes.h:331
TypeName * storedtype
Definition: parsenodes.h:2279
struct A_Indices A_Indices
struct AlterExtensionContentsStmt AlterExtensionContentsStmt
struct AlterObjectSchemaStmt AlterObjectSchemaStmt
RoleStmtType
Definition: parsenodes.h:2162
struct ColumnDef ColumnDef
List * funcargs
Definition: parsenodes.h:1630
struct VariableShowStmt VariableShowStmt
char * tableSpace
Definition: parsenodes.h:2441
Node * limitOffset
Definition: parsenodes.h:1311
List * constraintDeps
Definition: parsenodes.h:157
struct WithCheckOption WithCheckOption
struct CompositeTypeStmt CompositeTypeStmt
char fk_matchtype
Definition: parsenodes.h:1856
List * constraints
Definition: parsenodes.h:600
Node * whenClause
Definition: parsenodes.h:2104
List * securityQuals
Definition: parsenodes.h:873
List * withCheckOptions
Definition: parsenodes.h:160
RoleStmtType stmt_type
Definition: parsenodes.h:2172
Node * agg_filter
Definition: parsenodes.h:335
struct DropUserMappingStmt DropUserMappingStmt
Node * raw_expr
Definition: parsenodes.h:1835
struct CreateRoleStmt CreateRoleStmt
struct A_Indirection A_Indirection
struct RoleSpec RoleSpec
List * objects
Definition: parsenodes.h:2314
bool missing_ok
Definition: parsenodes.h:2318
struct DeallocateStmt DeallocateStmt
struct InferClause InferClause
struct GrantRoleStmt GrantRoleStmt
bool if_not_exists
Definition: parsenodes.h:2211
struct TypeName TypeName
struct AlterRoleSetStmt AlterRoleSetStmt
List * useOp
Definition: parsenodes.h:454
bool hasAggs
Definition: parsenodes.h:117
char * name
Definition: parsenodes.h:469
struct CommonTableExpr CommonTableExpr
struct WindowClause WindowClause
struct AlterForeignServerStmt AlterForeignServerStmt
ObjectType objectType
Definition: parsenodes.h:2575
NodeTag type
Definition: parsenodes.h:226
int resultRelation
Definition: parsenodes.h:114
struct AccessPriv AccessPriv
struct FuncWithArgs FuncWithArgs
List * indexElems
Definition: parsenodes.h:1152
RangeVar * typevar
Definition: parsenodes.h:2676
char * defnamespace
Definition: parsenodes.h:665
struct CreateStmt CreateStmt
Index tleSortGroupRef
Definition: parsenodes.h:1005
QuerySource
Definition: parsenodes.h:29
Node * whereClause
Definition: parsenodes.h:2444
AlterTSConfigType
Definition: parsenodes.h:3078
char * provider
Definition: parsenodes.h:2357
bool grant_option
Definition: parsenodes.h:1617
List * groupingSets
Definition: parsenodes.h:139
DefElemAction defaction
Definition: parsenodes.h:668
NodeTag type
Definition: parsenodes.h:216
List * ctecoltypmods
Definition: parsenodes.h:857
Definition: nodes.h:492
struct RangeTableSample RangeTableSample
NodeTag type
Definition: parsenodes.h:2629
struct RenameStmt RenameStmt
NodeTag type
Definition: parsenodes.h:2832
bool initdeferred
Definition: parsenodes.h:1830
char * filename
Definition: parsenodes.h:2745
AlterTableType subtype
Definition: parsenodes.h:1541
List * actions
Definition: parsenodes.h:2608
List * granted_roles
Definition: parsenodes.h:1659
char * comment
Definition: parsenodes.h:2344
List * targetList
Definition: parsenodes.h:1251
FuncWithArgs * func
Definition: parsenodes.h:2989
FuncWithArgs * tosql
Definition: parsenodes.h:3005
List * options
Definition: parsenodes.h:2850
Node * grantor
Definition: parsenodes.h:1663
AclMode requiredPerms
Definition: parsenodes.h:868
List * roles
Definition: parsenodes.h:2196
List * pk_attrs
Definition: parsenodes.h:1855
List * cols
Definition: parsenodes.h:1644
TypeName * typeName
Definition: parsenodes.h:696
char * conname
Definition: parsenodes.h:1828
struct AlterOpFamilyStmt AlterOpFamilyStmt
bool is_not_null
Definition: parsenodes.h:593
List * funccolnames
Definition: parsenodes.h:899
NodeTag type
Definition: parsenodes.h:1073
struct DropStmt DropStmt
NodeTag type
Definition: parsenodes.h:1095
bool funcordinality
Definition: parsenodes.h:842
NodeTag type
Definition: parsenodes.h:2744
NodeTag type
Definition: parsenodes.h:1628
int location
Definition: parsenodes.h:341
char * newname
Definition: parsenodes.h:2534
struct SetOperationStmt SetOperationStmt
unsigned int Oid
Definition: postgres_ext.h:31
NodeTag
Definition: nodes.h:26
List * rowMarks
Definition: parsenodes.h:152
Node * utilityStmt
Definition: parsenodes.h:111
bool is_program
Definition: parsenodes.h:1695
struct CreateDomainStmt CreateDomainStmt
List * ctecoltypes
Definition: parsenodes.h:856
FuncWithArgs * func
Definition: parsenodes.h:2496
struct TransactionStmt TransactionStmt
struct PrepareStmt PrepareStmt
ReindexObjectType
Definition: parsenodes.h:2947
struct LockingClause LockingClause
CoercionContext
Definition: primnodes.h:404
WithClause * withClause
Definition: parsenodes.h:1226
struct RangeFunction RangeFunction
RangeVar * relation
Definition: parsenodes.h:2885
List * agg_order
Definition: parsenodes.h:334
List * values_lists
Definition: parsenodes.h:847
ObjectType removeType
Definition: parsenodes.h:2316
bool instead
Definition: parsenodes.h:2607
OnCommitAction
Definition: primnodes.h:53
LockClauseStrength strength
Definition: parsenodes.h:1123
bool hasDistinctOn
Definition: parsenodes.h:120
RangeVar * table
Definition: parsenodes.h:2069
Node * whereClause
Definition: parsenodes.h:1252
List * options
Definition: parsenodes.h:2218
RangeVar * view
Definition: parsenodes.h:2730
signed int int32
Definition: c.h:253
OnConflictClause * onConflictClause
Definition: parsenodes.h:1224
struct TruncateStmt TruncateStmt
struct CreatePLangStmt CreatePLangStmt
List * options
Definition: parsenodes.h:1845
List * windowClause
Definition: parsenodes.h:143
JoinType
Definition: nodes.h:628
List * targetList
Definition: parsenodes.h:131
NodeTag type
Definition: parsenodes.h:1824
int location
Definition: parsenodes.h:282
VariableSetStmt * setstmt
Definition: parsenodes.h:2774
bool hasRecursive
Definition: parsenodes.h:121
int location
Definition: parsenodes.h:218
NodeTag type
Definition: parsenodes.h:1220
struct ParamRef ParamRef
int location
Definition: parsenodes.h:425
FuncWithArgs * fromsql
Definition: parsenodes.h:3004
NodeTag type
Definition: parsenodes.h:1952
struct CreateEventTrigStmt CreateEventTrigStmt
GroupingSetKind kind
Definition: parsenodes.h:1074
struct SelectStmt SelectStmt
struct LockStmt LockStmt
List * constraints
Definition: parsenodes.h:1755
bool if_not_exists
Definition: parsenodes.h:1759
struct A_Expr A_Expr
struct ListenStmt ListenStmt
Node * cooked_default
Definition: parsenodes.h:597
struct AlterEventTrigStmt AlterEventTrigStmt
NodeTag type
Definition: parsenodes.h:1658
WithClause * withClause
Definition: parsenodes.h:1240
struct RuleStmt RuleStmt
RangeVar * constrrel
Definition: parsenodes.h:2109
Node * query
Definition: parsenodes.h:2849
NodeTag type
Definition: parsenodes.h:3028
Oid indexOid
Definition: parsenodes.h:2447
struct ClusterStmt ClusterStmt
List * objarg
Definition: parsenodes.h:2531
Node * expr
Definition: parsenodes.h:636
char * newValNeighbor
Definition: parsenodes.h:2711
struct DropOwnedStmt DropOwnedStmt
uint32 AclMode
Definition: parsenodes.h:61
struct CreatedbStmt CreatedbStmt
RangeVar * relation
Definition: parsenodes.h:2439
DropBehavior behavior
Definition: parsenodes.h:2331
struct ColumnRef ColumnRef
bool is_slice
Definition: parsenodes.h:364
List * distinctClause
Definition: parsenodes.h:1286
Bitmapset * selectedCols
Definition: parsenodes.h:870
List * returningList
Definition: parsenodes.h:1239
Node * startOffset
Definition: parsenodes.h:474
char * indexname
Definition: parsenodes.h:2806
NodeTag type
Definition: parsenodes.h:2081
NodeTag type
Definition: parsenodes.h:290
struct AlterTSConfigurationStmt AlterTSConfigurationStmt
SetOperation
Definition: parsenodes.h:1271
AlterTableType
Definition: parsenodes.h:1465
List * options
Definition: parsenodes.h:1947
List * rtable
Definition: parsenodes.h:128
NodeTag type
Definition: parsenodes.h:2437
struct AlterEnumStmt AlterEnumStmt
CollateClause * collClause
Definition: parsenodes.h:2245
List * distinctClause
Definition: parsenodes.h:145
struct CreateTableSpaceStmt CreateTableSpaceStmt
bool missing_ok
Definition: parsenodes.h:2536
List * args
Definition: parsenodes.h:2232
SortByNulls nulls_ordering
Definition: parsenodes.h:641
struct OnConflictClause OnConflictClause
char * policy_name
Definition: parsenodes.h:2068
List * aliases
Definition: parsenodes.h:2731
List * objargs
Definition: parsenodes.h:2343
struct FunctionParameter FunctionParameter
struct UpdateStmt UpdateStmt
bool concurrent
Definition: parsenodes.h:2319
struct WindowDef * over
Definition: parsenodes.h:340
NodeTag type
Definition: parsenodes.h:1121
struct CreateFunctionStmt CreateFunctionStmt
List * partitionClause
Definition: parsenodes.h:1098
struct A_ArrayExpr A_ArrayExpr
List * coldeflist
Definition: parsenodes.h:544
Node * selectStmt
Definition: parsenodes.h:1223
bool deferrable
Definition: parsenodes.h:1829
int location
Definition: parsenodes.h:476
struct CreateTransformStmt CreateTransformStmt
char * label
Definition: parsenodes.h:2358
char * amname
Definition: parsenodes.h:2082
RangeVar * relation
Definition: parsenodes.h:1689
struct Query Query
struct CreateForeignServerStmt CreateForeignServerStmt
bool setof
Definition: parsenodes.h:193
GrantTargetType
Definition: parsenodes.h:1582
struct AlterFdwStmt AlterFdwStmt
struct A_Star A_Star
RangeVar * relation
Definition: parsenodes.h:2961
Node * endOffset
Definition: parsenodes.h:475
List * cols
Definition: parsenodes.h:1222
NodeTag type
Definition: parsenodes.h:1281
struct IndexStmt IndexStmt
RTEKind
Definition: parsenodes.h:778
List * relations
Definition: parsenodes.h:2329
List * typeName
Definition: parsenodes.h:2709
VariableSetStmt * setstmt
Definition: parsenodes.h:2795
NodeTag type
Definition: parsenodes.h:309
struct TypeCast TypeCast
char * dbname
Definition: parsenodes.h:2755
NodeTag type
Definition: parsenodes.h:1540
NodeTag type
Definition: parsenodes.h:2179
TableLikeOption
Definition: parsenodes.h:615
TypeName * datatype
Definition: parsenodes.h:2259
struct ImportForeignSchemaStmt ImportForeignSchemaStmt
FunctionParameterMode
Definition: parsenodes.h:2474
struct AlterTableSpaceOptionsStmt AlterTableSpaceOptionsStmt
Node * limitCount
Definition: parsenodes.h:150
List * va_cols
Definition: parsenodes.h:2835
struct ExecuteStmt ExecuteStmt
NodeTag type
Definition: parsenodes.h:516
struct AlterTableCmd AlterTableCmd
List * elements
Definition: parsenodes.h:397
struct RangeTblFunction RangeTblFunction
List * sortClause
Definition: parsenodes.h:1310
struct VariableSetStmt VariableSetStmt
char * conname
Definition: parsenodes.h:1154
struct ClosePortalStmt ClosePortalStmt
List * targetList
Definition: parsenodes.h:1289
bool transformed
Definition: parsenodes.h:2454
struct AlterExtensionStmt AlterExtensionStmt
CoercionContext context
Definition: parsenodes.h:2990
Oid collOid
Definition: parsenodes.h:599
List * fdwoptions
Definition: parsenodes.h:601
NodeTag type
Definition: parsenodes.h:2195
JoinType jointype
Definition: parsenodes.h:830
Node * rexpr
Definition: parsenodes.h:260
SortByNulls sortby_nulls
Definition: parsenodes.h:453
char * fdwname
Definition: parsenodes.h:1945
char * indexcolname
Definition: parsenodes.h:637
bool replace
Definition: parsenodes.h:2609
bool restart_seqs
Definition: parsenodes.h:2330
LockClauseStrength strength
Definition: parsenodes.h:684
NodeTag type
Definition: parsenodes.h:1249
List * functions
Definition: parsenodes.h:542
struct DropRoleStmt DropRoleStmt
int location
Definition: parsenodes.h:261
List * options
Definition: parsenodes.h:1697
NodeTag type
Definition: parsenodes.h:2804
NodeTag type
Definition: parsenodes.h:1944
List * options
Definition: parsenodes.h:1756
NodeTag type
Definition: parsenodes.h:2340
List * objargs
Definition: parsenodes.h:2356
struct CreateEnumStmt CreateEnumStmt
struct AlterTableMoveAllStmt AlterTableMoveAllStmt
DropBehavior behavior
Definition: parsenodes.h:2317
unsigned int uint32
Definition: c.h:265
char * fdwname
Definition: parsenodes.h:1953
struct SecLabelStmt SecLabelStmt
DropBehavior behavior
Definition: parsenodes.h:3052
bool recursive
Definition: parsenodes.h:1139
TypeName * argType
Definition: parsenodes.h:2488
int location
Definition: parsenodes.h:602
AlterTSConfigType kind
Definition: parsenodes.h:3090
List * ctecoltypmods
Definition: parsenodes.h:1194
List * valuesLists
Definition: parsenodes.h:1304
struct CreateOpFamilyStmt CreateOpFamilyStmt
RoleSpecType
Definition: parsenodes.h:299
List * returningList
Definition: parsenodes.h:135
char * conditionname
Definition: parsenodes.h:2630
NodeTag type
Definition: parsenodes.h:3014
NodeTag type
Definition: parsenodes.h:693
NodeTag type
Definition: parsenodes.h:421
WCOKind
Definition: parsenodes.h:926
List * returningList
Definition: parsenodes.h:1225
VacuumOption
Definition: parsenodes.h:2818
char * portalname
Definition: parsenodes.h:2420
ObjectType relkind
Definition: parsenodes.h:2871
NodeTag type
Definition: parsenodes.h:2353
struct SortGroupClause SortGroupClause
NodeTag type
Definition: parsenodes.h:439
Node * lexpr
Definition: parsenodes.h:259
ObjectType relkind
Definition: parsenodes.h:1461
List * lockingClause
Definition: parsenodes.h:1313
Oid old_pktable_oid
Definition: parsenodes.h:1860
List * plvalidator
Definition: parsenodes.h:2149
struct Constraint Constraint
Node * arg
Definition: parsenodes.h:667
ObjectType
Definition: parsenodes.h:1381
XmlOptionType xmloption
Definition: parsenodes.h:694
bool is_rowsfrom
Definition: parsenodes.h:541
NodeTag type
Definition: parsenodes.h:2754
NodeTag type
Definition: parsenodes.h:269
Node * raw_default
Definition: parsenodes.h:596
char * rulename
Definition: parsenodes.h:2604
int location
Definition: parsenodes.h:312
struct ReplicaIdentityStmt ReplicaIdentityStmt
char * tablespacename
Definition: parsenodes.h:1758
struct CheckPointStmt CheckPointStmt
char * idxname
Definition: parsenodes.h:2438
bool missing_ok
Definition: parsenodes.h:2785
List * func_options
Definition: parsenodes.h:1954
bool is_grant
Definition: parsenodes.h:1609
bool func_variadic
Definition: parsenodes.h:339
struct AlterTSDictionaryStmt AlterTSDictionaryStmt
struct ReindexStmt ReindexStmt
struct NotifyStmt NotifyStmt
List * ctecolnames
Definition: parsenodes.h:1192
Node * startOffset
Definition: parsenodes.h:1101
NodeTag type
Definition: parsenodes.h:256
DropBehavior
Definition: parsenodes.h:1446
List * orderClause
Definition: parsenodes.h:472
bool if_not_exists
Definition: parsenodes.h:2456
struct XmlSerialize XmlSerialize
NodeTag type
Definition: parsenodes.h:2228
LockClauseStrength
Definition: lockoptions.h:21
List * colCollations
Definition: parsenodes.h:1358
struct RowMarkClause RowMarkClause
bool ismove
Definition: parsenodes.h:2421
NodeTag type
Definition: parsenodes.h:1749
struct AlterSystemStmt AlterSystemStmt
struct ReassignOwnedStmt ReassignOwnedStmt
RangeVar * relation
Definition: parsenodes.h:1221
struct RangeTblEntry RangeTblEntry
NodeTag type
Definition: parsenodes.h:101
RoleSpecType roletype
Definition: parsenodes.h:310
bool self_reference
Definition: parsenodes.h:855
bool newValIsAfter
Definition: parsenodes.h:2712
List * typmods
Definition: parsenodes.h:195
List * relations
Definition: parsenodes.h:2923
List * handler_name
Definition: parsenodes.h:2083
bool unique
Definition: parsenodes.h:2449
ObjectType kind
Definition: parsenodes.h:2229
TypeName * typeName
Definition: parsenodes.h:281
char * conditionname
Definition: parsenodes.h:2619
RangeVar * relation
Definition: parsenodes.h:2529
int number
Definition: parsenodes.h:227
long howMany
Definition: parsenodes.h:2419
unsigned int Index
Definition: c.h:361
InferClause * infer
Definition: parsenodes.h:1168
Node * whereClause
Definition: parsenodes.h:1238
List * usingClause
Definition: parsenodes.h:1237
List * privileges
Definition: parsenodes.h:1614
NodeTag type
Definition: parsenodes.h:1151
VariableSetStmt * setstmt
Definition: parsenodes.h:2190
NodeTag type
Definition: parsenodes.h:2783
List * windowClause
Definition: parsenodes.h:1294
struct MultiAssignRef MultiAssignRef
bool security_barrier
Definition: parsenodes.h:811
char * accessMethod
Definition: parsenodes.h:2440
struct AlterPolicyStmt AlterPolicyStmt
SetOperation op
Definition: parsenodes.h:1319
RangeVar * sequence
Definition: parsenodes.h:2217
ImportForeignSchemaType
Definition: parsenodes.h:2028
List * funccoltypmods
Definition: parsenodes.h:901
bool is_no_inherit
Definition: parsenodes.h:1834
List * defnames
Definition: parsenodes.h:2231
bool initially_valid
Definition: parsenodes.h:1864
Bitmapset * updatedCols
Definition: parsenodes.h:872
RangeVar * sequence
Definition: parsenodes.h:2208
struct CreateRangeStmt CreateRangeStmt
struct AlterObjectDependsStmt AlterObjectDependsStmt
List * opclass
Definition: parsenodes.h:639
IntoClause * into
Definition: parsenodes.h:2870
bool is_from_type
Definition: parsenodes.h:594
NodeTag type
Definition: parsenodes.h:1642
struct IndexElem IndexElem
List * tableElts
Definition: parsenodes.h:1751
CmdType commandType
Definition: parsenodes.h:103
List * ctecolcollations
Definition: parsenodes.h:858
struct ResTarget ResTarget
int location
Definition: parsenodes.h:228
Node * where_clause
Definition: parsenodes.h:1850
struct DeleteStmt DeleteStmt
NodeTag type
Definition: parsenodes.h:682
DropBehavior behavior
Definition: parsenodes.h:1618
List * funccolcollations
Definition: parsenodes.h:902
struct AlterRoleStmt AlterRoleStmt
CmdType event
Definition: parsenodes.h:2606
uint32 bits32
Definition: c.h:274
char fk_del_action
Definition: parsenodes.h:1858
NodeTag type
Definition: parsenodes.h:386
NodeTag type
Definition: parsenodes.h:664
QuerySource querySource
Definition: parsenodes.h:105
List * options
Definition: parsenodes.h:2734
SortByNulls
Definition: parsenodes.h:47
char * name
Definition: parsenodes.h:3015
bool hasWindowFuncs
Definition: parsenodes.h:118
ReindexObjectType kind
Definition: parsenodes.h:2959
List * objects
Definition: parsenodes.h:1612
struct RangeSubselect RangeSubselect
int location
Definition: parsenodes.h:271
TypeName * returnType
Definition: parsenodes.h:2469
List * functions
Definition: parsenodes.h:841
Definition: value.h:42
List * indirection
Definition: parsenodes.h:388
RangeVar * relation
Definition: parsenodes.h:2834
List * options
Definition: parsenodes.h:2181
NodeTag type
Definition: parsenodes.h:468
Alias * alias
Definition: parsenodes.h:519
RangeVar * relation
Definition: parsenodes.h:1250
XmlOptionType
Definition: primnodes.h:1076
List * indexParams
Definition: parsenodes.h:2442
Node * query
Definition: parsenodes.h:3017
bool canSetTag
Definition: parsenodes.h:109
struct CommentStmt CommentStmt
struct GrantStmt GrantStmt
struct SelectStmt * rarg
Definition: parsenodes.h:1322
int location
Definition: parsenodes.h:198
A_Expr_Kind
Definition: parsenodes.h:234
List * options
Definition: parsenodes.h:2756
Node * endOffset
Definition: parsenodes.h:1102
Node * whereClause
Definition: parsenodes.h:2605
struct AlterOperatorStmt AlterOperatorStmt
struct AlterSeqStmt AlterSeqStmt
List * args
Definition: parsenodes.h:333
List * returningList
Definition: parsenodes.h:1254
VariableSetKind
Definition: parsenodes.h:1707
List * excludeOpNames
Definition: parsenodes.h:2445
List * argtypes
Definition: parsenodes.h:3016
struct DoStmt DoStmt
List * objname
Definition: parsenodes.h:2355
Node * lidx
Definition: parsenodes.h:365
NodeTag type
Definition: parsenodes.h:2602
int32 typemod
Definition: parsenodes.h:196
SetOperation op
Definition: parsenodes.h:1349
Index ctelevelsup
Definition: parsenodes.h:854
struct WithClause WithClause
List * values_collations
Definition: parsenodes.h:848
LockWaitPolicy waitPolicy
Definition: parsenodes.h:1124
NodeTag type
Definition: parsenodes.h:2417
TypeName * typeName
Definition: parsenodes.h:590
char * rolename
Definition: parsenodes.h:311
Node * whereClause
Definition: parsenodes.h:1153
CollateClause * collClause
Definition: parsenodes.h:598
Bitmapset * funcparams
Definition: parsenodes.h:904
bool initdeferred
Definition: parsenodes.h:2453
char * name
Definition: parsenodes.h:635
NodeTag type
Definition: parsenodes.h:2912
char * idxcomment
Definition: parsenodes.h:2446
struct CreateOpClassStmt CreateOpClassStmt
NodeTag type
Definition: parsenodes.h:1235
List * name
Definition: parsenodes.h:258
struct TableSampleClause TableSampleClause
struct SortBy SortBy
List * args
Definition: parsenodes.h:2509
List * groupClause
Definition: parsenodes.h:1292
TypeName * typeName
Definition: parsenodes.h:2244
NodeTag type
Definition: parsenodes.h:588
NodeTag type
Definition: parsenodes.h:2207
struct CreatePolicyStmt CreatePolicyStmt
RangeVar * table
Definition: parsenodes.h:2054
List * options
Definition: parsenodes.h:1955
RangeVar * relation
Definition: parsenodes.h:611
List * ctecoltypes
Definition: parsenodes.h:1193
Node * query
Definition: parsenodes.h:1690
RTEKind rtekind
Definition: parsenodes.h:792
struct CreateConversionStmt CreateConversionStmt
struct InlineCodeBlock InlineCodeBlock
TypeName * type_name
Definition: parsenodes.h:3002
DiscardMode target
Definition: parsenodes.h:2913
NodeTag type
Definition: parsenodes.h:2216
List * orderClause
Definition: parsenodes.h:1099
NodeTag type
Definition: parsenodes.h:1137
struct UnlistenStmt UnlistenStmt
bool concurrent
Definition: parsenodes.h:2455
GrantObjectType objtype
Definition: parsenodes.h:1611
List * collname
Definition: parsenodes.h:292
char * ctename
Definition: parsenodes.h:853
List * cteList
Definition: parsenodes.h:126
NodeTag type
Definition: parsenodes.h:538
List * arrayBounds
Definition: parsenodes.h:197
Node * setOperations
Definition: parsenodes.h:154
bool isconstraint
Definition: parsenodes.h:2451
NodeTag type
Definition: parsenodes.h:279
Query * subquery
Definition: parsenodes.h:810
List * groupClause
Definition: parsenodes.h:137
char * indexname
Definition: parsenodes.h:1846
bool is_from
Definition: parsenodes.h:1694
ViewCheckOption
Definition: parsenodes.h:2720
DropBehavior behavior
Definition: parsenodes.h:2535
bool hasSubLinks
Definition: parsenodes.h:119
#define PG_INT32_MAX
Definition: c.h:337
NodeTag type
Definition: parsenodes.h:790
struct AlterTableStmt AlterTableStmt
RangeVar * relation
Definition: parsenodes.h:1459
struct AlterFunctionStmt AlterFunctionStmt
Node * havingClause
Definition: parsenodes.h:1293
Node * newowner
Definition: parsenodes.h:1544
struct CollateClause CollateClause
List * arguments
Definition: parsenodes.h:2315
struct CreateOpClassItem CreateOpClassItem
Bitmapset * insertedCols
Definition: parsenodes.h:871
bool hasForUpdate
Definition: parsenodes.h:123
int inhcount
Definition: parsenodes.h:591
RangeVar * relation
Definition: parsenodes.h:2095
TypeName * targettype
Definition: parsenodes.h:2988
char * name
Definition: parsenodes.h:3029
NodeTag type
Definition: parsenodes.h:2526
List * funccoltypes
Definition: parsenodes.h:900
struct AlterOwnerStmt AlterOwnerStmt
struct DiscardStmt DiscardStmt
bool hasModifyingCTE
Definition: parsenodes.h:122
ConstrType contype
Definition: parsenodes.h:1825
Node * expr
Definition: parsenodes.h:695
DefElemAction
Definition: parsenodes.h:654
RangeVar * relation
Definition: parsenodes.h:2576
Node * uidx
Definition: parsenodes.h:366
const char * name
Definition: parsenodes.h:2962
List * collation
Definition: parsenodes.h:638
struct InsertStmt InsertStmt
char * filename
Definition: parsenodes.h:1696
GroupingSetKind
Definition: parsenodes.h:1062
char * source_text
Definition: parsenodes.h:2515
NodeTag type
Definition: parsenodes.h:2922
struct AlterDefaultPrivilegesStmt AlterDefaultPrivilegesStmt
List * params
Definition: parsenodes.h:3030
DropBehavior behavior
Definition: parsenodes.h:1547
char * defname
Definition: parsenodes.h:666
char * colname
Definition: parsenodes.h:589
WithClause * withClause
Definition: parsenodes.h:1314
List * grantee_roles
Definition: parsenodes.h:1660
List * funcname
Definition: parsenodes.h:1629
ViewCheckOption withCheckOption
Definition: parsenodes.h:2735
struct AlterDatabaseStmt AlterDatabaseStmt
List * definition
Definition: parsenodes.h:2233
List * grantees
Definition: parsenodes.h:1616
struct CreateTrigStmt CreateTrigStmt
Node * query
Definition: parsenodes.h:2732
char * cooked_expr
Definition: parsenodes.h:1836
List * funcname
Definition: parsenodes.h:332
FunctionParameterMode mode
Definition: parsenodes.h:2489
Alias * eref
Definition: parsenodes.h:864
NodeTag type
Definition: parsenodes.h:190
List * ctecolcollations
Definition: parsenodes.h:1195
struct ExplainStmt ExplainStmt
Node * node
Definition: parsenodes.h:451
bool agg_within_group
Definition: parsenodes.h:336
char * refname
Definition: parsenodes.h:470
struct CreateTableAsStmt CreateTableAsStmt
Node * havingQual
Definition: parsenodes.h:141
RangeVar * relation
Definition: parsenodes.h:2603
GrantTargetType targtype
Definition: parsenodes.h:1610
bool agg_distinct
Definition: parsenodes.h:338
RangeVar * pktable
Definition: parsenodes.h:1853
RangeVar * relation
Definition: parsenodes.h:2805
struct RefreshMatViewStmt RefreshMatViewStmt
struct CreateAmStmt CreateAmStmt
Value val
Definition: parsenodes.h:270
bool agg_star
Definition: parsenodes.h:337
List * object
Definition: parsenodes.h:2530
OnConflictAction action
Definition: parsenodes.h:1167
Definition: pg_list.h:45
NodeTag type
Definition: parsenodes.h:1688
struct AlterUserMappingStmt AlterUserMappingStmt
struct CreateUserMappingStmt CreateUserMappingStmt
struct DropdbStmt DropdbStmt
NodeTag type
Definition: parsenodes.h:2639
struct TableSampleClause * tablesample
Definition: parsenodes.h:805
OnConflictAction
Definition: nodes.h:753
bool skip_validation
Definition: parsenodes.h:1863
DropBehavior behavior
Definition: parsenodes.h:1664
struct DefElem DefElem
NodeTag type
Definition: parsenodes.h:363
LockWaitPolicy waitPolicy
Definition: parsenodes.h:685
LockWaitPolicy
Definition: lockoptions.h:36
char * access_method
Definition: parsenodes.h:1849
bool oldstyle
Definition: parsenodes.h:2230
CmdType
Definition: nodes.h:604
char * dbname
Definition: parsenodes.h:2784
List * fk_attrs
Definition: parsenodes.h:1854
int location
Definition: parsenodes.h:455
List * aliascolnames
Definition: parsenodes.h:1184
ObjectType relationType
Definition: parsenodes.h:2528
TypeName * ofTypename
Definition: parsenodes.h:1754
char * priv_name
Definition: parsenodes.h:1643
char fk_upd_action
Definition: parsenodes.h:1857
NodeTag type
Definition: parsenodes.h:634
char * indexspace
Definition: parsenodes.h:1847
WithClause * withClause
Definition: parsenodes.h:1255
DiscardMode
Definition: parsenodes.h:2902
Node * limitCount
Definition: parsenodes.h:1312
struct GroupingSet GroupingSet
List * fields
Definition: parsenodes.h:217
struct A_Const A_Const
Node * whereClause
Definition: parsenodes.h:1291
List * options
Definition: parsenodes.h:2209
struct CreateSeqStmt CreateSeqStmt
bool hasRowSecurity
Definition: parsenodes.h:124
List * func_options
Definition: parsenodes.h:1946
struct DefineStmt DefineStmt
FetchDirection direction
Definition: parsenodes.h:2418
struct ConstraintsSetStmt ConstraintsSetStmt
char * payload
Definition: parsenodes.h:2620
TransactionStmtKind kind
Definition: parsenodes.h:2664
bool pct_type
Definition: parsenodes.h:194
List * ctes
Definition: parsenodes.h:1138
Node * arg
Definition: parsenodes.h:280
ImportForeignSchemaType list_type
Definition: parsenodes.h:2041
NodeTag type
Definition: parsenodes.h:396
NodeTag type
Definition: parsenodes.h:352
NodeTag type
Definition: parsenodes.h:1608
char * conditionname
Definition: parsenodes.h:2640