From 913a6d0352d21e9c91da683e48cf594d620e763c Mon Sep 17 00:00:00 2001
From: Arseny Sher <sher-ars@ispras.ru>
Date: Fri, 10 Mar 2017 15:39:12 +0300
Subject: [PATCH 2/8] Node's interface functions stubbed

Namely, ExecProcNode, ExecInitNode, ExecEndNode, MultiExecProcNode, ExecRescan,
ExecutorRewind. It breaks the existing executor.
---
 src/backend/executor/execAmi.c      | 213 +-----------
 src/backend/executor/execMain.c     |  26 +-
 src/backend/executor/execProcnode.c | 633 +-----------------------------------
 3 files changed, 16 insertions(+), 856 deletions(-)

diff --git a/src/backend/executor/execAmi.c b/src/backend/executor/execAmi.c
index 5d59f95a91..a447cb92ba 100644
--- a/src/backend/executor/execAmi.c
+++ b/src/backend/executor/execAmi.c
@@ -73,218 +73,7 @@ static bool IndexSupportsBackwardScan(Oid indexid);
 void
 ExecReScan(PlanState *node)
 {
-	/* If collecting timing stats, update them */
-	if (node->instrument)
-		InstrEndLoop(node->instrument);
-
-	/*
-	 * If we have changed parameters, propagate that info.
-	 *
-	 * Note: ExecReScanSetParamPlan() can add bits to node->chgParam,
-	 * corresponding to the output param(s) that the InitPlan will update.
-	 * Since we make only one pass over the list, that means that an InitPlan
-	 * can depend on the output param(s) of a sibling InitPlan only if that
-	 * sibling appears earlier in the list.  This is workable for now given
-	 * the limited ways in which one InitPlan could depend on another, but
-	 * eventually we might need to work harder (or else make the planner
-	 * enlarge the extParam/allParam sets to include the params of depended-on
-	 * InitPlans).
-	 */
-	if (node->chgParam != NULL)
-	{
-		ListCell   *l;
-
-		foreach(l, node->initPlan)
-		{
-			SubPlanState *sstate = (SubPlanState *) lfirst(l);
-			PlanState  *splan = sstate->planstate;
-
-			if (splan->plan->extParam != NULL)	/* don't care about child
-												 * local Params */
-				UpdateChangedParamSet(splan, node->chgParam);
-			if (splan->chgParam != NULL)
-				ExecReScanSetParamPlan(sstate, node);
-		}
-		foreach(l, node->subPlan)
-		{
-			SubPlanState *sstate = (SubPlanState *) lfirst(l);
-			PlanState  *splan = sstate->planstate;
-
-			if (splan->plan->extParam != NULL)
-				UpdateChangedParamSet(splan, node->chgParam);
-		}
-		/* Well. Now set chgParam for left/right trees. */
-		if (node->lefttree != NULL)
-			UpdateChangedParamSet(node->lefttree, node->chgParam);
-		if (node->righttree != NULL)
-			UpdateChangedParamSet(node->righttree, node->chgParam);
-	}
-
-	/* Call expression callbacks */
-	if (node->ps_ExprContext)
-		ReScanExprContext(node->ps_ExprContext);
-
-	/* And do node-type-specific processing */
-	switch (nodeTag(node))
-	{
-		case T_ResultState:
-			ExecReScanResult((ResultState *) node);
-			break;
-
-		case T_ProjectSetState:
-			ExecReScanProjectSet((ProjectSetState *) node);
-			break;
-
-		case T_ModifyTableState:
-			ExecReScanModifyTable((ModifyTableState *) node);
-			break;
-
-		case T_AppendState:
-			ExecReScanAppend((AppendState *) node);
-			break;
-
-		case T_MergeAppendState:
-			ExecReScanMergeAppend((MergeAppendState *) node);
-			break;
-
-		case T_RecursiveUnionState:
-			ExecReScanRecursiveUnion((RecursiveUnionState *) node);
-			break;
-
-		case T_BitmapAndState:
-			ExecReScanBitmapAnd((BitmapAndState *) node);
-			break;
-
-		case T_BitmapOrState:
-			ExecReScanBitmapOr((BitmapOrState *) node);
-			break;
-
-		case T_SeqScanState:
-			ExecReScanSeqScan((SeqScanState *) node);
-			break;
-
-		case T_SampleScanState:
-			ExecReScanSampleScan((SampleScanState *) node);
-			break;
-
-		case T_GatherState:
-			ExecReScanGather((GatherState *) node);
-			break;
-
-		case T_IndexScanState:
-			ExecReScanIndexScan((IndexScanState *) node);
-			break;
-
-		case T_IndexOnlyScanState:
-			ExecReScanIndexOnlyScan((IndexOnlyScanState *) node);
-			break;
-
-		case T_BitmapIndexScanState:
-			ExecReScanBitmapIndexScan((BitmapIndexScanState *) node);
-			break;
-
-		case T_BitmapHeapScanState:
-			ExecReScanBitmapHeapScan((BitmapHeapScanState *) node);
-			break;
-
-		case T_TidScanState:
-			ExecReScanTidScan((TidScanState *) node);
-			break;
-
-		case T_SubqueryScanState:
-			ExecReScanSubqueryScan((SubqueryScanState *) node);
-			break;
-
-		case T_FunctionScanState:
-			ExecReScanFunctionScan((FunctionScanState *) node);
-			break;
-
-		case T_TableFuncScanState:
-			ExecReScanTableFuncScan((TableFuncScanState *) node);
-			break;
-
-		case T_ValuesScanState:
-			ExecReScanValuesScan((ValuesScanState *) node);
-			break;
-
-		case T_CteScanState:
-			ExecReScanCteScan((CteScanState *) node);
-			break;
-
-		case T_WorkTableScanState:
-			ExecReScanWorkTableScan((WorkTableScanState *) node);
-			break;
-
-		case T_ForeignScanState:
-			ExecReScanForeignScan((ForeignScanState *) node);
-			break;
-
-		case T_CustomScanState:
-			ExecReScanCustomScan((CustomScanState *) node);
-			break;
-
-		case T_NestLoopState:
-			ExecReScanNestLoop((NestLoopState *) node);
-			break;
-
-		case T_MergeJoinState:
-			ExecReScanMergeJoin((MergeJoinState *) node);
-			break;
-
-		case T_HashJoinState:
-			ExecReScanHashJoin((HashJoinState *) node);
-			break;
-
-		case T_MaterialState:
-			ExecReScanMaterial((MaterialState *) node);
-			break;
-
-		case T_SortState:
-			ExecReScanSort((SortState *) node);
-			break;
-
-		case T_GroupState:
-			ExecReScanGroup((GroupState *) node);
-			break;
-
-		case T_AggState:
-			ExecReScanAgg((AggState *) node);
-			break;
-
-		case T_WindowAggState:
-			ExecReScanWindowAgg((WindowAggState *) node);
-			break;
-
-		case T_UniqueState:
-			ExecReScanUnique((UniqueState *) node);
-			break;
-
-		case T_HashState:
-			ExecReScanHash((HashState *) node);
-			break;
-
-		case T_SetOpState:
-			ExecReScanSetOp((SetOpState *) node);
-			break;
-
-		case T_LockRowsState:
-			ExecReScanLockRows((LockRowsState *) node);
-			break;
-
-		case T_LimitState:
-			ExecReScanLimit((LimitState *) node);
-			break;
-
-		default:
-			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
-			break;
-	}
-
-	if (node->chgParam != NULL)
-	{
-		bms_free(node->chgParam);
-		node->chgParam = NULL;
-	}
+	elog(ERROR, "ExecReScan not implemented yet");
 }
 
 /*
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index efb3f30dd0..f629f0098f 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -509,30 +509,8 @@ standard_ExecutorEnd(QueryDesc *queryDesc)
 void
 ExecutorRewind(QueryDesc *queryDesc)
 {
-	EState	   *estate;
-	MemoryContext oldcontext;
-
-	/* sanity checks */
-	Assert(queryDesc != NULL);
-
-	estate = queryDesc->estate;
-
-	Assert(estate != NULL);
-
-	/* It's probably not sensible to rescan updating queries */
-	Assert(queryDesc->operation == CMD_SELECT);
-
-	/*
-	 * Switch into per-query memory context
-	 */
-	oldcontext = MemoryContextSwitchTo(estate->es_query_cxt);
-
-	/*
-	 * rescan plan
-	 */
-	ExecReScan(queryDesc->planstate);
-
-	MemoryContextSwitchTo(oldcontext);
+	elog(ERROR, "Rewinding not supported");
+	return;
 }
 
 
