]> granicus.if.org Git - postgresql/blobdiff - src/include/nodes/nodes.h
Support GROUPING SETS, CUBE and ROLLUP.
[postgresql] / src / include / nodes / nodes.h
index d842c9c3199f83d83f5822a502fd510be300794c..669a0afa09c94e535d897cc36b1ad00bf3ed5329 100644 (file)
@@ -4,10 +4,10 @@
  *       Definitions for tagged nodes.
  *
  *
- * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.226 2009/09/22 23:43:41 tgl Exp $
+ * src/include/nodes/nodes.h
  *
  *-------------------------------------------------------------------------
  */
@@ -43,13 +43,16 @@ typedef enum NodeTag
         */
        T_Plan = 100,
        T_Result,
+       T_ModifyTable,
        T_Append,
+       T_MergeAppend,
        T_RecursiveUnion,
        T_BitmapAnd,
        T_BitmapOr,
        T_Scan,
        T_SeqScan,
        T_IndexScan,
+       T_IndexOnlyScan,
        T_BitmapIndexScan,
        T_BitmapHeapScan,
        T_TidScan,
@@ -58,6 +61,9 @@ typedef enum NodeTag
        T_ValuesScan,
        T_CteScan,
        T_WorkTableScan,
+       T_SampleScan,
+       T_ForeignScan,
+       T_CustomScan,
        T_Join,
        T_NestLoop,
        T_MergeJoin,
@@ -70,8 +76,11 @@ typedef enum NodeTag
        T_Unique,
        T_Hash,
        T_SetOp,
+       T_LockRows,
        T_Limit,
-       /* this one isn't a subclass of Plan: */
+       /* these aren't subclasses of Plan: */
+       T_NestLoopParam,
+       T_PlanRowMark,
        T_PlanInvalItem,
 
        /*
@@ -81,13 +90,17 @@ typedef enum NodeTag
         */
        T_PlanState = 200,
        T_ResultState,
+       T_ModifyTableState,
        T_AppendState,
+       T_MergeAppendState,
        T_RecursiveUnionState,
        T_BitmapAndState,
        T_BitmapOrState,
        T_ScanState,
        T_SeqScanState,
+       T_SampleScanState,
        T_IndexScanState,
+       T_IndexOnlyScanState,
        T_BitmapIndexScanState,
        T_BitmapHeapScanState,
        T_TidScanState,
@@ -96,6 +109,8 @@ typedef enum NodeTag
        T_ValuesScanState,
        T_CteScanState,
        T_WorkTableScanState,
+       T_ForeignScanState,
+       T_CustomScanState,
        T_JoinState,
        T_NestLoopState,
        T_MergeJoinState,
@@ -108,6 +123,7 @@ typedef enum NodeTag
        T_UniqueState,
        T_HashState,
        T_SetOpState,
+       T_LockRowsState,
        T_LimitState,
 
        /*
@@ -120,11 +136,14 @@ typedef enum NodeTag
        T_Const,
        T_Param,
        T_Aggref,
+       T_GroupingFunc,
        T_WindowFunc,
        T_ArrayRef,
        T_FuncExpr,
+       T_NamedArgExpr,
        T_OpExpr,
        T_DistinctExpr,
+       T_NullIfExpr,
        T_ScalarArrayOpExpr,
        T_BoolExpr,
        T_SubLink,
@@ -136,6 +155,7 @@ typedef enum NodeTag
        T_CoerceViaIO,
        T_ArrayCoerceExpr,
        T_ConvertRowtypeExpr,
+       T_CollateExpr,
        T_CaseExpr,
        T_CaseWhen,
        T_CaseTestExpr,
@@ -145,17 +165,18 @@ typedef enum NodeTag
        T_CoalesceExpr,
        T_MinMaxExpr,
        T_XmlExpr,
-       T_NullIfExpr,
        T_NullTest,
        T_BooleanTest,
        T_CoerceToDomain,
        T_CoerceToDomainValue,
        T_SetToDefault,
        T_CurrentOfExpr,
+       T_InferenceElem,
        T_TargetEntry,
        T_RangeTblRef,
        T_JoinExpr,
        T_FromExpr,
+       T_OnConflictExpr,
        T_IntoClause,
 
        /*
@@ -166,7 +187,9 @@ typedef enum NodeTag
         */
        T_ExprState = 400,
        T_GenericExprState,
+       T_WholeRowVarExprState,
        T_AggrefExprState,
+       T_GroupingFuncExprState,
        T_WindowFuncExprState,
        T_ArrayRefExprState,
        T_FuncExprState,
@@ -198,6 +221,7 @@ typedef enum NodeTag
        T_PlannerGlobal,
        T_RelOptInfo,
        T_IndexOptInfo,
