]> granicus.if.org Git - postgresql/blob - src/include/nodes/parsenodes.h
Remove tqual.h includes not needed.
[postgresql] / src / include / nodes / parsenodes.h
1 /*-------------------------------------------------------------------------
2  *
3  * parsenodes.h--
4  *        definitions for parse tree nodes
5  *
6  *
7  * Copyright (c) 1994, Regents of the University of California
8  *
9  * $Id: parsenodes.h,v 1.35 1997/11/24 05:09:50 momjian Exp $
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef PARSENODES_H
14 #define PARSENODES_H
15
16 #include <nodes/primnodes.h>
17
18 /*****************************************************************************
19  *      Query Tree
20  *****************************************************************************/
21
22 /*
23  * Query -
24  *        all statments are turned into a Query tree (via transformStmt)
25  *        for further processing by the optimizer
26  *        utility statements (i.e. non-optimizable statements)
27  *        have the *utilityStmt field set.
28  *
29  * we need the isPortal flag because portal names can be null too; can
30  * get rid of it if we support CURSOR as a commandType.
31  *
32  */
33 typedef struct Query
34 {
35         NodeTag         type;
36
37         CmdType         commandType;    /* select|insert|update|delete|utility */
38
39         Node       *utilityStmt;        /* non-null if this is a non-optimizable
40                                                                  * statement */
41
42         int                     resultRelation; /* target relation (index to rtable) */
43         char       *into;                       /* portal (cursor) name */
44         bool            isPortal;               /* is this a retrieve into portal? */
45         bool            isBinary;               /* binary portal? */
46
47         char       *uniqueFlag;         /* NULL, '*', or Unique attribute name */
48         List       *sortClause;         /* a list of SortClause's */
49
50         List       *rtable;                     /* list of range table entries */
51         List       *targetList;         /* target list (of TargetEntry) */
52         Node       *qual;                       /* qualifications */
53
54         List       *groupClause;        /* list of columns to specified in GROUP
55                                                                  * BY */
56         Node       *havingQual;         /* qualification of each group */
57
58         int                     qry_numAgg;             /* number of aggregates in the target list */
59         Aggreg    **qry_aggs;           /* the aggregates */
60
61         /* internal to planner */
62         List       *base_relation_list_;        /* base relation list */
63         List       *join_relation_list_;        /* list of relations */
64 }                       Query;
65
66
67 /*****************************************************************************
68  *              Other Statements (no optimizations required)
69  *
70  *              Some of them require a little bit of transformation (which is also
71  *              done by transformStmt). The whole structure is then passed on to
72  *              ProcessUtility (by-passing the optimization step) as the utilityStmt
73  *              field in Query.
74  *****************************************************************************/
75
76 /* ----------------------
77  *              Add Column Statement
78  * ----------------------
79  */
80 typedef struct AddAttrStmt
81 {
82         NodeTag         type;
83         char       *relname;            /* the relation to add attr */
84         bool            inh;                    /* add recursively to children? */
85         struct ColumnDef *colDef;       /* the attribute definition */
86 } AddAttrStmt;
87
88 /* ----------------------
89  *              Change ACL Statement
90  * ----------------------
91  */
92 typedef struct ChangeACLStmt
93 {
94         NodeTag         type;
95         struct AclItem *aclitem;
96         unsigned        modechg;
97         List       *relNames;
98 }                       ChangeACLStmt;
99
100 /* ----------------------
101  *              Close Portal Statement
102  * ----------------------
103  */
104 typedef struct ClosePortalStmt
105 {
106         NodeTag         type;
107         char       *portalname;         /* name of the portal (cursor) */
108 }                       ClosePortalStmt;
109
110 /* ----------------------
111  *              Copy Statement
112  * ----------------------
113  */
114 typedef struct CopyStmt
115 {
116         NodeTag         type;
117         bool            binary;                 /* is a binary copy? */
118         char       *relname;            /* the relation to copy */
119         bool            oids;                   /* copy oid's? */
120         int                     direction;              /* TO or FROM */
121         char       *filename;           /* if NULL, use stdin/stdout */
122         char       *delimiter;          /* delimiter character, \t by default */
123 }                       CopyStmt;
124
125 /* ----------------------
126  *              Create Table Statement
127  * ----------------------
128  */
129 typedef struct CreateStmt
130 {
131         NodeTag         type;
132         char       *relname;            /* the relation to create */
133         List       *tableElts;          /* column definitions list of ColumnDef */
134         List       *inhRelnames;        /* relations to inherit from list of Value
135                                                                  * (string) */
136         List       *constraints;        /* list of constraints (ConstaintDef) */
137 }                       CreateStmt;
138
139 typedef enum ConstrType
140 {
141         CONSTR_NONE, CONSTR_CHECK       /* type of constaints */
142 }                       ConstrType;
143
144 typedef struct ConstraintDef
145 {
146         ConstrType      type;
147         char       *name;                       /* name */
148         void       *def;                        /* definition */
149 }                       ConstraintDef;
150
151 /* ----------------------
152  *              Create/Drop TRIGGER Statements
153  * ----------------------
154  */
155
156 typedef struct CreateTrigStmt
157 {
158         NodeTag         type;
159         char       *trigname;           /* TRIGGER' name */
160         char       *relname;            /* triggered relation */
161         char       *funcname;           /* function to call (or NULL) */
162         List       *args;                       /* list of (T_String) Values or NULL */
163         bool            before;                 /* BEFORE/AFTER */
164         bool            row;                    /* ROW/STATEMENT */
165         char            actions[4];             /* Insert, Update, Delete */
166         char       *lang;                       /* NULL (which means Clanguage) */
167         char       *text;                       /* AS 'text' */
168         List       *attr;                       /* UPDATE OF a, b,... (NI) or NULL */
169         char       *when;                       /* WHEN 'a > 10 ...' (NI) or NULL */
170 }                       CreateTrigStmt;
171
172 typedef struct DropTrigStmt
173 {
174         NodeTag         type;
175         char       *trigname;           /* TRIGGER' name */
176         char       *relname;            /* triggered relation */
177 }                       DropTrigStmt;
178
179
180 /* ----------------------
181  *              Create/Drop PROCEDURAL LANGUAGE Statement
182  * ----------------------
183  */
184 typedef struct CreatePLangStmt
185 {
186         NodeTag         type;
187         char       *plname;                     /* PL name */
188         char       *plhandler;          /* PL call handler function */
189         char       *plcompiler;         /* lancompiler text */
190         bool            pltrusted;              /* PL is trusted */
191 }                       CreatePLangStmt;
192
193 typedef struct DropPLangStmt
194 {
195         NodeTag         type;
196         char       *plname;                     /* PL name */
197 }                       DropPLangStmt;
198
199
200 /* ----------------------
201  *              Create SEQUENCE Statement
202  * ----------------------
203  */
204
205 typedef struct CreateSeqStmt
206 {
207         NodeTag         type;
208         char       *seqname;            /* the relation to create */
209         List       *options;
210 }                       CreateSeqStmt;
211
212 /* ----------------------
213  *              Create Version Statement
214  * ----------------------
215  */
216 typedef struct VersionStmt
217 {
218         NodeTag         type;
219         char       *relname;            /* the new relation */
220         int                     direction;              /* FORWARD | BACKWARD */
221         char       *fromRelname;        /* relation to create a version */
222         char       *date;                       /* date of the snapshot */
223 }                       VersionStmt;
224
225 /* ----------------------
226  *              Create {Operator|Type|Aggregate} Statement
227  * ----------------------
228  */
229 typedef struct DefineStmt
230 {
231         NodeTag         type;
232         int                     defType;                /* OPERATOR|P_TYPE|AGGREGATE */
233         char       *defname;
234         List       *definition;         /* a list of DefElem */
235 }                       DefineStmt;
236
237 /* ----------------------
238  *              Drop Table Statement
239  * ----------------------
240  */
241 typedef struct DestroyStmt
242 {
243         NodeTag         type;
244         List       *relNames;           /* relations to be dropped */
245         bool            sequence;
246 }                       DestroyStmt;
247
248 /* ----------------------
249  *              Extend Index Statement
250  * ----------------------
251  */
252 typedef struct ExtendStmt
253 {
254         NodeTag         type;
255         char       *idxname;            /* name of the index */
256         Node       *whereClause;        /* qualifications */
257         List       *rangetable;         /* range table, filled in by
258                                                                  * transformStmt() */
259 }                       ExtendStmt;
260
261 /* ----------------------
262  *              Begin Recipe Statement
263  * ----------------------
264  */
265 typedef struct RecipeStmt
266 {
267         NodeTag         type;
268         char       *recipeName;         /* name of the recipe */
269 }                       RecipeStmt;
270
271 /* ----------------------
272  *              Fetch Statement
273  * ----------------------
274  */
275 typedef struct FetchStmt
276 {
277         NodeTag         type;
278         int                     direction;              /* FORWARD or BACKWARD */
279         int                     howMany;                /* amount to fetch ("ALL" --> 0) */
280         char       *portalname;         /* name of portal (cursor) */
281         bool            ismove;                 /* TRUE if MOVE */
282 }                       FetchStmt;
283
284 /* ----------------------
285  *              Create Index Statement
286  * ----------------------
287  */
288 typedef struct IndexStmt
289 {
290         NodeTag         type;
291         char       *idxname;            /* name of the index */
292         char       *relname;            /* name of relation to index on */
293         char       *accessMethod;       /* name of acess methood (eg. btree) */
294         List       *indexParams;        /* a list of IndexElem */
295         List       *withClause;         /* a list of ParamString */
296         Node       *whereClause;        /* qualifications */
297         List       *rangetable;         /* range table, filled in by
298                                                                  * transformStmt() */
299         bool       *lossy;                      /* is index lossy? */
300         bool            unique;                 /* is index unique? */
301 }                       IndexStmt;
302
303 /* ----------------------
304  *              Create Function Statement
305  * ----------------------
306  */
307 typedef struct ProcedureStmt
308 {
309         NodeTag         type;
310         char       *funcname;           /* name of function to create */
311         List       *defArgs;            /* list of definitions a list of strings
312                                                                  * (as Value *) */
313         Node       *returnType;         /* the return type (as a string or a
314                                                                  * TypeName (ie.setof) */
315         List       *withClause;         /* a list of ParamString */
316         char       *as;                         /* the SQL statement or filename */
317         char       *language;           /* C or SQL */
318 }                       ProcedureStmt;
319
320 /* ----------------------
321  *              Drop Aggregate Statement
322  * ----------------------
323  */
324 typedef struct RemoveAggrStmt
325 {
326         NodeTag         type;
327         char       *aggname;            /* aggregate to drop */
328         char       *aggtype;            /* for this type */
329 }                       RemoveAggrStmt;
330
331 /* ----------------------
332  *              Drop Function Statement
333  * ----------------------
334  */
335 typedef struct RemoveFuncStmt
336 {
337         NodeTag         type;
338         char       *funcname;           /* function to drop */
339         List       *args;                       /* types of the arguments */
340 }                       RemoveFuncStmt;
341
342 /* ----------------------
343  *              Drop Operator Statement
344  * ----------------------
345  */
346 typedef struct RemoveOperStmt
347 {
348         NodeTag         type;
349         char       *opname;                     /* operator to drop */
350         List       *args;                       /* types of the arguments */
351 }                       RemoveOperStmt;
352
353 /* ----------------------
354  *              Drop {Type|Index|Rule|View} Statement
355  * ----------------------
356  */
357 typedef struct RemoveStmt
358 {
359         NodeTag         type;
360         int                     removeType;             /* P_TYPE|INDEX|RULE|VIEW */
361         char       *name;                       /* name to drop */
362 }                       RemoveStmt;
363
364 /* ----------------------
365  *              Alter Table Statement
366  * ----------------------
367  */
368 typedef struct RenameStmt
369 {
370         NodeTag         type;
371         char       *relname;            /* relation to be altered */
372         bool            inh;                    /* recursively alter children? */
373         char       *column;                     /* if NULL, rename the relation name to
374                                                                  * the new name. Otherwise, rename this
375                                                                  * column name. */
376         char       *newname;            /* the new name */
377 }                       RenameStmt;
378
379 /* ----------------------
380  *              Create Rule Statement
381  * ----------------------
382  */
383 typedef struct RuleStmt
384 {
385         NodeTag         type;
386         char       *rulename;           /* name of the rule */
387         Node       *whereClause;        /* qualifications */
388         CmdType         event;                  /* RETRIEVE */
389         struct Attr *object;            /* object affected */
390         bool            instead;                /* is a 'do instead'? */
391         List       *actions;            /* the action statements */
392 }                       RuleStmt;
393
394 /* ----------------------
395  *              Notify Statement
396  * ----------------------
397  */
398 typedef struct NotifyStmt
399 {
400         NodeTag         type;
401         char       *relname;            /* relation to notify */
402 }                       NotifyStmt;
403
404 /* ----------------------
405  *              Listen Statement
406  * ----------------------
407  */
408 typedef struct ListenStmt
409 {
410         NodeTag         type;
411         char       *relname;            /* relation to listen on */
412 }                       ListenStmt;
413
414 /* ----------------------
415  *              {Begin|Abort|End} Transaction Statement
416  * ----------------------
417  */
418 typedef struct TransactionStmt
419 {
420         NodeTag         type;
421         int                     command;                /* BEGIN|END|ABORT */
422 }                       TransactionStmt;
423
424 /* ----------------------
425  *              Create View Statement
426  * ----------------------
427  */
428 typedef struct ViewStmt
429 {
430         NodeTag         type;
431         char       *viewname;           /* name of the view */
432         Query      *query;                      /* the SQL statement */
433 }                       ViewStmt;
434
435 /* ----------------------
436  *              Load Statement
437  * ----------------------
438  */
439 typedef struct LoadStmt
440 {
441         NodeTag         type;
442         char       *filename;           /* file to load */
443 }                       LoadStmt;
444
445 /* ----------------------
446  *              Createdb Statement
447  * ----------------------
448  */
449 typedef struct CreatedbStmt
450 {
451         NodeTag         type;
452         char       *dbname;                     /* database to create */
453         char       *dbpath;                     /* location of database */
454 }                       CreatedbStmt;
455
456 /* ----------------------
457  *              Destroydb Statement
458  * ----------------------
459  */
460 typedef struct DestroydbStmt
461 {
462         NodeTag         type;
463         char       *dbname;                     /* database to drop */
464 }                       DestroydbStmt;
465
466 /* ----------------------
467  *              Cluster Statement (support pbrown's cluster index implementation)
468  * ----------------------
469  */
470 typedef struct ClusterStmt
471 {
472         NodeTag         type;
473         char       *relname;            /* relation being indexed */
474         char       *indexname;          /* original index defined */
475 }                       ClusterStmt;
476
477 /* ----------------------
478  *              Vacuum Statement
479  * ----------------------
480  */
481 typedef struct VacuumStmt
482 {
483         NodeTag         type;
484         bool            verbose;                /* print status info */
485         bool            analyze;                /* analyze data */
486         char       *vacrel;                     /* table to vacuum */
487         List       *va_spec;            /* columns to analyse */
488 }                       VacuumStmt;
489
490 /* ----------------------
491  *              Explain Statement
492  * ----------------------
493  */
494 typedef struct ExplainStmt
495 {
496         NodeTag         type;
497         Query      *query;                      /* the query */
498         bool            verbose;                /* print plan info */
499 }                       ExplainStmt;
500
501 /* ----------------------
502  * Set Statement
503  * ----------------------
504  */
505
506 typedef struct VariableSetStmt
507 {
508         NodeTag         type;
509         char       *name;
510         char       *value;
511 }                       VariableSetStmt;
512
513 /* ----------------------
514  * Show Statement
515  * ----------------------
516  */
517
518 typedef struct VariableShowStmt
519 {
520         NodeTag         type;
521         char       *name;
522 }                       VariableShowStmt;
523
524 /* ----------------------
525  * Reset Statement
526  * ----------------------
527  */
528
529 typedef struct VariableResetStmt
530 {
531         NodeTag         type;
532         char       *name;
533 }                       VariableResetStmt;
534
535
536 /*****************************************************************************
537  *              Optimizable Statements
538  *****************************************************************************/
539
540 /* ----------------------
541  *              Insert Statement
542  * ----------------------
543  */
544 typedef struct AppendStmt
545 {
546         NodeTag         type;
547         char       *relname;            /* relation to insert into */
548         List       *cols;                       /* names of the columns */
549         List       *targetList;         /* the target list (of ResTarget) */
550         List       *fromClause;         /* the from clause */
551         Node       *whereClause;        /* qualifications */
552 } AppendStmt;
553
554 /* ----------------------
555  *              Delete Statement
556  * ----------------------
557  */
558 typedef struct DeleteStmt
559 {
560         NodeTag         type;
561         char       *relname;            /* relation to delete from */
562         Node       *whereClause;        /* qualifications */
563 }                       DeleteStmt;
564
565 /* ----------------------
566  *              Update Statement
567  * ----------------------
568  */
569 typedef struct ReplaceStmt
570 {
571         NodeTag         type;
572         char       *relname;            /* relation to update */
573         List       *targetList;         /* the target list (of ResTarget) */
574         Node       *whereClause;        /* qualifications */
575         List       *fromClause;         /* the from clause */
576 }                       ReplaceStmt;
577
578 /* ----------------------
579  *              Create Cursor Statement
580  * ----------------------
581  */
582 typedef struct CursorStmt
583 {
584         NodeTag         type;
585         char       *portalname;         /* the portal (cursor) to create */
586         bool            binary;                 /* a binary (internal) portal? */
587         char       *unique;                     /* NULL, "*", or unique attribute name */
588         List       *targetList;         /* the target list (of ResTarget) */
589         List       *fromClause;         /* the from clause */
590         Node       *whereClause;        /* qualifications */
591         List       *groupClause;        /* group by clause */
592         List       *sortClause;         /* sort clause (a list of SortGroupBy's) */
593 }                       CursorStmt;
594
595 /* ----------------------
596  *              Select Statement
597  * ----------------------
598  */
599 typedef struct RetrieveStmt
600 {
601         NodeTag         type;
602         char       *unique;                     /* NULL, '*', or unique attribute name */
603         char       *into;                       /* name of table (for select into table) */
604         List       *targetList;         /* the target list (of ResTarget) */
605         List       *fromClause;         /* the from clause */
606         Node       *whereClause;        /* qualifications */
607         List       *groupClause;        /* group by clause */
608         Node       *havingClause;       /* having conditional-expression */
609         List       *selectClause;       /* subselect parameters */
610         List       *sortClause;         /* sort clause (a list of SortGroupBy's) */
611 }                       RetrieveStmt;
612
613
614 /****************************************************************************
615  *      Supporting data structures for Parse Trees
616  ****************************************************************************/
617
618 /*
619  * SubSelect - specifies subselect parameters
620  */
621 typedef struct SubSelect
622 {
623         NodeTag         type;
624         char       *unique;                     /* NULL, '*', or unique attribute name */
625         List       *targetList;         /* the target list (of ResTarget) */
626         List       *fromClause;         /* the from clause */
627         Node       *whereClause;        /* qualifications */
628         List       *groupClause;        /* group by clause */
629         Node       *havingClause;       /* having conditional-expression */
630 }                       SubSelect;
631
632 /*
633  * TypeName - specifies a type in definitions
634  */
635 typedef struct TypeName
636 {
637         NodeTag         type;
638         char       *name;                       /* name of the type */
639         bool            timezone;               /* timezone specified? */
640         bool            setof;                  /* is a set? */
641         List       *arrayBounds;        /* array bounds */
642         int                     typlen;                 /* length for char() and varchar() */
643 }                       TypeName;
644
645 /*
646  * ParamNo - specifies a parameter reference
647  */
648 typedef struct ParamNo
649 {
650         NodeTag         type;
651         int                     number;                 /* the number of the parameter */
652         TypeName   *typename;           /* the typecast */
653 }                       ParamNo;
654
655 /*
656  * A_Expr - binary expressions
657  */
658 typedef struct A_Expr
659 {
660         NodeTag         type;
661         int                     oper;                   /* type of operation
662                                                                  * {OP,OR,AND,NOT,ISNULL,NOTNULL} */
663         char       *opname;                     /* name of operator/function */
664         Node       *lexpr;                      /* left argument */
665         Node       *rexpr;                      /* right argument */
666 } A_Expr;
667
668 /*
669  * Attr -
670  *        specifies an Attribute (ie. a Column); could have nested dots or
671  *        array references.
672  *
673  */
674 typedef struct Attr
675 {
676         NodeTag         type;
677         char       *relname;            /* name of relation (can be "*") */
678         ParamNo    *paramNo;            /* or a parameter */
679         List       *attrs;                      /* attributes (possibly nested); list of
680                                                                  * Values (strings) */
681         List       *indirection;        /* array refs (list of A_Indices') */
682 } Attr;
683
684 /*
685  * A_Const - a constant expression
686  */
687 typedef struct A_Const
688 {
689         NodeTag         type;
690         Value           val;                    /* the value (with the tag) */
691         TypeName   *typename;           /* typecast */
692 } A_Const;
693
694 /*
695  * ColumnDef - column definition (used in various creates)
696  */
697 typedef struct ColumnDef
698 {
699         NodeTag         type;
700         char       *colname;            /* name of column */
701         TypeName   *typename;           /* type of column */
702         bool            is_not_null;    /* flag to NOT NULL constraint */
703         char       *defval;                     /* default value of column */
704 }                       ColumnDef;
705
706 /*
707  * Ident -
708  *        an identifier (could be an attribute or a relation name). Depending
709  *        on the context at transformStmt time, the identifier is treated as
710  *        either a relation name (in which case, isRel will be set) or an
711  *        attribute (in which case, it will be transformed into an Attr).
712  */
713 typedef struct Ident
714 {
715         NodeTag         type;
716         char       *name;                       /* its name */
717         List       *indirection;        /* array references */
718         bool            isRel;                  /* is a relation - filled in by
719                                                                  * transformExpr() */
720 }                       Ident;
721
722 /*
723  * FuncCall - a function/aggregate invocation
724  */
725 typedef struct FuncCall
726 {
727         NodeTag         type;
728         char       *funcname;           /* name of function */
729         List       *args;                       /* the arguments (list of exprs) */
730 }                       FuncCall;
731
732 /*
733  * A_Indices - array reference or bounds ([lidx:uidx] or [uidx])
734  */
735 typedef struct A_Indices
736 {
737         NodeTag         type;
738         Node       *lidx;                       /* could be NULL */
739         Node       *uidx;
740 } A_Indices;
741
742 /*
743  * ResTarget -
744  *        result target (used in target list of pre-transformed Parse trees)
745  */
746 typedef struct ResTarget
747 {
748         NodeTag         type;
749         char       *name;                       /* name of the result column */
750         List       *indirection;        /* array references */
751         Node       *val;                        /* the value of the result (A_Expr or
752                                                                  * Attr) (or A_Const) */
753 }                       ResTarget;
754
755 /*
756  * ParamString - used in with clauses
757  */
758 typedef struct ParamString
759 {
760         NodeTag         type;
761         char       *name;
762         char       *val;
763 }                       ParamString;
764
765 /*
766  * RelExpr - relation expressions
767  */
768 typedef struct RelExpr
769 {
770         NodeTag         type;
771         char       *relname;            /* the relation name */
772         bool            inh;                    /* inheritance query */
773 }                       RelExpr;
774
775 /*
776  * SortGroupBy - for order by clause
777  */
778 typedef struct SortGroupBy
779 {
780         NodeTag         type;
781         int                     resno;                  /* target number */
782         char       *range;
783         char       *name;                       /* name of column to sort on */
784         char       *useOp;                      /* operator to use */
785 }                       SortGroupBy;
786
787 /*
788  * RangeVar - range variable, used in from clauses
789  */
790 typedef struct RangeVar
791 {
792         NodeTag         type;
793         RelExpr    *relExpr;            /* the relation expression */
794         char       *name;                       /* the name to be referenced (optional) */
795 }                       RangeVar;
796
797 /*
798  * IndexElem - index parameters (used in create index)
799  */
800 typedef struct IndexElem
801 {
802         NodeTag         type;
803         char       *name;                       /* name of index */
804         List       *args;                       /* if not NULL, function index */
805         char       *class;
806         TypeName   *tname;                      /* type of index's keys (optional) */
807 }                       IndexElem;
808
809 /*
810  * DefElem -
811  *        a definition (used in definition lists in the form of defname = arg)
812  */
813 typedef struct DefElem
814 {
815         NodeTag         type;
816         char       *defname;
817         Node       *arg;                        /* a (Value *) or a (TypeName *) */
818 }                       DefElem;
819
820
821 /****************************************************************************
822  *      Nodes for a Query tree
823  ****************************************************************************/
824
825 /*
826  * TargetEntry -
827  *         a target  entry (used in the transformed target list)
828  *
829  * one of resdom or fjoin is not NULL. a target list is
830  *              ((<resdom | fjoin> expr) (<resdom | fjoin> expr) ...)
831  */
832 typedef struct TargetEntry
833 {
834         NodeTag         type;
835         Resdom     *resdom;                     /* fjoin overload this to be a list?? */
836         Fjoin      *fjoin;
837         Node       *expr;                       /* can be a list too */
838 }                       TargetEntry;
839
840 /*
841  * RangeTblEntry -
842  *        used in range tables. Some of the following are only used in one of
843  *        the parsing, optimizing, execution stages.
844  *
845  *        inFromCl marks those range variables that are listed in the from clause.
846  *        In SQL, the targetlist can only refer to range variables listed in the
847  *        from clause but POSTQUEL allows you to refer to tables not specified, in
848  *        which case a range table entry will be generated. We use POSTQUEL
849  *        semantics which is more powerful. However, we need SQL semantics in
850  *        some cases (eg. when expanding a '*')
851  */
852 typedef struct RangeTblEntry
853 {
854         NodeTag         type;
855         char       *relname;            /* real name of the relation */
856         char       *refname;            /* the reference name (specified in the
857                                                                  * from clause) */
858         Oid                     relid;
859         bool            inh;                    /* inheritance? */
860         bool            inFromCl;               /* comes from From Clause */
861 }                       RangeTblEntry;
862
863 /*
864  * SortClause -
865  *         used in the sort clause for retrieves and cursors
866  */
867 typedef struct SortClause
868 {
869         NodeTag         type;
870         Resdom     *resdom;                     /* attributes in tlist to be sorted */
871         Oid                     opoid;                  /* sort operators */
872 }                       SortClause;
873
874 /*
875  * GroupClause -
876  *         used in the GROUP BY clause
877  */
878 typedef struct GroupClause
879 {
880         NodeTag         type;
881         TargetEntry *entry;                     /* attributes to group on */
882         Oid                     grpOpoid;               /* the sort operator to use */
883 }                       GroupClause;
884
885 #endif                                                  /* PARSENODES_H */