diff --git a/src/backend/executor/execProcnode.c b/src/backend/executor/execProcnode.c
index c1c4cecd6c..649d1e58f6 100644
--- a/src/backend/executor/execProcnode.c
+++ b/src/backend/executor/execProcnode.c
@@ -131,7 +131,7 @@
  *		  'node' is the current node of the plan produced by the query planner
  *		  'estate' is the shared execution state for the plan tree
  *		  'eflags' is a bitwise OR of flag bits described in executor.h
- *        'parent' is parent of the node
+ *		  'parent' is parent of the node
  *
  *		Returns a PlanState node corresponding to the given Plan node.
  * ------------------------------------------------------------------------
@@ -140,8 +140,6 @@ PlanState *
 ExecInitNode(Plan *node, EState *estate, int eflags, PlanState *parent)
 {
 	PlanState  *result;
-	List	   *subps;
-	ListCell   *l;
 
 	/*
 	 * do nothing when we get to the end of a leaf on tree.
@@ -151,229 +149,13 @@ ExecInitNode(Plan *node, EState *estate, int eflags, PlanState *parent)
 
 	switch (nodeTag(node))
 	{
-			/*
-			 * control nodes
-			 */
-		case T_Result:
-			result = (PlanState *) ExecInitResult((Result *) node,
-												  estate, eflags);
-			break;
-
-		case T_ProjectSet:
-			result = (PlanState *) ExecInitProjectSet((ProjectSet *) node,
-													  estate, eflags);
-			break;
-
-		case T_ModifyTable:
-			result = (PlanState *) ExecInitModifyTable((ModifyTable *) node,
-													   estate, eflags);
-			break;
-
-		case T_Append:
-			result = (PlanState *) ExecInitAppend((Append *) node,
-												  estate, eflags);
-			break;
-
-		case T_MergeAppend:
-			result = (PlanState *) ExecInitMergeAppend((MergeAppend *) node,
-													   estate, eflags);
-			break;
-
-		case T_RecursiveUnion:
-			result = (PlanState *) ExecInitRecursiveUnion((RecursiveUnion *) node,
-														  estate, eflags);
-			break;
-
-		case T_BitmapAnd:
-			result = (PlanState *) ExecInitBitmapAnd((BitmapAnd *) node,
-													 estate, eflags);
-			break;
-
-		case T_BitmapOr:
-			result = (PlanState *) ExecInitBitmapOr((BitmapOr *) node,
-													estate, eflags);
-			break;
-
-			/*
-			 * scan nodes
-			 */
-		case T_SeqScan:
-			result = (PlanState *) ExecInitSeqScan((SeqScan *) node,
-												   estate, eflags);
-			break;
-
-		case T_SampleScan:
-			result = (PlanState *) ExecInitSampleScan((SampleScan *) node,
-													  estate, eflags);
-			break;
-
-		case T_IndexScan:
-			result = (PlanState *) ExecInitIndexScan((IndexScan *) node,
-													 estate, eflags);
-			break;
-
-		case T_IndexOnlyScan:
-			result = (PlanState *) ExecInitIndexOnlyScan((IndexOnlyScan *) node,
-														 estate, eflags);
-			break;
-
-		case T_BitmapIndexScan:
-			result = (PlanState *) ExecInitBitmapIndexScan((BitmapIndexScan *) node,
-														   estate, eflags);
-			break;
-
-		case T_BitmapHeapScan:
-			result = (PlanState *) ExecInitBitmapHeapScan((BitmapHeapScan *) node,
-														  estate, eflags);
-			break;
-
-		case T_TidScan:
-			result = (PlanState *) ExecInitTidScan((TidScan *) node,
-												   estate, eflags);
-			break;
-
-		case T_SubqueryScan:
-			result = (PlanState *) ExecInitSubqueryScan((SubqueryScan *) node,
-														estate, eflags);
-			break;
-
-		case T_FunctionScan:
-			result = (PlanState *) ExecInitFunctionScan((FunctionScan *) node,
-														estate, eflags);
-			break;
-
-		case T_TableFuncScan:
-			result = (PlanState *) ExecInitTableFuncScan((TableFuncScan *) node,
-														 estate, eflags);
-			break;
-
-		case T_ValuesScan:
-			result = (PlanState *) ExecInitValuesScan((ValuesScan *) node,
-													  estate, eflags);
-			break;
-
-		case T_CteScan:
-			result = (PlanState *) ExecInitCteScan((CteScan *) node,
-												   estate, eflags);
-			break;
-
-		case T_WorkTableScan:
-			result = (PlanState *) ExecInitWorkTableScan((WorkTableScan *) node,
-														 estate, eflags);
-			break;
-
-		case T_ForeignScan:
-			result = (PlanState *) ExecInitForeignScan((ForeignScan *) node,
-													   estate, eflags);
-			break;
-
-		case T_CustomScan:
-			result = (PlanState *) ExecInitCustomScan((CustomScan *) node,
-													  estate, eflags);
-			break;
-
-			/*
-			 * join nodes
-			 */
-		case T_NestLoop:
-			result = (PlanState *) ExecInitNestLoop((NestLoop *) node,
-													estate, eflags);
-			break;
-
-		case T_MergeJoin:
-			result = (PlanState *) ExecInitMergeJoin((MergeJoin *) node,
-													 estate, eflags);
-			break;
-
-		case T_HashJoin:
-			result = (PlanState *) ExecInitHashJoin((HashJoin *) node,
-													estate, eflags);
-			break;
-
-			/*
-			 * materialization nodes
-			 */
-		case T_Material:
-			result = (PlanState *) ExecInitMaterial((Material *) node,
-													estate, eflags);
-			break;
-
-		case T_Sort:
-			result = (PlanState *) ExecInitSort((Sort *) node,
-												estate, eflags);
-			break;
-
-		case T_Group:
-			result = (PlanState *) ExecInitGroup((Group *) node,
-												 estate, eflags);
-			break;
-
-		case T_Agg:
-			result = (PlanState *) ExecInitAgg((Agg *) node,
-											   estate, eflags);
-			break;
-
-		case T_WindowAgg:
-			result = (PlanState *) ExecInitWindowAgg((WindowAgg *) node,
-													 estate, eflags);
-			break;
-
-		case T_Unique:
-			result = (PlanState *) ExecInitUnique((Unique *) node,
-												  estate, eflags);
-			break;
-
-		case T_Gather:
-			result = (PlanState *) ExecInitGather((Gather *) node,
-												  estate, eflags);
-			break;
-
-		case T_GatherMerge:
-			result = (PlanState *) ExecInitGatherMerge((GatherMerge *) node,
-													   estate, eflags);
-			break;
-
-		case T_Hash:
-			result = (PlanState *) ExecInitHash((Hash *) node,
-												estate, eflags);
-			break;
-
-		case T_SetOp:
-			result = (PlanState *) ExecInitSetOp((SetOp *) node,
-												 estate, eflags);
-			break;
-
-		case T_LockRows:
-			result = (PlanState *) ExecInitLockRows((LockRows *) node,
-													estate, eflags);
-			break;
-
-		case T_Limit:
-			result = (PlanState *) ExecInitLimit((Limit *) node,
-												 estate, eflags);
-			break;
-
 		default:
-			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
+			elog(ERROR, "unrecognized/unsupported node type: %d",
+				 (int) nodeTag(node));
 			result = NULL;		/* keep compiler quiet */
 			break;
 	}