+       T_ParamPathInfo,
        T_Path,
        T_IndexPath,
        T_BitmapHeapPath,
@@ -207,20 +231,23 @@ typedef enum NodeTag
        T_MergePath,
        T_HashPath,
        T_TidPath,
+       T_ForeignPath,
+       T_CustomPath,
        T_AppendPath,
+       T_MergeAppendPath,
        T_ResultPath,
        T_MaterialPath,
        T_UniquePath,
-       T_NoOpPath,
        T_EquivalenceClass,
        T_EquivalenceMember,
        T_PathKey,
        T_RestrictInfo,
-       T_InnerIndexscanInfo,
        T_PlaceHolderVar,
        T_SpecialJoinInfo,
+       T_LateralJoinInfo,
        T_AppendRelInfo,
        T_PlaceHolderInfo,
+       T_MinMaxAggInfo,
        T_PlannerParamItem,
 
        /*
@@ -261,6 +288,7 @@ typedef enum NodeTag
        T_SetOperationStmt,
        T_GrantStmt,
        T_GrantRoleStmt,
+       T_AlterDefaultPrivilegesStmt,
        T_ClosePortalStmt,
        T_ClusterStmt,
        T_CopyStmt,
@@ -273,7 +301,6 @@ typedef enum NodeTag
        T_IndexStmt,
        T_CreateFunctionStmt,
        T_AlterFunctionStmt,
-       T_RemoveFuncStmt,
        T_DoStmt,
        T_RenameStmt,
        T_RuleStmt,
@@ -288,15 +315,14 @@ typedef enum NodeTag
        T_DropdbStmt,
        T_VacuumStmt,
        T_ExplainStmt,
+       T_CreateTableAsStmt,
        T_CreateSeqStmt,
        T_AlterSeqStmt,
        T_VariableSetStmt,
        T_VariableShowStmt,
        T_DiscardStmt,
        T_CreateTrigStmt,
-       T_DropPropertyStmt,
        T_CreatePLangStmt,
-       T_DropPLangStmt,
        T_CreateRoleStmt,
        T_AlterRoleStmt,
        T_DropRoleStmt,
@@ -310,12 +336,9 @@ typedef enum NodeTag
        T_AlterRoleSetStmt,
        T_CreateConversionStmt,
        T_CreateCastStmt,
-       T_DropCastStmt,
        T_CreateOpClassStmt,
        T_CreateOpFamilyStmt,
        T_AlterOpFamilyStmt,
-       T_RemoveOpClassStmt,
-       T_RemoveOpFamilyStmt,
        T_PrepareStmt,
        T_ExecuteStmt,
        T_DeallocateStmt,
@@ -328,17 +351,33 @@ typedef enum NodeTag
        T_ReassignOwnedStmt,
        T_CompositeTypeStmt,
        T_CreateEnumStmt,
+       T_CreateRangeStmt,
+       T_AlterEnumStmt,
        T_AlterTSDictionaryStmt,
        T_AlterTSConfigurationStmt,
        T_CreateFdwStmt,
        T_AlterFdwStmt,
-       T_DropFdwStmt,
        T_CreateForeignServerStmt,
        T_AlterForeignServerStmt,
-       T_DropForeignServerStmt,
        T_CreateUserMappingStmt,
        T_AlterUserMappingStmt,
        T_DropUserMappingStmt,
+       T_AlterTableSpaceOptionsStmt,
+       T_AlterTableMoveAllStmt,
+       T_SecLabelStmt,
+       T_CreateForeignTableStmt,
+       T_ImportForeignSchemaStmt,
+       T_CreateExtensionStmt,
+       T_AlterExtensionStmt,
+       T_AlterExtensionContentsStmt,
+       T_CreateEventTrigStmt,
+       T_AlterEventTrigStmt,
+       T_RefreshMatViewStmt,
+       T_ReplicaIdentityStmt,
+       T_AlterSystemStmt,
+       T_CreatePolicyStmt,
+       T_AlterPolicyStmt,
+       T_CreateTransformStmt,
 
        /*
         * TAGS FOR PARSE TREE NODES (parsenodes.h)
@@ -353,7 +392,9 @@ typedef enum NodeTag
        T_A_Indirection,
        T_A_ArrayExpr,
        T_ResTarget,
+       T_MultiAssignRef,
        T_TypeCast,
+       T_CollateClause,
        T_SortBy,
        T_WindowDef,
        T_RangeSubselect,
@@ -364,19 +405,37 @@ typedef enum NodeTag
        T_Constraint,
        T_DefElem,
        T_RangeTblEntry,
+       T_RangeTblFunction,
+       T_WithCheckOption,
        T_SortGroupClause,
+       T_GroupingSet,
        T_WindowClause,
        T_PrivGrantee,
        T_FuncWithArgs,
        T_AccessPriv,
        T_CreateOpClassItem,
-       T_InhRelation,
+       T_TableLikeClause,
        T_FunctionParameter,
        T_LockingClause,
        T_RowMarkClause,
        T_XmlSerialize,
        T_WithClause,
+       T_InferClause,
+       T_OnConflictClause,
        T_CommonTableExpr,
+       T_RoleSpec,
+       T_RangeTableSample,
+       T_TableSampleClause,
+
+       /*
+        * TAGS FOR REPLICATION GRAMMAR PARSE NODES (replnodes.h)
+        */
+       T_IdentifySystemCmd,
+       T_BaseBackupCmd,
+       T_CreateReplicationSlotCmd,
+       T_DropReplicationSlotCmd,
+       T_StartReplicationCmd,
+       T_TimeLineHistoryCmd,
 
        /*
         * TAGS FOR RANDOM OTHER STUFF
@@ -387,10 +446,12 @@ typedef enum NodeTag
         * pass multiple object types through the same pointer).
         */
        T_TriggerData = 950,            /* in commands/trigger.h */
