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