-
-	/*
-	 * Initialize any initPlans present in this node.  The planner put them in
-	 * a separate list for us.
-	 */
-	subps = NIL;
-	foreach(l, node->initPlan)
-	{
-		SubPlan    *subplan = (SubPlan *) lfirst(l);
-		SubPlanState *sstate;
-
-		Assert(IsA(subplan, SubPlan));
-		sstate = ExecInitSubPlan(subplan, result);
-		subps = lappend(subps, sstate);
-	}
-	result->initPlan = subps;
+	return NULL;
 
 	/* Set up instrumentation for this node if requested */
 	if (estate->es_instrument)
@@ -383,253 +165,27 @@ ExecInitNode(Plan *node, EState *estate, int eflags, PlanState *parent)
 }
 
 
-/* ----------------------------------------------------------------
- *		ExecProcNode
- *
- *		Execute the given node to return a(nother) tuple.
- * ----------------------------------------------------------------
+/*
+ * Unsupported, left to avoid deleting 19k lines of existing code
  */
 TupleTableSlot *
 ExecProcNode(PlanState *node)
 {
-	TupleTableSlot *result;
-
-	CHECK_FOR_INTERRUPTS();
-
-	if (node->chgParam != NULL) /* something changed */
-		ExecReScan(node);		/* let ReScan handle this */
-
-	if (node->instrument)
-		InstrStartNode(node->instrument);
-
-	switch (nodeTag(node))
-	{
-			/*
-			 * control nodes
-			 */
-		case T_ResultState:
-			result = ExecResult((ResultState *) node);
-			break;
-
-		case T_ProjectSetState:
-			result = ExecProjectSet((ProjectSetState *) node);
-			break;
-
-		case T_ModifyTableState:
-			result = ExecModifyTable((ModifyTableState *) node);
-			break;
-
-		case T_AppendState:
-			result = ExecAppend((AppendState *) node);
-			break;
-
-		case T_MergeAppendState:
-			result = ExecMergeAppend((MergeAppendState *) node);
-			break;
-
-		case T_RecursiveUnionState:
-			result = ExecRecursiveUnion((RecursiveUnionState *) node);
-			break;
-
-			/* BitmapAndState does not yield tuples */
-
-			/* BitmapOrState does not yield tuples */
-
-			/*
-			 * scan nodes
-			 */
-		case T_SeqScanState:
-			result = ExecSeqScan((SeqScanState *) node);
-			break;
-
-		case T_SampleScanState:
-			result = ExecSampleScan((SampleScanState *) node);
-			break;
-
-		case T_IndexScanState:
-			result = ExecIndexScan((IndexScanState *) node);
-			break;
-
-		case T_IndexOnlyScanState:
-			result = ExecIndexOnlyScan((IndexOnlyScanState *) node);
-			break;
-
-			/* BitmapIndexScanState does not yield tuples */
-
-		case T_BitmapHeapScanState:
-			result = ExecBitmapHeapScan((BitmapHeapScanState *) node);
-			break;
-
-		case T_TidScanState:
-			result = ExecTidScan((TidScanState *) node);
-			break;
-
-		case T_SubqueryScanState:
-			result = ExecSubqueryScan((SubqueryScanState *) node);
-			break;
-
-		case T_FunctionScanState:
-			result = ExecFunctionScan((FunctionScanState *) node);
-			break;
-
-		case T_TableFuncScanState:
-			result = ExecTableFuncScan((TableFuncScanState *) node);
-			break;
-
-		case T_ValuesScanState:
-			result = ExecValuesScan((ValuesScanState *) node);
-			break;
-
-		case T_CteScanState:
-			result = ExecCteScan((CteScanState *) node);
-			break;
-
-		case T_WorkTableScanState:
-			result = ExecWorkTableScan((WorkTableScanState *) node);
-			break;
-
-		case T_ForeignScanState:
-			result = ExecForeignScan((ForeignScanState *) node);
-			break;
-
-		case T_CustomScanState:
-			result = ExecCustomScan((CustomScanState *) node);
-			break;
-
-			/*
-			 * join nodes
-			 */
-		case T_NestLoopState:
-			result = ExecNestLoop((NestLoopState *) node);
-			break;
-
-		case T_MergeJoinState:
-			result = ExecMergeJoin((MergeJoinState *) node);
-			break;
-
-		case T_HashJoinState:
-			result = ExecHashJoin((HashJoinState *) node);
-			break;
-
-			/*
-			 * materialization nodes
-			 */
-		case T_MaterialState:
-			result = ExecMaterial((MaterialState *) node);
-			break;
-
-		case T_SortState:
-			result = ExecSort((SortState *) node);
-			break;
-
-		case T_GroupState:
-			result = ExecGroup((GroupState *) node);
-			break;
-
-		case T_AggState:
-			result = ExecAgg((AggState *) node);
-			break;
-
-		case T_WindowAggState:
-			result = ExecWindowAgg((WindowAggState *) node);
-			break;
-
-		case T_UniqueState:
-			result = ExecUnique((UniqueState *) node);
-			break;
-
-		case T_GatherState:
-			result = ExecGather((GatherState *) node);
-			break;
-
-		case T_GatherMergeState:
-			result = ExecGatherMerge((GatherMergeState *) node);
-			break;
-
-		case T_HashState:
-			result = ExecHash((HashState *) node);
-			break;
-
-		case T_SetOpState:
-			result = ExecSetOp((SetOpState *) node);
-			break;
-
-		case T_LockRowsState:
-			result = ExecLockRows((LockRowsState *) node);
-			break;
-
-		case T_LimitState:
-			result = ExecLimit((LimitState *) node);
-			break;
-
-		default:
-			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
-			result = NULL;
-			break;
-	}
-
-	if (node->instrument)
-		InstrStopNode(node->instrument, TupIsNull(result) ? 0.0 : 1.0);
-
-	return result;
+	elog(ERROR, "ExecProcNode is not supported");
+	return NULL;
 }
 
