1 /*-------------------------------------------------------------------------
4 * definitions for parse tree nodes
7 * Copyright (c) 1994, Regents of the University of California
9 * $Id: parsenodes.h,v 1.93 2000/01/14 22:11:38 petere Exp $
11 *-------------------------------------------------------------------------
16 #include "nodes/primnodes.h"
18 /*****************************************************************************
20 *****************************************************************************/
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.
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.
37 CmdType commandType; /* select|insert|update|delete|utility */
39 Node *utilityStmt; /* non-null if this is a non-optimizable
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 bool isTemp; /* is 'into' a temp table? */
47 bool unionall; /* union without unique sort */
48 bool hasAggs; /* has aggregates in tlist or havingQual */
49 bool hasSubLinks; /* has subquery SubLink */
51 List *rtable; /* list of range table entries */
52 List *targetList; /* target list (of TargetEntry) */
53 Node *qual; /* qualifications applied to tuples */
54 List *rowMark; /* list of RowMark entries */
56 char *uniqueFlag; /* NULL, '*', or Unique attribute name */
57 List *sortClause; /* a list of SortClause's */
59 List *groupClause; /* a list of GroupClause's */
61 Node *havingQual; /* qualifications applied to groups */
63 List *intersectClause;
64 List *unionClause; /* unions are linked under the previous
67 Node *limitOffset; /* # of result tuples to skip */
68 Node *limitCount; /* # of result tuples to return */
70 /* internal to planner */
71 List *base_rel_list; /* list of base-relation RelOptInfos */
72 List *join_rel_list; /* list of join-relation RelOptInfos */
73 List *query_pathkeys; /* pathkeys for query_planner()'s result */
77 /*****************************************************************************
78 * Other Statements (no optimizations required)
80 * Some of them require a little bit of transformation (which is also
81 * done by transformStmt). The whole structure is then passed on to
82 * ProcessUtility (by-passing the optimization step) as the utilityStmt
84 *****************************************************************************/
86 /* ----------------------
87 * Add Column Statement
88 * ----------------------
90 typedef struct AddAttrStmt
93 char *relname; /* the relation to add attr */
94 bool inh; /* add recursively to children? */
95 Node *colDef; /* the attribute definition */
98 /* ----------------------
99 * Change ACL Statement
100 * ----------------------
102 typedef struct ChangeACLStmt
105 struct AclItem *aclitem;
110 /* ----------------------
111 * Close Portal Statement
112 * ----------------------
114 typedef struct ClosePortalStmt
117 char *portalname; /* name of the portal (cursor) */
120 /* ----------------------
122 * ----------------------
124 typedef struct CopyStmt
127 bool binary; /* is a binary copy? */
128 char *relname; /* the relation to copy */
129 bool oids; /* copy oid's? */
130 int direction; /* TO or FROM */
131 char *filename; /* if NULL, use stdin/stdout */
132 char *delimiter; /* delimiter character, \t by default */
133 char *null_print; /* how to print NULLs, `\N' by default */
136 /* ----------------------
137 * Create Table Statement
138 * ----------------------
140 typedef struct CreateStmt
143 bool istemp; /* is this a temp table? */
144 char *relname; /* name of relation to create */
145 List *tableElts; /* column definitions (list of ColumnDef) */
146 List *inhRelnames; /* relations to inherit from (list of
147 * T_String Values) */
148 List *constraints; /* list of constraints (Constraint nodes) */
151 typedef enum ConstrType /* types of constraints */
153 CONSTR_NULL, CONSTR_NOTNULL, CONSTR_DEFAULT, CONSTR_CHECK,
154 CONSTR_PRIMARY, CONSTR_UNIQUE
158 * For constraints that use expressions (CONSTR_DEFAULT, CONSTR_CHECK)
159 * we may have the expression in either "raw" form (an untransformed
160 * parse tree) or "cooked" form (the nodeToString representation of
161 * an executable expression tree), depending on how this Constraint
162 * node was created (by parsing, or by inheritance from an existing
163 * relation). We should never have both in the same node!
166 typedef struct Constraint
170 char *name; /* name */
171 Node *raw_expr; /* untransformed parse tree */
172 char *cooked_expr; /* nodeToString representation */
173 List *keys; /* list of primary keys */
178 * Definitions for FOREIGN KEY constraints in CreateStmt
181 #define FKCONSTR_ON_KEY_NOACTION 0x0000
182 #define FKCONSTR_ON_KEY_RESTRICT 0x0001
183 #define FKCONSTR_ON_KEY_CASCADE 0x0002
184 #define FKCONSTR_ON_KEY_SETNULL 0x0004
185 #define FKCONSTR_ON_KEY_SETDEFAULT 0x0008
187 #define FKCONSTR_ON_DELETE_MASK 0x000F
188 #define FKCONSTR_ON_DELETE_SHIFT 0
190 #define FKCONSTR_ON_UPDATE_MASK 0x00F0
191 #define FKCONSTR_ON_UPDATE_SHIFT 4
193 typedef struct FkConstraint
196 char *constr_name; /* Constraint name */
197 char *pktable_name; /* Primary key table name */
198 List *fk_attrs; /* Attributes of foreign key */
199 List *pk_attrs; /* Corresponding attrs in PK table */
200 char *match_type; /* FULL or PARTIAL */
201 int32 actions; /* ON DELETE/UPDATE actions */
202 bool deferrable; /* DEFERRABLE */
203 bool initdeferred; /* INITIALLY DEFERRED */
207 /* ----------------------
208 * Create/Drop TRIGGER Statements
209 * ----------------------
212 typedef struct CreateTrigStmt
215 char *trigname; /* TRIGGER' name */
216 char *relname; /* triggered relation */
217 char *funcname; /* function to call (or NULL) */
218 List *args; /* list of (T_String) Values or NULL */
219 bool before; /* BEFORE/AFTER */
220 bool row; /* ROW/STATEMENT */
221 char actions[4]; /* Insert, Update, Delete */
222 char *lang; /* NULL (which means Clanguage) */
223 char *text; /* AS 'text' */
224 List *attr; /* UPDATE OF a, b,... (NI) or NULL */
225 char *when; /* WHEN 'a > 10 ...' (NI) or NULL */
227 /* The following are used for referential */
228 /* integrity constraint triggers */
229 bool isconstraint; /* This is an RI trigger */
230 bool deferrable; /* [NOT] DEFERRABLE */
231 bool initdeferred; /* INITIALLY {DEFERRED|IMMEDIATE} */
232 char *constrrelname; /* opposite relation */
235 typedef struct DropTrigStmt
238 char *trigname; /* TRIGGER' name */
239 char *relname; /* triggered relation */
243 /* ----------------------
244 * Create/Drop PROCEDURAL LANGUAGE Statement
245 * ----------------------
247 typedef struct CreatePLangStmt
250 char *plname; /* PL name */
251 char *plhandler; /* PL call handler function */
252 char *plcompiler; /* lancompiler text */
253 bool pltrusted; /* PL is trusted */
256 typedef struct DropPLangStmt
259 char *plname; /* PL name */
263 /* ----------------------
264 * Create/Alter/Drop User Statements
265 * ----------------------
267 typedef struct CreateUserStmt
270 char *user; /* PostgreSQL user login */
271 char *password; /* PostgreSQL user password */
272 int sysid; /* PgSQL system id (-1 if don't care) */
273 bool createdb; /* Can the user create databases? */
274 bool createuser; /* Can this user create users? */
275 List *groupElts; /* The groups the user is a member of */
276 char *validUntil; /* The time the login is valid until */
279 typedef struct AlterUserStmt
282 char *user; /* PostgreSQL user login */
283 char *password; /* PostgreSQL user password */
284 int createdb; /* Can the user create databases? */
285 int createuser; /* Can this user create users? */
286 char *validUntil; /* The time the login is valid until */
289 typedef struct DropUserStmt
292 List *users; /* List of users to remove */
296 /* ----------------------
297 * Create/Alter/Drop Group Statements
298 * ----------------------
300 typedef struct CreateGroupStmt
303 char *name; /* name of the new group */
304 int sysid; /* group id (-1 if pick default) */
305 List *initUsers; /* list of initial users */
308 typedef struct AlterGroupStmt
311 char *name; /* name of group to alter */
312 int action; /* +1 = add, -1 = drop user */
313 int sysid; /* sysid change */
314 List *listUsers; /* list of users to add/drop */
317 typedef struct DropGroupStmt
324 /* ----------------------
325 * Create SEQUENCE Statement
326 * ----------------------
329 typedef struct CreateSeqStmt
332 char *seqname; /* the relation to create */
336 /* ----------------------
337 * Create Version Statement
338 * ----------------------
340 typedef struct VersionStmt
343 char *relname; /* the new relation */
344 int direction; /* FORWARD | BACKWARD */
345 char *fromRelname; /* relation to create a version */
346 char *date; /* date of the snapshot */
349 /* ----------------------
350 * Create {Operator|Type|Aggregate} Statement
351 * ----------------------
353 typedef struct DefineStmt
356 int defType; /* OPERATOR|P_TYPE|AGGREGATE */
358 List *definition; /* a list of DefElem */
361 /* ----------------------
362 * Drop Table Statement
363 * ----------------------
365 typedef struct DropStmt
368 List *relNames; /* relations to be dropped */
372 /* ----------------------
373 * Truncate Table Statement
374 * ----------------------
376 typedef struct TruncateStmt
379 char *relName; /* relation to be truncated */
382 /* ----------------------
383 * Comment On Statement
384 * ----------------------
386 typedef struct CommentStmt
389 int objtype; /* Object's type */
390 char *objname; /* Name of the object */
391 char *objproperty; /* Property Id (such as column) */
392 List *objlist; /* Arguments for VAL objects */
393 char *comment; /* The comment to insert */
396 /* ----------------------
397 * Extend Index Statement
398 * ----------------------
400 typedef struct ExtendStmt
403 char *idxname; /* name of the index */
404 Node *whereClause; /* qualifications */
405 List *rangetable; /* range table, filled in by
409 /* ----------------------
410 * Begin Recipe Statement
411 * ----------------------
413 typedef struct RecipeStmt
416 char *recipeName; /* name of the recipe */
419 /* ----------------------
421 * ----------------------
423 typedef struct FetchStmt
426 int direction; /* FORWARD or BACKWARD */
427 int howMany; /* amount to fetch ("ALL" --> 0) */
428 char *portalname; /* name of portal (cursor) */
429 bool ismove; /* TRUE if MOVE */
432 /* ----------------------
433 * Create Index Statement
434 * ----------------------
436 typedef struct IndexStmt
439 char *idxname; /* name of the index */
440 char *relname; /* name of relation to index on */
441 char *accessMethod; /* name of acess methood (eg. btree) */
442 List *indexParams; /* a list of IndexElem */
443 List *withClause; /* a list of DefElem */
444 Node *whereClause; /* qualifications */
445 List *rangetable; /* range table, filled in by
447 bool *lossy; /* is index lossy? */
448 bool unique; /* is index unique? */
449 bool primary; /* is index on primary key? */
452 /* ----------------------
453 * Create Function Statement
454 * ----------------------
456 typedef struct ProcedureStmt
459 char *funcname; /* name of function to create */
460 List *defArgs; /* list of definitions a list of strings
462 Node *returnType; /* the return type (as a string or a
463 * TypeName (ie.setof) */
464 List *withClause; /* a list of DefElem */
465 List *as; /* the SQL statement or filename */
466 char *language; /* C or SQL */
469 /* ----------------------
470 * Drop Aggregate Statement
471 * ----------------------
473 typedef struct RemoveAggrStmt
476 char *aggname; /* aggregate to drop */
477 char *aggtype; /* for this type */
480 /* ----------------------
481 * Drop Function Statement
482 * ----------------------
484 typedef struct RemoveFuncStmt
487 char *funcname; /* function to drop */
488 List *args; /* types of the arguments */
491 /* ----------------------
492 * Drop Operator Statement
493 * ----------------------
495 typedef struct RemoveOperStmt
498 char *opname; /* operator to drop */
499 List *args; /* types of the arguments */
502 /* ----------------------
503 * Drop {Type|Index|Rule|View} Statement
504 * ----------------------
506 typedef struct RemoveStmt
509 int removeType; /* P_TYPE|INDEX|RULE|VIEW */
510 char *name; /* name to drop */
513 /* ----------------------
514 * Alter Table Statement
515 * ----------------------
517 typedef struct RenameStmt
520 char *relname; /* relation to be altered */
521 bool inh; /* recursively alter children? */
522 char *column; /* if NULL, rename the relation name to
523 * the new name. Otherwise, rename this
525 char *newname; /* the new name */
528 /* ----------------------
529 * Create Rule Statement
530 * ----------------------
532 typedef struct RuleStmt
535 char *rulename; /* name of the rule */
536 Node *whereClause; /* qualifications */
537 CmdType event; /* RETRIEVE */
538 struct Attr *object; /* object affected */
539 bool instead; /* is a 'do instead'? */
540 List *actions; /* the action statements */
543 /* ----------------------
545 * ----------------------
547 typedef struct NotifyStmt
550 char *relname; /* relation to notify */
553 /* ----------------------
555 * ----------------------
557 typedef struct ListenStmt
560 char *relname; /* relation to listen on */
563 /* ----------------------
565 * ----------------------
567 typedef struct UnlistenStmt
570 char *relname; /* relation to unlisten on */
573 /* ----------------------
574 * {Begin|Abort|End} Transaction Statement
575 * ----------------------
577 typedef struct TransactionStmt
580 int command; /* BEGIN|END|ABORT */
583 /* ----------------------
584 * Create View Statement
585 * ----------------------
587 typedef struct ViewStmt
590 char *viewname; /* name of the view */
591 Query *query; /* the SQL statement */
594 /* ----------------------
596 * ----------------------
598 typedef struct LoadStmt
601 char *filename; /* file to load */
604 /* ----------------------
606 * ----------------------
608 typedef struct CreatedbStmt
611 char *dbname; /* database to create */
612 char *dbpath; /* location of database */
613 int encoding; /* default encoding (see regex/pg_wchar.h) */
616 /* ----------------------
618 * ----------------------
620 typedef struct DropdbStmt
623 char *dbname; /* database to drop */
626 /* ----------------------
627 * Cluster Statement (support pbrown's cluster index implementation)
628 * ----------------------
630 typedef struct ClusterStmt
633 char *relname; /* relation being indexed */
634 char *indexname; /* original index defined */
637 /* ----------------------
639 * ----------------------
641 typedef struct VacuumStmt
644 bool verbose; /* print status info */
645 bool analyze; /* analyze data */
646 char *vacrel; /* table to vacuum */
647 List *va_spec; /* columns to analyse */
650 /* ----------------------
652 * ----------------------
654 typedef struct ExplainStmt
657 Query *query; /* the query */
658 bool verbose; /* print plan info */
661 /* ----------------------
663 * ----------------------
666 typedef struct VariableSetStmt
673 /* ----------------------
675 * ----------------------
678 typedef struct VariableShowStmt
684 /* ----------------------
686 * ----------------------
689 typedef struct VariableResetStmt
695 /* ----------------------
697 * ----------------------
699 typedef struct LockStmt
702 char *relname; /* relation to lock */
703 int mode; /* lock mode */
707 /* ----------------------
708 * SET CONSTRAINTS Statement
709 * ----------------------
711 typedef struct ConstraintsSetStmt
716 } ConstraintsSetStmt;
719 /*****************************************************************************
720 * Optimizable Statements
721 *****************************************************************************/
723 /* ----------------------
725 * ----------------------
727 typedef struct InsertStmt
730 char *relname; /* relation to insert into */
731 char *unique; /* NULL, '*', or unique attribute name */
732 List *cols; /* names of the columns */
733 List *targetList; /* the target list (of ResTarget) */
734 List *fromClause; /* the from clause */
735 Node *whereClause; /* qualifications */
736 List *groupClause; /* GROUP BY clauses */
737 Node *havingClause; /* having conditional-expression */
738 List *unionClause; /* union subselect parameters */
739 bool unionall; /* union without unique sort */
740 List *intersectClause;
741 List *forUpdate; /* FOR UPDATE clause */
744 /* ----------------------
746 * ----------------------
748 typedef struct DeleteStmt
751 char *relname; /* relation to delete from */
752 Node *whereClause; /* qualifications */
755 /* ----------------------
757 * ----------------------
759 typedef struct UpdateStmt
762 char *relname; /* relation to update */
763 List *targetList; /* the target list (of ResTarget) */
764 Node *whereClause; /* qualifications */
765 List *fromClause; /* the from clause */
768 /* ----------------------
770 * ----------------------
772 typedef struct SelectStmt
775 char *unique; /* NULL, '*', or unique attribute name */
776 char *into; /* name of table (for select into table) */
777 List *targetList; /* the target list (of ResTarget) */
778 List *fromClause; /* the from clause */
779 Node *whereClause; /* qualifications */
780 List *groupClause; /* GROUP BY clauses */
781 Node *havingClause; /* having conditional-expression */
782 List *intersectClause;
785 List *unionClause; /* union subselect parameters */
786 List *sortClause; /* sort clause (a list of SortGroupBy's) */
787 char *portalname; /* the portal (cursor) to create */
788 bool binary; /* a binary (internal) portal? */
789 bool istemp; /* into is a temp table */
790 bool unionall; /* union without unique sort */
791 Node *limitOffset; /* # of result tuples to skip */
792 Node *limitCount; /* # of result tuples to return */
793 List *forUpdate; /* FOR UPDATE clause */
796 /****************************************************************************
797 * Supporting data structures for Parse Trees
799 * Most of these node types appear in raw parsetrees output by the grammar,
800 * and get transformed to something else by the analyzer. A few of them
801 * are used as-is in transformed querytrees.
802 ****************************************************************************/
805 * TypeName - specifies a type in definitions
807 typedef struct TypeName
810 char *name; /* name of the type */
811 bool timezone; /* timezone specified? */
812 bool setof; /* is a set? */
813 int32 typmod; /* type modifier */
814 List *arrayBounds; /* array bounds */
818 * ParamNo - specifies a parameter reference
820 typedef struct ParamNo
823 int number; /* the number of the parameter */
824 TypeName *typename; /* the typecast */
825 List *indirection; /* array references */
829 * A_Expr - binary expressions
831 typedef struct A_Expr
834 int oper; /* type of operation
835 * {OP,OR,AND,NOT,ISNULL,NOTNULL} */
836 char *opname; /* name of operator/function */
837 Node *lexpr; /* left argument */
838 Node *rexpr; /* right argument */
843 * specifies an Attribute (ie. a Column); could have nested dots or
850 char *relname; /* name of relation (can be "*") */
851 ParamNo *paramNo; /* or a parameter */
852 List *attrs; /* attributes (possibly nested); list of
853 * Values (strings) */
854 List *indirection; /* array refs (list of A_Indices') */
858 * A_Const - a constant expression
860 typedef struct A_Const
863 Value val; /* the value (with the tag) */
864 TypeName *typename; /* typecast */
868 * CaseExpr - a CASE expression
870 typedef struct CaseExpr
874 Node *arg; /* implicit equality comparison argument */
875 List *args; /* the arguments (list of WHEN clauses) */
876 Node *defresult; /* the default result (ELSE clause) */
880 * CaseWhen - an argument to a CASE expression
882 typedef struct CaseWhen
885 Node *expr; /* comparison expression */
886 Node *result; /* substitution result */
890 * ColumnDef - column definition (used in various creates)
892 * If the column has a default value, we may have the value expression
893 * in either "raw" form (an untransformed parse tree) or "cooked" form
894 * (the nodeToString representation of an executable expression tree),
895 * depending on how this ColumnDef node was created (by parsing, or by
896 * inheritance from an existing relation). We should never have both
899 * The constraints list may contain a CONSTR_DEFAULT item in a raw
900 * parsetree produced by gram.y, but transformCreateStmt will remove
901 * the item and set raw_default instead. CONSTR_DEFAULT items
902 * should not appear in any subsequent processing.
904 typedef struct ColumnDef
907 char *colname; /* name of column */
908 TypeName *typename; /* type of column */
909 bool is_not_null; /* flag to NOT NULL constraint */
910 bool is_sequence; /* is a sequence? */
911 Node *raw_default; /* default value (untransformed parse tree) */
912 char *cooked_default; /* nodeToString representation */
913 List *constraints; /* other constraints on column */
918 * an identifier (could be an attribute or a relation name). Depending
919 * on the context at transformStmt time, the identifier is treated as
920 * either a relation name (in which case, isRel will be set) or an
921 * attribute (in which case, it will be transformed into an Attr).
926 char *name; /* its name */
927 List *indirection; /* array references */
928 bool isRel; /* is a relation - filled in by
933 * FuncCall - a function or aggregate invocation
935 * agg_star indicates we saw a 'foo(*)' construct, while agg_distinct
936 * indicates we saw 'foo(DISTINCT ...)'. In either case, the construct
937 * *must* be an aggregate call. Otherwise, it might be either an
938 * aggregate or some other kind of function.
940 typedef struct FuncCall
943 char *funcname; /* name of function */
944 List *args; /* the arguments (list of exprs) */
945 bool agg_star; /* argument was really '*' */
946 bool agg_distinct; /* arguments were labeled DISTINCT */
950 * A_Indices - array reference or bounds ([lidx:uidx] or [uidx])
952 typedef struct A_Indices
955 Node *lidx; /* could be NULL */
961 * result target (used in target list of pre-transformed Parse trees)
963 * In a SELECT or INSERT target list, 'name' is either NULL or
964 * the column name assigned to the value. (If there is an 'AS ColumnLabel'
965 * clause, the grammar sets 'name' from it; otherwise 'name' is initially NULL
966 * and is filled in during the parse analysis phase.)
967 * The 'indirection' field is not used at all.
969 * In an UPDATE target list, 'name' is the name of the destination column,
970 * and 'indirection' stores any subscripts attached to the destination.
971 * That is, our representation is UPDATE table SET name [indirection] = val.
973 typedef struct ResTarget
976 char *name; /* column name or NULL */
977 List *indirection; /* subscripts for destination column, or
979 Node *val; /* the value expression to compute or
984 * RelExpr - relation expressions
986 typedef struct RelExpr
989 char *relname; /* the relation name */
990 bool inh; /* inheritance query */
994 * SortGroupBy - for ORDER BY clause
996 typedef struct SortGroupBy
999 char *useOp; /* operator to use */
1000 Node *node; /* Expression */
1004 * RangeVar - range variable, used in FROM clauses
1006 typedef struct RangeVar
1009 RelExpr *relExpr; /* the relation expression */
1010 char *name; /* the name to be referenced (optional) */
1014 * IndexElem - index parameters (used in CREATE INDEX)
1016 typedef struct IndexElem
1019 char *name; /* name of index */
1020 List *args; /* if not NULL, function index */
1022 TypeName *typename; /* type of index's keys (optional) */
1027 * a definition (used in definition lists in the form of defname = arg)
1029 typedef struct DefElem
1033 Node *arg; /* a (Value *) or a (TypeName *) */
1037 * JoinExpr - for JOIN expressions
1039 typedef struct JoinExpr
1049 /****************************************************************************
1050 * Nodes for a Query tree
1051 ****************************************************************************/
1055 * a target entry (used in the transformed target list)
1057 * one of resdom or fjoin is not NULL. a target list is
1058 * ((<resdom | fjoin> expr) (<resdom | fjoin> expr) ...)
1060 typedef struct TargetEntry
1063 Resdom *resdom; /* fjoin overload this to be a list?? */
1068 /*--------------------
1070 * A range table is a List of RangeTblEntry nodes.
1072 * Some of the following are only used in one of
1073 * the parsing, optimizing, execution stages.
1075 * inFromCl marks those range variables that are listed in the FROM clause.
1076 * In SQL, the query can only refer to range variables listed in the
1077 * FROM clause, but POSTQUEL allows you to refer to tables not listed,
1078 * in which case a range table entry will be generated. We still support
1079 * this POSTQUEL feature, although there is some doubt whether it's
1080 * convenient or merely confusing. The flag is needed since an
1081 * implicitly-added RTE shouldn't change the namespace for unqualified
1082 * column names processed later, and it also shouldn't affect the
1085 * inJoinSet marks those range variables that the planner should join
1086 * over even if they aren't explicitly referred to in the query. For
1087 * example, "SELECT COUNT(1) FROM tx" should produce the number of rows
1088 * in tx. A more subtle example uses a POSTQUEL implicit RTE:
1089 * SELECT COUNT(1) FROM tx WHERE TRUE OR (tx.f1 = ty.f2)
1090 * Here we should get the product of the sizes of tx and ty. However,
1091 * the query optimizer can simplify the WHERE clause to "TRUE", so
1092 * ty will no longer be referred to explicitly; without a flag forcing
1093 * it to be included in the join, we will get the wrong answer. So,
1094 * a POSTQUEL implicit RTE must be marked inJoinSet but not inFromCl.
1095 *--------------------
1097 typedef struct RangeTblEntry
1100 char *relname; /* real name of the relation */
1101 char *refname; /* the reference name (as specified in the
1103 Oid relid; /* OID of the relation */
1104 bool inh; /* inheritance requested? */
1105 bool inFromCl; /* present in FROM clause */
1106 bool inJoinSet; /* planner must include this rel */
1107 bool skipAcl; /* skip ACL check in executor */
1112 * representation of ORDER BY clauses
1114 * tleSortGroupRef must match ressortgroupref of exactly one Resdom of the
1115 * associated targetlist; that is the expression to be sorted (or grouped) by.
1116 * sortop is the OID of the ordering operator.
1118 typedef struct SortClause
1121 Index tleSortGroupRef;/* reference into targetlist */
1122 Oid sortop; /* the sort operator to use */
1127 * representation of GROUP BY clauses
1129 * GroupClause is exactly like SortClause except for the nodetag value
1130 * (and it's probably not even really necessary to have two different
1131 * nodetags...). We have routines that operate interchangeably on both.
1133 typedef SortClause GroupClause;
1135 #define ROW_MARK_FOR_UPDATE (1 << 0)
1136 #define ROW_ACL_FOR_UPDATE (1 << 1)
1138 typedef struct RowMark
1141 Index rti; /* index in Query->rtable */
1142 bits8 info; /* as above */
1145 #endif /* PARSENODES_H */