1 /*-------------------------------------------------------------------------
4 * definitions for parse tree nodes
7 * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.272 2005/01/27 03:18:42 tgl Exp $
12 *-------------------------------------------------------------------------
17 #include "nodes/primnodes.h"
20 /* Possible sources of a Query */
21 typedef enum QuerySource
23 QSRC_ORIGINAL, /* original parsetree (explicit query) */
24 QSRC_PARSER, /* added by parse analysis */
25 QSRC_INSTEAD_RULE, /* added by unconditional INSTEAD rule */
26 QSRC_QUAL_INSTEAD_RULE, /* added by conditional INSTEAD rule */
27 QSRC_NON_INSTEAD_RULE /* added by non-INSTEAD rule */
31 * Grantable rights are encoded so that we can OR them together in a bitmask.
32 * The present representation of AclItem limits us to 15 distinct rights,
33 * even though AclMode is defined as uint32. See utils/acl.h.
35 * Caution: changing these codes breaks stored ACLs, hence forces initdb.
37 typedef uint32 AclMode; /* a bitmask of privilege bits */
39 #define ACL_INSERT (1<<0) /* for relations */
40 #define ACL_SELECT (1<<1)
41 #define ACL_UPDATE (1<<2)
42 #define ACL_DELETE (1<<3)
43 #define ACL_RULE (1<<4)
44 #define ACL_REFERENCES (1<<5)
45 #define ACL_TRIGGER (1<<6)
46 #define ACL_EXECUTE (1<<7) /* for functions */
47 #define ACL_USAGE (1<<8) /* for languages and namespaces */
48 #define ACL_CREATE (1<<9) /* for namespaces and databases */
49 #define ACL_CREATE_TEMP (1<<10) /* for databases */
50 #define N_ACL_RIGHTS 11 /* 1 plus the last 1<<x */
51 #define ACL_ALL_RIGHTS (-1) /* all-privileges marker in GRANT list */
52 #define ACL_NO_RIGHTS 0
53 /* Currently, SELECT ... FOR UPDATE requires UPDATE privileges */
54 #define ACL_SELECT_FOR_UPDATE ACL_UPDATE
57 /*****************************************************************************
59 *****************************************************************************/
63 * all statements are turned into a Query tree (via transformStmt)
64 * for further processing by the optimizer
65 * utility statements (i.e. non-optimizable statements)
66 * have the *utilityStmt field set.
72 CmdType commandType; /* select|insert|update|delete|utility */
74 QuerySource querySource; /* where did I come from? */
76 bool canSetTag; /* do I set the command result tag? */
78 Node *utilityStmt; /* non-null if this is a non-optimizable
81 int resultRelation; /* target relation (index into rtable) */
83 RangeVar *into; /* target relation for SELECT INTO */
84 bool intoHasOids; /* should target relation contain OIDs? */
86 bool hasAggs; /* has aggregates in tlist or havingQual */
87 bool hasSubLinks; /* has subquery SubLink */
89 List *rtable; /* list of range table entries */
90 FromExpr *jointree; /* table join tree (FROM and WHERE
93 List *rowMarks; /* integer list of RT indexes of relations
94 * that are selected FOR UPDATE */
96 List *targetList; /* target list (of TargetEntry) */
98 List *groupClause; /* a list of GroupClause's */
100 Node *havingQual; /* qualifications applied to groups */
102 List *distinctClause; /* a list of SortClause's */
104 List *sortClause; /* a list of SortClause's */
106 Node *limitOffset; /* # of result tuples to skip */
107 Node *limitCount; /* # of result tuples to return */
109 Node *setOperations; /* set-operation tree if this is top level
110 * of a UNION/INTERSECT/EXCEPT query */
113 * If the resultRelation turns out to be the parent of an inheritance
114 * tree, the planner will add all the child tables to the rtable and
115 * store a list of the rtindexes of all the result relations here.
116 * This is done at plan time, not parse time, since we don't want to
117 * commit to the exact set of child tables at parse time. This field
118 * ought to go in some sort of TopPlan plan node, not in the Query.
120 List *resultRelations; /* integer list of RT indexes, or NIL */
122 /* internal to planner */
123 List *base_rel_list; /* list of base-relation RelOptInfos */
124 List *other_rel_list; /* list of other 1-relation RelOptInfos */
125 List *join_rel_list; /* list of join-relation RelOptInfos */
126 List *equi_key_list; /* list of lists of equijoined
128 List *in_info_list; /* list of InClauseInfos */
129 List *query_pathkeys; /* desired pathkeys for query_planner() */
130 bool hasJoinRTEs; /* true if any RTEs are RTE_JOIN kind */
134 /****************************************************************************
135 * Supporting data structures for Parse Trees
137 * Most of these node types appear in raw parsetrees output by the grammar,
138 * and get transformed to something else by the analyzer. A few of them
139 * are used as-is in transformed querytrees.
140 ****************************************************************************/
143 * TypeName - specifies a type in definitions
145 * For TypeName structures generated internally, it is often easier to
146 * specify the type by OID than by name. If "names" is NIL then the
147 * actual type OID is given by typeid, otherwise typeid is unused.
149 * If pct_type is TRUE, then names is actually a field name and we look up
150 * the type of that field. Otherwise (the normal case), names is a type
151 * name possibly qualified with schema and database name.
153 typedef struct TypeName
156 List *names; /* qualified name (list of Value strings) */
157 Oid typeid; /* type identified by OID */
158 bool timezone; /* timezone specified? */
159 bool setof; /* is a set? */
160 bool pct_type; /* %TYPE specified? */
161 int32 typmod; /* type modifier */
162 List *arrayBounds; /* array bounds */
166 * ColumnRef - specifies a reference to a column, or possibly a whole tuple
168 * The "fields" list must be nonempty; its last component may be "*"
169 * instead of a regular field name.
171 * Note: any array subscripting or selection of fields from composite columns
172 * is represented by an A_Indirection node above the ColumnRef. However,
173 * for simplicity in the normal case, initial field selection from a table
174 * name is represented within ColumnRef and not by adding A_Indirection.
176 typedef struct ColumnRef
179 List *fields; /* field names (list of Value strings) */
183 * ParamRef - specifies a $n parameter reference
185 typedef struct ParamRef
188 int number; /* the number of the parameter */
192 * A_Expr - infix, prefix, and postfix expressions
194 typedef enum A_Expr_Kind
196 AEXPR_OP, /* normal operator */
197 AEXPR_AND, /* booleans - name field is unused */
200 AEXPR_OP_ANY, /* scalar op ANY (array) */
201 AEXPR_OP_ALL, /* scalar op ALL (array) */
202 AEXPR_DISTINCT, /* IS DISTINCT FROM - name must be "=" */
203 AEXPR_NULLIF, /* NULLIF - name must be "=" */
204 AEXPR_OF /* IS (not) OF - name must be "=" or "!=" */
207 typedef struct A_Expr
210 A_Expr_Kind kind; /* see above */
211 List *name; /* possibly-qualified name of operator */
212 Node *lexpr; /* left argument, or NULL if none */
213 Node *rexpr; /* right argument, or NULL if none */
217 * A_Const - a constant expression
219 typedef struct A_Const
222 Value val; /* the value (with the tag) */
223 TypeName *typename; /* typecast */
227 * TypeCast - a CAST expression
229 * NOTE: for mostly historical reasons, A_Const parsenodes contain
230 * room for a TypeName; we only generate a separate TypeCast node if the
231 * argument to be casted is not a constant. In theory either representation
232 * would work, but it is convenient to have the target type immediately
233 * available while resolving a constant's datatype.
235 typedef struct TypeCast
238 Node *arg; /* the expression being casted */
239 TypeName *typename; /* the target type */
243 * FuncCall - a function or aggregate invocation
245 * agg_star indicates we saw a 'foo(*)' construct, while agg_distinct
246 * indicates we saw 'foo(DISTINCT ...)'. In either case, the construct
247 * *must* be an aggregate call. Otherwise, it might be either an
248 * aggregate or some other kind of function.
250 typedef struct FuncCall
253 List *funcname; /* qualified name of function */
254 List *args; /* the arguments (list of exprs) */
255 bool agg_star; /* argument was really '*' */
256 bool agg_distinct; /* arguments were labeled DISTINCT */
260 * A_Indices - array reference or bounds ([lidx:uidx] or [uidx])
262 typedef struct A_Indices
265 Node *lidx; /* could be NULL */
270 * A_Indirection - select a field and/or array element from an expression
272 * The indirection list can contain both A_Indices nodes (representing
273 * subscripting) and string Value nodes (representing field selection
274 * --- the string value is the name of the field to select). For example,
275 * a complex selection operation like
276 * (foo).field1[42][7].field2
277 * would be represented with a single A_Indirection node having a 4-element
280 * Note: as of Postgres 8.0, we don't support arrays of composite values,
281 * so cases in which a field select follows a subscript aren't actually
282 * semantically legal. However the parser is prepared to handle such.
284 typedef struct A_Indirection
287 Node *arg; /* the thing being selected from */
288 List *indirection; /* subscripts and/or field names */
293 * result target (used in target list of pre-transformed parse trees)
295 * In a SELECT or INSERT target list, 'name' is the column label from an
296 * 'AS ColumnLabel' clause, or NULL if there was none, and 'val' is the
297 * value expression itself. The 'indirection' field is not used.
299 * INSERT has a second ResTarget list which is the target-column-names list.
300 * Here, 'val' is not used, 'name' is the name of the destination column,
301 * and 'indirection' stores any subscripts attached to the destination.
303 * In an UPDATE target list, 'name' is the name of the destination column,
304 * 'indirection' stores any subscripts attached to the destination, and
305 * 'val' is the expression to assign.
307 * See A_Indirection for more info about what can appear in 'indirection'.
309 typedef struct ResTarget
312 char *name; /* column name or NULL */
313 List *indirection; /* subscripts and field names, or NIL */
314 Node *val; /* the value expression to compute or
319 * SortBy - for ORDER BY clause
322 #define SORTBY_DESC 2
323 #define SORTBY_USING 3
325 typedef struct SortBy
328 int sortby_kind; /* see codes above */
329 List *useOp; /* name of op to use, if SORTBY_USING */
330 Node *node; /* expression to sort on */
334 * RangeSubselect - subquery appearing in a FROM clause
336 typedef struct RangeSubselect
339 Node *subquery; /* the untransformed sub-select clause */
340 Alias *alias; /* table alias & optional column aliases */
344 * RangeFunction - function call appearing in a FROM clause
346 typedef struct RangeFunction
349 Node *funccallnode; /* untransformed function call tree */
350 Alias *alias; /* table alias & optional column aliases */
351 List *coldeflist; /* list of ColumnDef nodes for runtime
352 * assignment of RECORD TupleDesc */
356 * ColumnDef - column definition (used in various creates)
358 * If the column has a default value, we may have the value expression
359 * in either "raw" form (an untransformed parse tree) or "cooked" form
360 * (the nodeToString representation of an executable expression tree),
361 * depending on how this ColumnDef node was created (by parsing, or by
362 * inheritance from an existing relation). We should never have both
365 * The constraints list may contain a CONSTR_DEFAULT item in a raw
366 * parsetree produced by gram.y, but transformCreateStmt will remove
367 * the item and set raw_default instead. CONSTR_DEFAULT items
368 * should not appear in any subsequent processing.
370 * The "support" field, if not null, denotes a supporting relation that
371 * should be linked by an internal dependency to the column. Currently
372 * this is only used to link a SERIAL column's sequence to the column.
374 typedef struct ColumnDef
377 char *colname; /* name of column */
378 TypeName *typename; /* type of column */
379 int inhcount; /* number of times column is inherited */
380 bool is_local; /* column has local (non-inherited) def'n */
381 bool is_not_null; /* NOT NULL constraint specified? */
382 Node *raw_default; /* default value (untransformed parse
384 char *cooked_default; /* nodeToString representation */
385 List *constraints; /* other constraints on column */
386 RangeVar *support; /* supporting relation, if any */
390 * inhRelation - Relations a CREATE TABLE is to inherit attributes of
392 typedef struct InhRelation
396 bool including_defaults;
400 * IndexElem - index parameters (used in CREATE INDEX)
402 * For a plain index attribute, 'name' is the name of the table column to
403 * index, and 'expr' is NULL. For an index expression, 'name' is NULL and
404 * 'expr' is the expression tree.
406 typedef struct IndexElem
409 char *name; /* name of attribute to index, or NULL */
410 Node *expr; /* expression to index, or NULL */
411 List *opclass; /* name of desired opclass; NIL = default */
416 * a definition (used in definition lists in the form of defname = arg)
418 typedef struct DefElem
422 Node *arg; /* a (Value *) or a (TypeName *) */
426 /****************************************************************************
427 * Nodes for a Query tree
428 ****************************************************************************/
430 /*--------------------
432 * A range table is a List of RangeTblEntry nodes.
434 * A range table entry may represent a plain relation, a sub-select in
435 * FROM, or the result of a JOIN clause. (Only explicit JOIN syntax
436 * produces an RTE, not the implicit join resulting from multiple FROM
437 * items. This is because we only need the RTE to deal with SQL features
438 * like outer joins and join-output-column aliasing.) Other special
439 * RTE types also exist, as indicated by RTEKind.
441 * alias is an Alias node representing the AS alias-clause attached to the
442 * FROM expression, or NULL if no clause.
444 * eref is the table reference name and column reference names (either
445 * real or aliases). Note that system columns (OID etc) are not included
446 * in the column list.
447 * eref->aliasname is required to be present, and should generally be used
448 * to identify the RTE for error messages etc.
450 * In RELATION RTEs, the colnames in both alias and eref are indexed by
451 * physical attribute number; this means there must be colname entries for
452 * dropped columns. When building an RTE we insert empty strings ("") for
453 * dropped columns. Note however that a stored rule may have nonempty
454 * colnames for columns dropped since the rule was created (and for that
455 * matter the colnames might be out of date due to column renamings).
456 * The same comments apply to FUNCTION RTEs when the function's return type
457 * is a named composite type.
459 * In JOIN RTEs, the colnames in both alias and eref are one-to-one with
460 * joinaliasvars entries. A JOIN RTE will omit columns of its inputs when
461 * those columns are known to be dropped at parse time. Again, however,
462 * a stored rule might contain entries for columns dropped since the rule
463 * was created. (This is only possible for columns not actually referenced
466 * inh is TRUE for relation references that should be expanded to include
467 * inheritance children, if the rel has any. This *must* be FALSE for
468 * RTEs other than RTE_RELATION entries.
470 * inFromCl marks those range variables that are listed in the FROM clause.
471 * In SQL, the query can only refer to range variables listed in the
472 * FROM clause, but POSTQUEL allows you to refer to tables not listed,
473 * in which case a range table entry will be generated. We still support
474 * this POSTQUEL feature, although there is some doubt whether it's
475 * convenient or merely confusing. The flag is needed since an
476 * implicitly-added RTE shouldn't change the namespace for unqualified
477 * column names processed later, and it also shouldn't affect the
480 * requiredPerms and checkAsUser specify run-time access permissions
481 * checks to be performed at query startup. The user must have *all*
482 * of the permissions that are OR'd together in requiredPerms (zero
483 * indicates no permissions checking). If checkAsUser is not zero,
484 * then do the permissions checks using the access rights of that user,
485 * not the current effective user ID. (This allows rules to act as
487 *--------------------
491 RTE_RELATION, /* ordinary relation reference */
492 RTE_SUBQUERY, /* subquery in FROM */
494 RTE_SPECIAL, /* special rule relation (NEW or OLD) */
495 RTE_FUNCTION /* function in FROM */
498 typedef struct RangeTblEntry
502 RTEKind rtekind; /* see above */
505 * XXX the fields applicable to only some rte kinds should be merged
506 * into a union. I didn't do this yet because the diffs would impact
507 * a lot of code that is being actively worked on. FIXME later.
511 * Fields valid for a plain relation RTE (else zero):
513 Oid relid; /* OID of the relation */
516 * Fields valid for a subquery RTE (else NULL):
518 Query *subquery; /* the sub-query */
521 * Fields valid for a function RTE (else NULL):
523 Node *funcexpr; /* expression tree for func call */
524 List *coldeflist; /* list of ColumnDef nodes for runtime
525 * assignment of RECORD TupleDesc */
528 * Fields valid for a join RTE (else NULL/zero):
530 * joinaliasvars is a list of Vars or COALESCE expressions corresponding
531 * to the columns of the join result. An alias Var referencing column
532 * K of the join result can be replaced by the K'th element of
533 * joinaliasvars --- but to simplify the task of reverse-listing
534 * aliases correctly, we do not do that until planning time.
536 JoinType jointype; /* type of join */
537 List *joinaliasvars; /* list of alias-var expansions */
540 * Fields valid in all RTEs:
542 Alias *alias; /* user-written alias clause, if any */
543 Alias *eref; /* expanded reference names */
544 bool inh; /* inheritance requested? */
545 bool inFromCl; /* present in FROM clause */
546 AclMode requiredPerms; /* bitmask of required access permissions */
547 AclId checkAsUser; /* if not zero, check access as this user */
552 * representation of ORDER BY clauses
554 * tleSortGroupRef must match ressortgroupref of exactly one Resdom of the
555 * associated targetlist; that is the expression to be sorted (or grouped) by.
556 * sortop is the OID of the ordering operator.
558 * SortClauses are also used to identify Resdoms that we will do a "Unique"
559 * filter step on (for SELECT DISTINCT and SELECT DISTINCT ON). The
560 * distinctClause list is simply a copy of the relevant members of the
561 * sortClause list. Note that distinctClause can be a subset of sortClause,
562 * but cannot have members not present in sortClause; and the members that
563 * do appear must be in the same order as in sortClause.
565 typedef struct SortClause
568 Index tleSortGroupRef; /* reference into targetlist */
569 Oid sortop; /* the sort operator to use */
574 * representation of GROUP BY clauses
576 * GroupClause is exactly like SortClause except for the nodetag value
577 * (it's probably not even really necessary to have two different
578 * nodetags...). We have routines that operate interchangeably on both.
580 typedef SortClause GroupClause;
583 /*****************************************************************************
584 * Optimizable Statements
585 *****************************************************************************/
587 /* ----------------------
589 * ----------------------
591 typedef struct InsertStmt
594 RangeVar *relation; /* relation to insert into */
595 List *cols; /* optional: names of the target columns */
598 * An INSERT statement has *either* VALUES or SELECT, never both. If
599 * VALUES, a targetList is supplied (empty for DEFAULT VALUES). If
600 * SELECT, a complete SelectStmt (or set-operation tree) is supplied.
602 List *targetList; /* the target list (of ResTarget) */
603 Node *selectStmt; /* the source SELECT */
606 /* ----------------------
608 * ----------------------
610 typedef struct DeleteStmt
613 RangeVar *relation; /* relation to delete from */
614 Node *whereClause; /* qualifications */
617 /* ----------------------
619 * ----------------------
621 typedef struct UpdateStmt
624 RangeVar *relation; /* relation to update */
625 List *targetList; /* the target list (of ResTarget) */
626 Node *whereClause; /* qualifications */
627 List *fromClause; /* optional from clause for more tables */
630 /* ----------------------
633 * A "simple" SELECT is represented in the output of gram.y by a single
634 * SelectStmt node. A SELECT construct containing set operators (UNION,
635 * INTERSECT, EXCEPT) is represented by a tree of SelectStmt nodes, in
636 * which the leaf nodes are component SELECTs and the internal nodes
637 * represent UNION, INTERSECT, or EXCEPT operators. Using the same node
638 * type for both leaf and internal nodes allows gram.y to stick ORDER BY,
639 * LIMIT, etc, clause values into a SELECT statement without worrying
640 * whether it is a simple or compound SELECT.
641 * ----------------------
643 typedef enum SetOperation
651 typedef enum ContainsOids
653 MUST_HAVE_OIDS, /* WITH OIDS explicitely specified */
654 MUST_NOT_HAVE_OIDS, /* WITHOUT OIDS explicitely specified */
655 DEFAULT_OIDS /* neither specified; use the default,
656 * which is the value of the
657 * default_with_oids GUC var */
660 typedef struct SelectStmt
665 * These fields are used only in "leaf" SelectStmts.
667 * into, intoColNames and intoHasOids are a kluge; they belong somewhere
670 List *distinctClause; /* NULL, list of DISTINCT ON exprs, or
671 * lcons(NIL,NIL) for all (SELECT
673 RangeVar *into; /* target table (for select into table) */
674 List *intoColNames; /* column names for into table */
675 ContainsOids intoHasOids; /* should target table have OIDs? */
676 List *targetList; /* the target list (of ResTarget) */
677 List *fromClause; /* the FROM clause */
678 Node *whereClause; /* WHERE qualification */
679 List *groupClause; /* GROUP BY clauses */
680 Node *havingClause; /* HAVING conditional-expression */
683 * These fields are used in both "leaf" SelectStmts and upper-level
686 List *sortClause; /* sort clause (a list of SortBy's) */
687 Node *limitOffset; /* # of result tuples to skip */
688 Node *limitCount; /* # of result tuples to return */
689 List *forUpdate; /* FOR UPDATE clause */
692 * These fields are used only in upper-level SelectStmts.
694 SetOperation op; /* type of set op */
695 bool all; /* ALL specified? */
696 struct SelectStmt *larg; /* left child */
697 struct SelectStmt *rarg; /* right child */
698 /* Eventually add fields for CORRESPONDING spec here */
701 /* ----------------------
702 * Set Operation node for post-analysis query trees
704 * After parse analysis, a SELECT with set operations is represented by a
705 * top-level Query node containing the leaf SELECTs as subqueries in its
706 * range table. Its setOperations field shows the tree of set operations,
707 * with leaf SelectStmt nodes replaced by RangeTblRef nodes, and internal
708 * nodes replaced by SetOperationStmt nodes.
709 * ----------------------
711 typedef struct SetOperationStmt
714 SetOperation op; /* type of set op */
715 bool all; /* ALL specified? */
716 Node *larg; /* left child */
717 Node *rarg; /* right child */
718 /* Eventually add fields for CORRESPONDING spec here */
720 /* Fields derived during parse analysis: */
721 List *colTypes; /* list of OIDs of output column types */
725 /*****************************************************************************
726 * Other Statements (no optimizations required)
728 * Some of them require a little bit of transformation (which is also
729 * done by transformStmt). The whole structure is then passed on to
730 * ProcessUtility (by-passing the optimization step) as the utilityStmt
732 *****************************************************************************/
735 * When a command can act on several kinds of objects with only one
736 * parse structure required, use these constants to designate the
740 typedef enum ObjectType
767 /* ----------------------
768 * Create Schema Statement
770 * NOTE: the schemaElts list contains raw parsetrees for component statements
771 * of the schema, such as CREATE TABLE, GRANT, etc. These are analyzed and
772 * executed after the schema itself is created.
773 * ----------------------
775 typedef struct CreateSchemaStmt
778 char *schemaname; /* the name of the schema to create */
779 char *authid; /* the owner of the created schema */
780 List *schemaElts; /* schema components (list of parsenodes) */
783 typedef enum DropBehavior
785 DROP_RESTRICT, /* drop fails if any dependent objects */
786 DROP_CASCADE /* remove dependent objects too */
789 /* ----------------------
791 * ----------------------
793 typedef struct AlterTableStmt
796 RangeVar *relation; /* table to work on */
797 List *cmds; /* list of subcommands */
798 ObjectType relkind; /* type of object */
801 typedef enum AlterTableType
803 AT_AddColumn, /* add column */
804 AT_ColumnDefault, /* alter column default */
805 AT_DropNotNull, /* alter column drop not null */
806 AT_SetNotNull, /* alter column set not null */
807 AT_SetStatistics, /* alter column statistics */
808 AT_SetStorage, /* alter column storage */
809 AT_DropColumn, /* drop column */
810 AT_DropColumnRecurse, /* internal to commands/tablecmds.c */
811 AT_AddIndex, /* add index */
812 AT_ReAddIndex, /* internal to commands/tablecmds.c */
813 AT_AddConstraint, /* add constraint */
814 AT_ProcessedConstraint, /* pre-processed add constraint (local in
815 * parser/analyze.c) */
816 AT_DropConstraint, /* drop constraint */
817 AT_DropConstraintQuietly, /* drop constraint, no error/warning
818 * (local in commands/tablecmds.c) */
819 AT_AlterColumnType, /* alter column type */
820 AT_ToastTable, /* create toast table */
821 AT_ChangeOwner, /* change owner */
822 AT_ClusterOn, /* CLUSTER ON */
823 AT_DropCluster, /* SET WITHOUT CLUSTER */
824 AT_DropOids, /* SET WITHOUT OIDS */
825 AT_SetTableSpace /* SET TABLESPACE */
828 typedef struct AlterTableCmd /* one subcommand of an ALTER TABLE */
831 AlterTableType subtype; /* Type of table alteration to apply */
832 char *name; /* column or constraint name to act on, or
833 * new owner or tablespace */
834 Node *def; /* definition of new column, column type,
835 * index, or constraint */
836 Node *transform; /* transformation expr for ALTER TYPE */
837 DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */
841 /* ----------------------
844 * The fields are used in different ways by the different variants of
846 * ----------------------
848 typedef struct AlterDomainStmt
851 char subtype; /*------------
852 * T = alter column default
853 * N = alter column drop not null
854 * O = alter column set not null
856 * X = drop constraint
859 List *typename; /* domain to work on */
860 char *name; /* column or constraint name to act on */
861 Node *def; /* definition of default or constraint */
862 DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */
866 /* ----------------------
867 * Grant|Revoke Statement
868 * ----------------------
870 typedef enum GrantObjectType
872 ACL_OBJECT_RELATION, /* table, view, sequence */
873 ACL_OBJECT_DATABASE, /* database */
874 ACL_OBJECT_FUNCTION, /* function */
875 ACL_OBJECT_LANGUAGE, /* procedural language */
876 ACL_OBJECT_NAMESPACE, /* namespace */
877 ACL_OBJECT_TABLESPACE /* tablespace */
880 typedef struct GrantStmt
883 bool is_grant; /* true = GRANT, false = REVOKE */
884 GrantObjectType objtype; /* kind of object being operated on */
885 List *objects; /* list of RangeVar nodes, FuncWithArgs
886 * nodes, or plain names (as Value
888 List *privileges; /* integer list of privilege codes */
889 List *grantees; /* list of PrivGrantee nodes */
890 bool grant_option; /* grant or revoke grant option */
891 DropBehavior behavior; /* drop behavior (for REVOKE) */
894 typedef struct PrivGrantee
897 char *username; /* if both are NULL then PUBLIC */
901 typedef struct FuncWithArgs
904 List *funcname; /* qualified name of function */
905 List *funcargs; /* list of Typename nodes */
908 /* This is only used internally in gram.y. */
909 typedef struct PrivTarget
912 GrantObjectType objtype;
916 /* ----------------------
918 * ----------------------
920 typedef struct CopyStmt
923 RangeVar *relation; /* the relation to copy */
924 List *attlist; /* List of column names (as Strings), or
925 * NIL for all columns */
926 bool is_from; /* TO or FROM */
927 char *filename; /* if NULL, use stdin/stdout */
928 List *options; /* List of DefElem nodes */
931 /* ----------------------
932 * Create Table Statement
934 * NOTE: in the raw gram.y output, ColumnDef, Constraint, and FkConstraint
935 * nodes are intermixed in tableElts, and constraints is NIL. After parse
936 * analysis, tableElts contains just ColumnDefs, and constraints contains
937 * just Constraint nodes (in fact, only CONSTR_CHECK nodes, in the present
939 * ----------------------
942 /* What to do at commit time for temporary relations */
943 typedef enum OnCommitAction
945 ONCOMMIT_NOOP, /* No ON COMMIT clause (do nothing) */
946 ONCOMMIT_PRESERVE_ROWS, /* ON COMMIT PRESERVE ROWS (do nothing) */
947 ONCOMMIT_DELETE_ROWS, /* ON COMMIT DELETE ROWS */
948 ONCOMMIT_DROP /* ON COMMIT DROP */
951 typedef struct CreateStmt
954 RangeVar *relation; /* relation to create */
955 List *tableElts; /* column definitions (list of ColumnDef) */
956 List *inhRelations; /* relations to inherit from (list of
958 List *constraints; /* constraints (list of Constraint nodes) */
959 ContainsOids hasoids; /* should it have OIDs? */
960 OnCommitAction oncommit; /* what do we do at COMMIT? */
961 char *tablespacename; /* table space to use, or NULL */
965 * Definitions for plain (non-FOREIGN KEY) constraints in CreateStmt
967 * XXX probably these ought to be unified with FkConstraints at some point?
968 * To this end we include CONSTR_FOREIGN in the ConstrType enum, even though
969 * the parser does not generate it.
971 * For constraints that use expressions (CONSTR_DEFAULT, CONSTR_CHECK)
972 * we may have the expression in either "raw" form (an untransformed
973 * parse tree) or "cooked" form (the nodeToString representation of
974 * an executable expression tree), depending on how this Constraint
975 * node was created (by parsing, or by inheritance from an existing
976 * relation). We should never have both in the same node!
978 * Constraint attributes (DEFERRABLE etc) are initially represented as
979 * separate Constraint nodes for simplicity of parsing. analyze.c makes
980 * a pass through the constraints list to attach the info to the appropriate
981 * FkConstraint node (and, perhaps, someday to other kinds of constraints).
985 typedef enum ConstrType /* types of constraints */
987 CONSTR_NULL, /* not SQL92, but a lot of people expect
995 CONSTR_ATTR_DEFERRABLE, /* attributes for previous constraint node */
996 CONSTR_ATTR_NOT_DEFERRABLE,
997 CONSTR_ATTR_DEFERRED,
998 CONSTR_ATTR_IMMEDIATE
1001 typedef struct Constraint
1005 char *name; /* name, or NULL if unnamed */
1006 Node *raw_expr; /* expr, as untransformed parse tree */
1007 char *cooked_expr; /* expr, as nodeToString representation */
1008 List *keys; /* String nodes naming referenced
1010 char *indexspace; /* index tablespace for PKEY/UNIQUE
1011 * constraints; NULL for default */
1015 * Definitions for FOREIGN KEY constraints in CreateStmt
1017 * Note: FKCONSTR_ACTION_xxx values are stored into pg_constraint.confupdtype
1018 * and pg_constraint.confdeltype columns; FKCONSTR_MATCH_xxx values are
1019 * stored into pg_constraint.confmatchtype. Changing the code values may
1020 * require an initdb!
1022 * If skip_validation is true then we skip checking that the existing rows
1023 * in the table satisfy the constraint, and just install the catalog entries
1024 * for the constraint. This is currently used only during CREATE TABLE
1025 * (when we know the table must be empty).
1028 #define FKCONSTR_ACTION_NOACTION 'a'
1029 #define FKCONSTR_ACTION_RESTRICT 'r'
1030 #define FKCONSTR_ACTION_CASCADE 'c'
1031 #define FKCONSTR_ACTION_SETNULL 'n'
1032 #define FKCONSTR_ACTION_SETDEFAULT 'd'
1034 #define FKCONSTR_MATCH_FULL 'f'
1035 #define FKCONSTR_MATCH_PARTIAL 'p'
1036 #define FKCONSTR_MATCH_UNSPECIFIED 'u'
1038 typedef struct FkConstraint
1041 char *constr_name; /* Constraint name, or NULL if unnamed */
1042 RangeVar *pktable; /* Primary key table */
1043 List *fk_attrs; /* Attributes of foreign key */
1044 List *pk_attrs; /* Corresponding attrs in PK table */
1045 char fk_matchtype; /* FULL, PARTIAL, UNSPECIFIED */
1046 char fk_upd_action; /* ON UPDATE action */
1047 char fk_del_action; /* ON DELETE action */
1048 bool deferrable; /* DEFERRABLE */
1049 bool initdeferred; /* INITIALLY DEFERRED */
1050 bool skip_validation; /* skip validation of existing rows? */
1054 /* ----------------------
1055 * Create/Drop Table Space Statements
1056 * ----------------------
1059 typedef struct CreateTableSpaceStmt
1062 char *tablespacename;
1065 } CreateTableSpaceStmt;
1067 typedef struct DropTableSpaceStmt
1070 char *tablespacename;
1071 } DropTableSpaceStmt;
1073 /* ----------------------
1074 * Create/Drop TRIGGER Statements
1075 * ----------------------
1078 typedef struct CreateTrigStmt
1081 char *trigname; /* TRIGGER's name */
1082 RangeVar *relation; /* relation trigger is on */
1083 List *funcname; /* qual. name of function to call */
1084 List *args; /* list of (T_String) Values or NIL */
1085 bool before; /* BEFORE/AFTER */
1086 bool row; /* ROW/STATEMENT */
1087 char actions[4]; /* 1 to 3 of 'i', 'u', 'd', + trailing \0 */
1089 /* The following are used for referential */
1090 /* integrity constraint triggers */
1091 bool isconstraint; /* This is an RI trigger */
1092 bool deferrable; /* [NOT] DEFERRABLE */
1093 bool initdeferred; /* INITIALLY {DEFERRED|IMMEDIATE} */
1094 RangeVar *constrrel; /* opposite relation */
1097 /* ----------------------
1098 * Create/Drop PROCEDURAL LANGUAGE Statement
1099 * ----------------------
1101 typedef struct CreatePLangStmt
1104 char *plname; /* PL name */
1105 List *plhandler; /* PL call handler function (qual. name) */
1106 List *plvalidator; /* optional validator function (qual.
1108 bool pltrusted; /* PL is trusted */
1111 typedef struct DropPLangStmt
1114 char *plname; /* PL name */
1115 DropBehavior behavior; /* RESTRICT or CASCADE behavior */
1118 /* ----------------------
1119 * Create/Alter/Drop User Statements
1120 * ----------------------
1122 typedef struct CreateUserStmt
1125 char *user; /* PostgreSQL user login name */
1126 List *options; /* List of DefElem nodes */
1129 typedef struct AlterUserStmt
1132 char *user; /* PostgreSQL user login name */
1133 List *options; /* List of DefElem nodes */
1136 typedef struct AlterUserSetStmt
1144 typedef struct DropUserStmt
1147 List *users; /* List of users to remove */
1150 /* ----------------------
1151 * Create/Alter/Drop Group Statements
1152 * ----------------------
1154 typedef struct CreateGroupStmt
1157 char *name; /* name of the new group */
1158 List *options; /* List of DefElem nodes */
1161 typedef struct AlterGroupStmt
1164 char *name; /* name of group to alter */
1165 int action; /* +1 = add, -1 = drop user */
1166 List *listUsers; /* list of users to add/drop */
1169 typedef struct DropGroupStmt
1175 /* ----------------------
1176 * {Create|Alter} SEQUENCE Statement
1177 * ----------------------
1180 typedef struct CreateSeqStmt
1183 RangeVar *sequence; /* the sequence to create */
1187 typedef struct AlterSeqStmt
1190 RangeVar *sequence; /* the sequence to alter */
1194 /* ----------------------
1195 * Create {Aggregate|Operator|Type} Statement
1196 * ----------------------
1198 typedef struct DefineStmt
1201 ObjectType kind; /* aggregate, operator, type */
1202 List *defnames; /* qualified name (list of Value strings) */
1203 List *definition; /* a list of DefElem */
1206 /* ----------------------
1207 * Create Domain Statement
1208 * ----------------------
1210 typedef struct CreateDomainStmt
1213 List *domainname; /* qualified name (list of Value strings) */
1214 TypeName *typename; /* the base type */
1215 List *constraints; /* constraints (list of Constraint nodes) */
1218 /* ----------------------
1219 * Create Operator Class Statement
1220 * ----------------------
1222 typedef struct CreateOpClassStmt
1225 List *opclassname; /* qualified name (list of Value strings) */
1226 char *amname; /* name of index AM opclass is for */
1227 TypeName *datatype; /* datatype of indexed column */
1228 List *items; /* List of CreateOpClassItem nodes */
1229 bool isDefault; /* Should be marked as default for type? */
1230 } CreateOpClassStmt;
1232 #define OPCLASS_ITEM_OPERATOR 1
1233 #define OPCLASS_ITEM_FUNCTION 2
1234 #define OPCLASS_ITEM_STORAGETYPE 3
1236 typedef struct CreateOpClassItem
1239 int itemtype; /* see codes above */
1240 /* fields used for an operator or function item: */
1241 List *name; /* operator or function name */
1242 List *args; /* argument types */
1243 int number; /* strategy num or support proc num */
1244 bool recheck; /* only used for operators */
1245 /* fields used for a storagetype item: */
1246 TypeName *storedtype; /* datatype stored in index */
1247 } CreateOpClassItem;
1249 /* ----------------------
1250 * Drop Table|Sequence|View|Index|Type|Domain|Conversion|Schema Statement
1251 * ----------------------
1254 typedef struct DropStmt
1257 List *objects; /* list of sublists of names (as Values) */
1258 ObjectType removeType; /* object type */
1259 DropBehavior behavior; /* RESTRICT or CASCADE behavior */
1262 /* ----------------------
1263 * Drop Rule|Trigger Statement
1265 * In general this may be used for dropping any property of a relation;
1266 * for example, someday soon we may have DROP ATTRIBUTE.
1267 * ----------------------
1270 typedef struct DropPropertyStmt
1273 RangeVar *relation; /* owning relation */
1274 char *property; /* name of rule, trigger, etc */
1275 ObjectType removeType; /* OBJECT_RULE or OBJECT_TRIGGER */
1276 DropBehavior behavior; /* RESTRICT or CASCADE behavior */
1279 /* ----------------------
1280 * Truncate Table Statement
1281 * ----------------------
1283 typedef struct TruncateStmt
1286 List *relations; /* relations (RangeVars) to be truncated */
1289 /* ----------------------
1290 * Comment On Statement
1291 * ----------------------
1293 typedef struct CommentStmt
1296 ObjectType objtype; /* Object's type */
1297 List *objname; /* Qualified name of the object */
1298 List *objargs; /* Arguments if needed (eg, for functions) */
1299 char *comment; /* Comment to insert, or NULL to remove */
1302 /* ----------------------
1303 * Declare Cursor Statement
1304 * ----------------------
1306 #define CURSOR_OPT_BINARY 0x0001
1307 #define CURSOR_OPT_SCROLL 0x0002
1308 #define CURSOR_OPT_NO_SCROLL 0x0004
1309 #define CURSOR_OPT_INSENSITIVE 0x0008
1310 #define CURSOR_OPT_HOLD 0x0010
1312 typedef struct DeclareCursorStmt
1315 char *portalname; /* name of the portal (cursor) */
1316 int options; /* bitmask of options (see above) */
1317 Node *query; /* the SELECT query */
1318 } DeclareCursorStmt;
1320 /* ----------------------
1321 * Close Portal Statement
1322 * ----------------------
1324 typedef struct ClosePortalStmt
1327 char *portalname; /* name of the portal (cursor) */
1330 /* ----------------------
1331 * Fetch Statement (also Move)
1332 * ----------------------
1334 typedef enum FetchDirection
1336 /* for these, howMany is how many rows to fetch; FETCH_ALL means ALL */
1339 /* for these, howMany indicates a position; only one row is fetched */
1344 #define FETCH_ALL LONG_MAX
1346 typedef struct FetchStmt
1349 FetchDirection direction; /* see above */
1350 long howMany; /* number of rows, or position argument */
1351 char *portalname; /* name of portal (cursor) */
1352 bool ismove; /* TRUE if MOVE */
1355 /* ----------------------
1356 * Create Index Statement
1357 * ----------------------
1359 typedef struct IndexStmt
1362 char *idxname; /* name of new index, or NULL for default */
1363 RangeVar *relation; /* relation to build index on */
1364 char *accessMethod; /* name of access method (eg. btree) */
1365 char *tableSpace; /* tablespace, or NULL to use parent's */
1366 List *indexParams; /* a list of IndexElem */
1367 Node *whereClause; /* qualification (partial-index predicate) */
1368 List *rangetable; /* range table for qual and/or
1369 * expressions, filled in by
1370 * transformStmt() */
1371 bool unique; /* is index unique? */
1372 bool primary; /* is index on primary key? */
1373 bool isconstraint; /* is it from a CONSTRAINT clause? */
1376 /* ----------------------
1377 * Create Function Statement
1378 * ----------------------
1380 typedef struct CreateFunctionStmt
1383 bool replace; /* T => replace if already exists */
1384 List *funcname; /* qualified name of function to create */
1385 List *parameters; /* a list of FunctionParameter */
1386 TypeName *returnType; /* the return type */
1387 List *options; /* a list of DefElem */
1388 List *withClause; /* a list of DefElem */
1389 } CreateFunctionStmt;
1391 typedef struct FunctionParameter
1394 char *name; /* parameter name, or NULL if not given */
1395 TypeName *argType; /* TypeName for parameter type */
1396 /* someday add IN/OUT/INOUT indicator here */
1397 } FunctionParameter;
1399 /* ----------------------
1400 * Drop Aggregate Statement
1401 * ----------------------
1403 typedef struct RemoveAggrStmt
1406 List *aggname; /* aggregate to drop */
1407 TypeName *aggtype; /* TypeName for input datatype, or NULL */
1408 DropBehavior behavior; /* RESTRICT or CASCADE behavior */
1411 /* ----------------------
1412 * Drop Function Statement
1413 * ----------------------
1415 typedef struct RemoveFuncStmt
1418 List *funcname; /* function to drop */
1419 List *args; /* types of the arguments */
1420 DropBehavior behavior; /* RESTRICT or CASCADE behavior */
1423 /* ----------------------
1424 * Drop Operator Statement
1425 * ----------------------
1427 typedef struct RemoveOperStmt
1430 List *opname; /* operator to drop */
1431 List *args; /* types of the arguments */
1432 DropBehavior behavior; /* RESTRICT or CASCADE behavior */
1435 /* ----------------------
1436 * Drop Operator Class Statement
1437 * ----------------------
1439 typedef struct RemoveOpClassStmt
1442 List *opclassname; /* qualified name (list of Value strings) */
1443 char *amname; /* name of index AM opclass is for */
1444 DropBehavior behavior; /* RESTRICT or CASCADE behavior */
1445 } RemoveOpClassStmt;
1447 /* ----------------------
1448 * Alter Object Rename Statement
1449 * ----------------------
1451 typedef struct RenameStmt
1454 RangeVar *relation; /* in case it's a table */
1455 List *object; /* in case it's some other object */
1456 List *objarg; /* argument types, if applicable */
1457 char *subname; /* name of contained object (column, rule,
1459 char *newname; /* the new name */
1460 ObjectType renameType; /* OBJECT_TABLE, OBJECT_COLUMN, etc */
1463 /* ----------------------
1464 * Alter Object Owner Statement
1465 * ----------------------
1467 typedef struct AlterOwnerStmt
1470 RangeVar *relation; /* in case it's a table */
1471 List *object; /* in case it's some other object */
1472 List *objarg; /* argument types, if applicable */
1473 char *addname; /* additional name if needed */
1474 char *newowner; /* the new owner */
1475 ObjectType objectType; /* OBJECT_TABLE, OBJECT_TYPE, etc */
1479 /* ----------------------
1480 * Create Rule Statement
1481 * ----------------------
1483 typedef struct RuleStmt
1486 RangeVar *relation; /* relation the rule is for */
1487 char *rulename; /* name of the rule */
1488 Node *whereClause; /* qualifications */
1489 CmdType event; /* SELECT, INSERT, etc */
1490 bool instead; /* is a 'do instead'? */
1491 List *actions; /* the action statements */
1492 bool replace; /* OR REPLACE */
1495 /* ----------------------
1497 * ----------------------
1499 typedef struct NotifyStmt
1502 RangeVar *relation; /* qualified name to notify */
1505 /* ----------------------
1507 * ----------------------
1509 typedef struct ListenStmt
1512 RangeVar *relation; /* qualified name to listen on */
1515 /* ----------------------
1516 * Unlisten Statement
1517 * ----------------------
1519 typedef struct UnlistenStmt
1522 RangeVar *relation; /* qualified name to unlisten on, or '*' */
1525 /* ----------------------
1526 * {Begin|Commit|Rollback} Transaction Statement
1527 * ----------------------
1529 typedef enum TransactionStmtKind
1532 TRANS_STMT_START, /* semantically identical to BEGIN */
1534 TRANS_STMT_ROLLBACK,
1535 TRANS_STMT_SAVEPOINT,
1537 TRANS_STMT_ROLLBACK_TO
1538 } TransactionStmtKind;
1540 typedef struct TransactionStmt
1543 TransactionStmtKind kind; /* see above */
1544 List *options; /* for BEGIN/START and savepoint commands */
1547 /* ----------------------
1548 * Create Type Statement, composite types
1549 * ----------------------
1551 typedef struct CompositeTypeStmt
1554 RangeVar *typevar; /* the composite type to be created */
1555 List *coldeflist; /* list of ColumnDef nodes */
1556 } CompositeTypeStmt;
1559 /* ----------------------
1560 * Create View Statement
1561 * ----------------------
1563 typedef struct ViewStmt
1566 RangeVar *view; /* the view to be created */
1567 List *aliases; /* target column names */
1568 Query *query; /* the SQL statement */
1569 bool replace; /* replace an existing view? */
1572 /* ----------------------
1574 * ----------------------
1576 typedef struct LoadStmt
1579 char *filename; /* file to load */
1582 /* ----------------------
1583 * Createdb Statement
1584 * ----------------------
1586 typedef struct CreatedbStmt
1589 char *dbname; /* name of database to create */
1590 List *options; /* List of DefElem nodes */
1593 /* ----------------------
1595 * ----------------------
1597 typedef struct AlterDatabaseSetStmt
1603 } AlterDatabaseSetStmt;
1605 /* ----------------------
1607 * ----------------------
1609 typedef struct DropdbStmt
1612 char *dbname; /* database to drop */
1615 /* ----------------------
1616 * Cluster Statement (support pbrown's cluster index implementation)
1617 * ----------------------
1619 typedef struct ClusterStmt
1622 RangeVar *relation; /* relation being indexed, or NULL if all */
1623 char *indexname; /* original index defined */
1626 /* ----------------------
1627 * Vacuum and Analyze Statements
1629 * Even though these are nominally two statements, it's convenient to use
1630 * just one node type for both.
1631 * ----------------------
1633 typedef struct VacuumStmt
1636 bool vacuum; /* do VACUUM step */
1637 bool full; /* do FULL (non-concurrent) vacuum */
1638 bool analyze; /* do ANALYZE step */
1639 bool freeze; /* early-freeze option */
1640 bool verbose; /* print progress info */
1641 RangeVar *relation; /* single table to process, or NULL */
1642 List *va_cols; /* list of column names, or NIL for all */
1645 /* ----------------------
1647 * ----------------------
1649 typedef struct ExplainStmt
1652 Query *query; /* the query */
1653 bool verbose; /* print plan info */
1654 bool analyze; /* get statistics by executing plan */
1657 /* ----------------------
1658 * Checkpoint Statement
1659 * ----------------------
1661 typedef struct CheckPointStmt
1666 /* ----------------------
1668 * ----------------------
1671 typedef struct VariableSetStmt
1676 bool is_local; /* SET LOCAL */
1679 /* ----------------------
1681 * ----------------------
1684 typedef struct VariableShowStmt
1690 /* ----------------------
1692 * ----------------------
1695 typedef struct VariableResetStmt
1699 } VariableResetStmt;
1701 /* ----------------------
1703 * ----------------------
1705 typedef struct LockStmt
1708 List *relations; /* relations to lock */
1709 int mode; /* lock mode */
1710 bool nowait; /* no wait mode */
1713 /* ----------------------
1714 * SET CONSTRAINTS Statement
1715 * ----------------------
1717 typedef struct ConstraintsSetStmt
1720 List *constraints; /* List of names as Value strings */
1722 } ConstraintsSetStmt;
1724 /* ----------------------
1726 * ----------------------
1728 typedef struct ReindexStmt
1731 ObjectType kind; /* OBJECT_INDEX, OBJECT_TABLE,
1732 * OBJECT_DATABASE */
1733 RangeVar *relation; /* Table or index to reindex */
1734 const char *name; /* name of database to reindex */
1739 /* ----------------------
1740 * CREATE CONVERSION Statement
1741 * ----------------------
1743 typedef struct CreateConversionStmt
1746 List *conversion_name; /* Name of the conversion */
1747 char *for_encoding_name; /* source encoding name */
1748 char *to_encoding_name; /* destination encoding name */
1749 List *func_name; /* qualified conversion function name */
1750 bool def; /* is this a default conversion? */
1751 } CreateConversionStmt;
1753 /* ----------------------
1754 * CREATE CAST Statement
1755 * ----------------------
1757 typedef struct CreateCastStmt
1760 TypeName *sourcetype;
1761 TypeName *targettype;
1763 CoercionContext context;
1766 /* ----------------------
1767 * DROP CAST Statement
1768 * ----------------------
1770 typedef struct DropCastStmt
1773 TypeName *sourcetype;
1774 TypeName *targettype;
1775 DropBehavior behavior;
1779 /* ----------------------
1781 * ----------------------
1783 typedef struct PrepareStmt
1786 char *name; /* Name of plan, arbitrary */
1787 List *argtypes; /* Types of parameters (TypeNames) */
1788 List *argtype_oids; /* Types of parameters (OIDs) */
1789 Query *query; /* The query itself */
1793 /* ----------------------
1795 * ----------------------
1798 typedef struct ExecuteStmt
1801 char *name; /* The name of the plan to execute */
1802 RangeVar *into; /* Optional table to store results in */
1803 List *params; /* Values to assign to parameters */
1807 /* ----------------------
1808 * DEALLOCATE Statement
1809 * ----------------------
1811 typedef struct DeallocateStmt
1814 char *name; /* The name of the plan to remove */
1817 #endif /* PARSENODES_H */