-
 /* ----------------------------------------------------------------
- *		MultiExecProcNode
- *
- *		Execute a node that doesn't return individual tuples
- *		(it might return a hashtable, bitmap, etc).  Caller should
- *		check it got back the expected kind of Node.
- *
- * This has essentially the same responsibilities as ExecProcNode,
- * but it does not do InstrStartNode/InstrStopNode (mainly because
- * it can't tell how many returned tuples to count).  Each per-node
- * function must provide its own instrumentation support.
+ * Unsupported too; we don't need it in push model
  * ----------------------------------------------------------------
  */
 Node *
 MultiExecProcNode(PlanState *node)
 {
-	Node	   *result;
-
-	CHECK_FOR_INTERRUPTS();
-
-	if (node->chgParam != NULL) /* something changed */
-		ExecReScan(node);		/* let ReScan handle this */
-
-	switch (nodeTag(node))
-	{
-			/*
-			 * Only node types that actually support multiexec will be listed
-			 */
-
-		case T_HashState:
-			result = MultiExecHash((HashState *) node);
-			break;
-
-		case T_BitmapIndexScanState:
-			result = MultiExecBitmapIndexScan((BitmapIndexScanState *) node);
-			break;
-
-		case T_BitmapAndState:
-			result = MultiExecBitmapAnd((BitmapAndState *) node);
-			break;
-
-		case T_BitmapOrState:
-			result = MultiExecBitmapOr((BitmapOrState *) node);
-			break;
-
-		default:
-			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
-			result = NULL;
-			break;
-	}
-
-	return result;
+	elog(ERROR, "MultiExecProcNode is not supported");
+	return NULL;
 }
 
