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