Thanks to visit codestin.com
Credit goes to doxygen.postgresql.org

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