-
 /* ----------------------------------------------------------------
  *		ExecEndNode
  *
@@ -658,172 +214,9 @@ ExecEndNode(PlanState *node)
 
 	switch (nodeTag(node))
 	{
-			/*
-			 * control nodes
-			 */
-		case T_ResultState:
-			ExecEndResult((ResultState *) node);
-			break;
-
-		case T_ProjectSetState:
-			ExecEndProjectSet((ProjectSetState *) node);
-			break;
-
-		case T_ModifyTableState:
-			ExecEndModifyTable((ModifyTableState *) node);
-			break;
-
-		case T_AppendState:
-			ExecEndAppend((AppendState *) node);
-			break;
-
-		case T_MergeAppendState:
-			ExecEndMergeAppend((MergeAppendState *) node);
-			break;
-
-		case T_RecursiveUnionState:
-			ExecEndRecursiveUnion((RecursiveUnionState *) node);
-			break;
-
-		case T_BitmapAndState:
-			ExecEndBitmapAnd((BitmapAndState *) node);
-			break;
-
-		case T_BitmapOrState:
-			ExecEndBitmapOr((BitmapOrState *) node);
-			break;
-
-			/*
-			 * scan nodes
-			 */
-		case T_SeqScanState:
-			ExecEndSeqScan((SeqScanState *) node);
-			break;
-
-		case T_SampleScanState:
-			ExecEndSampleScan((SampleScanState *) node);
-			break;
-
-		case T_GatherState:
-			ExecEndGather((GatherState *) node);
-			break;
-
-		case T_GatherMergeState:
-			ExecEndGatherMerge((GatherMergeState *) node);
-			break;
-
-		case T_IndexScanState:
-			ExecEndIndexScan((IndexScanState *) node);
-			break;
-
-		case T_IndexOnlyScanState:
-			ExecEndIndexOnlyScan((IndexOnlyScanState *) node);
-			break;
-
-		case T_BitmapIndexScanState:
-			ExecEndBitmapIndexScan((BitmapIndexScanState *) node);
-			break;
-
-		case T_BitmapHeapScanState:
-			ExecEndBitmapHeapScan((BitmapHeapScanState *) node);
-			break;
-
-		case T_TidScanState:
-			ExecEndTidScan((TidScanState *) node);
-			break;
-
-		case T_SubqueryScanState:
-			ExecEndSubqueryScan((SubqueryScanState *) node);
-			break;
-
-		case T_FunctionScanState:
-			ExecEndFunctionScan((FunctionScanState *) node);
-			break;
-
-		case T_TableFuncScanState:
-			ExecEndTableFuncScan((TableFuncScanState *) node);
-			break;
-
-		case T_ValuesScanState:
-			ExecEndValuesScan((ValuesScanState *) node);
-			break;
-
-		case T_CteScanState:
-			ExecEndCteScan((CteScanState *) node);
-			break;
-
-		case T_WorkTableScanState:
-			ExecEndWorkTableScan((WorkTableScanState *) node);
-			break;
-
-		case T_ForeignScanState:
-			ExecEndForeignScan((ForeignScanState *) node);
-			break;
-
-		case T_CustomScanState:
-			ExecEndCustomScan((CustomScanState *) node);
-			break;
-
-			/*
-			 * join nodes
-			 */
-		case T_NestLoopState:
-			ExecEndNestLoop((NestLoopState *) node);
-			break;
-
-		case T_MergeJoinState:
-			ExecEndMergeJoin((MergeJoinState *) node);
-			break;
-
-		case T_HashJoinState:
-			ExecEndHashJoin((HashJoinState *) node);
-			break;
-
-			/*
-			 * materialization nodes
-			 */
-		case T_MaterialState:
-			ExecEndMaterial((MaterialState *) node);
-			break;
-
-		case T_SortState:
-			ExecEndSort((SortState *) node);
-			break;
-
-		case T_GroupState:
-			ExecEndGroup((GroupState *) node);
-			break;
-
-		case T_AggState:
-			ExecEndAgg((AggState *) node);
-			break;
-
-		case T_WindowAggState:
-			ExecEndWindowAgg((WindowAggState *) node);
-			break;
-
-		case T_UniqueState:
-			ExecEndUnique((UniqueState *) node);
-			break;
-
-		case T_HashState:
-			ExecEndHash((HashState *) node);
-			break;
-
-		case T_SetOpState:
-			ExecEndSetOp((SetOpState *) node);
-			break;
-
-		case T_LockRowsState:
-			ExecEndLockRows((LockRowsState *) node);
-			break;
-
-		case T_LimitState:
-			ExecEndLimit((LimitState *) node);
-			break;
-
 		default:
-			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
+			elog(ERROR, "unrecognized/unsupported node type: %d",
+				 (int) nodeTag(node));
 			break;
 	}
 }
-- 
2.11.0

