]> granicus.if.org Git - postgresql/blobdiff - src/include/nodes/nodes.h
Support GROUPING SETS, CUBE and ROLLUP.
[postgresql] / src / include / nodes / nodes.h
index 824d8b5dc9a24146fe520806a37b20edff02d262..669a0afa09c94e535d897cc36b1ad00bf3ed5329 100644 (file)
@@ -4,7 +4,7 @@
  *       Definitions for tagged nodes.
  *
  *
- * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * src/include/nodes/nodes.h
@@ -61,8 +61,9 @@ typedef enum NodeTag
        T_ValuesScan,
        T_CteScan,
        T_WorkTableScan,
+       T_SampleScan,
        T_ForeignScan,
-       T_FdwPlan,
+       T_CustomScan,
        T_Join,
        T_NestLoop,
        T_MergeJoin,
@@ -97,6 +98,7 @@ typedef enum NodeTag
        T_BitmapOrState,
        T_ScanState,
        T_SeqScanState,
+       T_SampleScanState,
        T_IndexScanState,
        T_IndexOnlyScanState,
        T_BitmapIndexScanState,
@@ -108,6 +110,7 @@ typedef enum NodeTag
        T_CteScanState,
        T_WorkTableScanState,
        T_ForeignScanState,
+       T_CustomScanState,
        T_JoinState,
        T_NestLoopState,
        T_MergeJoinState,
@@ -133,6 +136,7 @@ typedef enum NodeTag
        T_Const,
        T_Param,
        T_Aggref,
+       T_GroupingFunc,
        T_WindowFunc,
        T_ArrayRef,
        T_FuncExpr,
@@ -167,10 +171,12 @@ typedef enum NodeTag
        T_CoerceToDomainValue,
        T_SetToDefault,
        T_CurrentOfExpr,
+       T_InferenceElem,
        T_TargetEntry,
        T_RangeTblRef,
        T_JoinExpr,
        T_FromExpr,
+       T_OnConflictExpr,
        T_IntoClause,
 
        /*
@@ -181,7 +187,9 @@ typedef enum NodeTag
         */
        T_ExprState = 400,
        T_GenericExprState,
+       T_WholeRowVarExprState,
        T_AggrefExprState,
+       T_GroupingFuncExprState,
        T_WindowFuncExprState,
        T_ArrayRefExprState,
        T_FuncExprState,
@@ -213,6 +221,7 @@ typedef enum NodeTag
        T_PlannerGlobal,
        T_RelOptInfo,
        T_IndexOptInfo,
+       T_ParamPathInfo,
        T_Path,
        T_IndexPath,
        T_BitmapHeapPath,
@@ -223,6 +232,7 @@ typedef enum NodeTag
        T_HashPath,
        T_TidPath,
        T_ForeignPath,
+       T_CustomPath,
        T_AppendPath,
        T_MergeAppendPath,
        T_ResultPath,
@@ -232,9 +242,9 @@ typedef enum NodeTag
        T_EquivalenceMember,
        T_PathKey,
        T_RestrictInfo,
-       T_InnerIndexscanInfo,
        T_PlaceHolderVar,
        T_SpecialJoinInfo,
+       T_LateralJoinInfo,
        T_AppendRelInfo,
        T_PlaceHolderInfo,
        T_MinMaxAggInfo,
@@ -291,7 +301,6 @@ typedef enum NodeTag
        T_IndexStmt,
        T_CreateFunctionStmt,
        T_AlterFunctionStmt,
-       T_RemoveFuncStmt,
        T_DoStmt,
        T_RenameStmt,
        T_RuleStmt,
@@ -306,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,
@@ -328,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,
@@ -352,19 +357,27 @@ typedef enum NodeTag
        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)
@@ -379,6 +392,7 @@ typedef enum NodeTag
        T_A_Indirection,
        T_A_ArrayExpr,
        T_ResTarget,
+       T_MultiAssignRef,
        T_TypeCast,
        T_CollateClause,
        T_SortBy,
@@ -391,26 +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
@@ -421,6 +446,7 @@ 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 */
@@ -439,7 +465,7 @@ typedef struct Node
        NodeTag         type;
 } Node;
 
-#define nodeTag(nodeptr)               (((Node*)(nodeptr))->type)
+#define nodeTag(nodeptr)               (((const Node*)(nodeptr))->type)
 
 /*
  * newNode -
@@ -495,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}
@@ -505,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);
 
 
 /*
@@ -569,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
@@ -593,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.
  *
@@ -611,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 */