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