+       T_EventTriggerData,                     /* in commands/event_trigger.h */
        T_ReturnSetInfo,                        /* in nodes/execnodes.h */
        T_WindowObjectData,                     /* private in nodeWindowAgg.c */
        T_TIDBitmap,                            /* in nodes/tidbitmap.h */
-       T_InlineCodeBlock                       /* in nodes/parsenodes.h */
+       T_InlineCodeBlock,                      /* in nodes/parsenodes.h */
+       T_FdwRoutine                            /* in foreign/fdwapi.h */
 } NodeTag;
 
 /*
@@ -404,7 +465,7 @@ typedef struct Node
        NodeTag         type;
 } Node;
 
-#define nodeTag(nodeptr)               (((Node*)(nodeptr))->type)
+#define nodeTag(nodeptr)               (((const Node*)(nodeptr))->type)
 
 /*
  * newNode -
@@ -460,7 +521,7 @@ extern PGDLLIMPORT Node *newNodeMacroHolder;
 /*
  * nodes/{outfuncs.c,print.c}
  */
-extern char *nodeToString(void *obj);
+extern char *nodeToString(const void *obj);
 
 /*
  * nodes/{readfuncs.c,read.c}
@@ -470,12 +531,12 @@ extern void *stringToNode(char *str);
 /*
  * nodes/copyfuncs.c
  */
-extern void *copyObject(void *obj);
+extern void *copyObject(const void *obj);
 
 /*
  * nodes/equalfuncs.c
  */
-extern bool equal(void *a, void *b);
+extern bool equal(const void *a, const void *b);
 
 
 /*
@@ -534,7 +595,7 @@ typedef enum JoinType
        /*
         * Semijoins and anti-semijoins (as defined in relational theory) do not
         * appear in the SQL JOIN syntax, but there are standard idioms for
-        * representing them (e.g., using EXISTS).      The planner recognizes these
+        * representing them (e.g., using EXISTS).  The planner recognizes these
         * cases and converts them to joins.  So the planner and executor must
         * support these codes.  NOTE: in JOIN_SEMI output, it is unspecified
         * which matching RHS row is joined to.  In JOIN_ANTI output, the row is
@@ -558,7 +619,7 @@ typedef enum JoinType
 /*
  * OUTER joins are those for which pushed-down quals must behave differently
  * from the join's own quals.  This is in fact everything except INNER and
- * SEMI joins. However, this macro must also exclude the JOIN_UNIQUE symbols
+ * SEMI joins.  However, this macro must also exclude the JOIN_UNIQUE symbols
  * since those are temporary proxies for what will eventually be an INNER
  * join.
  *
@@ -576,4 +637,17 @@ typedef enum JoinType
           (1 << JOIN_RIGHT) | \
           (1 << JOIN_ANTI))) != 0)
 
+/*
+ * OnConflictAction -
+ *       "ON CONFLICT" clause type of query
+ *
+ * This is needed in both parsenodes.h and plannodes.h, so put it here...
+ */
+typedef enum OnConflictAction
+{
+       ONCONFLICT_NONE,                /* No "ON CONFLICT" clause */
+       ONCONFLICT_NOTHING,             /* ON CONFLICT ... DO NOTHING */
+       ONCONFLICT_UPDATE               /* ON CONFLICT ... DO UPDATE */
+} OnConflictAction;
+
 #endif   /* NODES_H */