1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

Phase 1 of read-only-plans project: cause executor state nodes to point

to plan nodes, not vice-versa.  All executor state nodes now inherit from
struct PlanState.  Copying of plan trees has been simplified by not
storing a list of SubPlans in Plan nodes (eliminating duplicate links).
The executor still needs such a list, but it can build it during
ExecutorStart since it has to scan the plan tree anyway.
No initdb forced since no stored-on-disk structures changed, but you
will need a full recompile because of node-numbering changes.
This commit is contained in:
Tom Lane
2002-12-05 15:50:39 +00:00
parent 0f3b83edfa
commit 1fd0c59e25
71 changed files with 3032 additions and 3758 deletions

View File

@@ -3,27 +3,28 @@
* copyfuncs.c
* Copy functions for Postgres tree nodes.
*
* NOTE: a general convention when copying or comparing plan nodes is
* that we ignore the executor state subnode. We do not need to look
* at it because no current uses of copyObject() or equal() need to
* deal with already-executing plan trees. By leaving the state subnodes
* out, we avoid needing to write copy/compare routines for all the
* different executor state node types.
* NOTE: we currently support copying all node types found in parse and
* plan trees. We do not support copying executor state trees; there
* is no need for that, and no point in maintaining all the code that
* would be needed. We also do not support copying Path trees, mainly
* because the circular linkages between RelOptInfo and Path nodes can't
* be handled easily in a simple depth-first traversal.
*
*
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.225 2002/11/30 05:21:01 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.226 2002/12/05 15:50:34 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "optimizer/clauses.h"
#include "optimizer/planmain.h"
#include "nodes/parsenodes.h"
#include "nodes/plannodes.h"
#include "nodes/relation.h"
#include "utils/datum.h"
@@ -58,15 +59,6 @@
memcpy(newnode->fldname, from->fldname, _size); \
} while (0)
/* Special hack for fixing subplan lists of Plan nodes (ick) */
#define FIX_SUBPLAN_LINKS(subplanfldname, fldname) \
do { \
if (from->subplanfldname != NIL) \
newnode->subplanfldname = \
nconc(newnode->subplanfldname, \
pull_subplans((Node *) (newnode->fldname))); \
} while (0)
/*
* listCopy
@@ -119,19 +111,13 @@ CopyPlanFields(Plan *from, Plan *newnode)
COPY_SCALAR_FIELD(total_cost);
COPY_SCALAR_FIELD(plan_rows);
COPY_SCALAR_FIELD(plan_width);
/* execution state is NOT copied */
COPY_NODE_FIELD(targetlist);
COPY_NODE_FIELD(qual);
COPY_NODE_FIELD(lefttree);
COPY_NODE_FIELD(righttree);
COPY_NODE_FIELD(initPlan);
COPY_INTLIST_FIELD(extParam);
COPY_INTLIST_FIELD(locParam);
COPY_INTLIST_FIELD(chgParam);
COPY_NODE_FIELD(initPlan);
/* subPlan list must point to subplans in the new subtree, not the old */
newnode->subPlan = NIL;
FIX_SUBPLAN_LINKS(subPlan, targetlist);
FIX_SUBPLAN_LINKS(subPlan, qual);
COPY_SCALAR_FIELD(nParamExec);
}
@@ -170,9 +156,6 @@ _copyResult(Result *from)
*/
COPY_NODE_FIELD(resconstantqual);
/* subPlan list must point to subplans in the new subtree, not the old */
FIX_SUBPLAN_LINKS(plan.subPlan, resconstantqual);
return newnode;
}
@@ -266,10 +249,6 @@ _copyIndexScan(IndexScan *from)
COPY_NODE_FIELD(indxqualorig);
COPY_SCALAR_FIELD(indxorderdir);
/* subPlan list must point to subplans in the new subtree, not the old */
FIX_SUBPLAN_LINKS(scan.plan.subPlan, indxqual);
FIX_SUBPLAN_LINKS(scan.plan.subPlan, indxqualorig);
return newnode;
}
@@ -289,12 +268,8 @@ _copyTidScan(TidScan *from)
/*
* copy remainder of node
*/
COPY_SCALAR_FIELD(needRescan);
COPY_NODE_FIELD(tideval);
/* subPlan list must point to subplans in the new subtree, not the old */
FIX_SUBPLAN_LINKS(scan.plan.subPlan, tideval);
return newnode;
}
@@ -348,9 +323,6 @@ CopyJoinFields(Join *from, Join *newnode)
COPY_SCALAR_FIELD(jointype);
COPY_NODE_FIELD(joinqual);
/* subPlan list must point to subplans in the new subtree, not the old */
FIX_SUBPLAN_LINKS(plan.subPlan, joinqual);
}
@@ -406,9 +378,6 @@ _copyMergeJoin(MergeJoin *from)
*/
COPY_NODE_FIELD(mergeclauses);
/* subPlan list must point to subplans in the new subtree, not the old */
FIX_SUBPLAN_LINKS(join.plan.subPlan, mergeclauses);
return newnode;
}
@@ -430,9 +399,6 @@ _copyHashJoin(HashJoin *from)
*/
COPY_NODE_FIELD(hashclauses);
/* subPlan list must point to subplans in the new subtree, not the old */
FIX_SUBPLAN_LINKS(join.plan.subPlan, hashclauses);
return newnode;
}
@@ -530,6 +496,27 @@ _copyUnique(Unique *from)
return newnode;
}
/*
* _copyHash
*/
static Hash *
_copyHash(Hash *from)
{
Hash *newnode = makeNode(Hash);
/*
* copy node superclass fields
*/
CopyPlanFields((Plan *) from, (Plan *) newnode);
/*
* copy remainder of node
*/
COPY_NODE_FIELD(hashkeys);
return newnode;
}
/*
* _copySetOp
*/
@@ -576,29 +563,6 @@ _copyLimit(Limit *from)
return newnode;
}
/*
* _copyHash
*/
static Hash *
_copyHash(Hash *from)
{
Hash *newnode = makeNode(Hash);
/*
* copy node superclass fields
*/
CopyPlanFields((Plan *) from, (Plan *) newnode);
/*
* copy remainder of node
*/
COPY_NODE_FIELD(hashkeys);
/* XXX could the hashkeys contain subplans? Not at present... */
return newnode;
}
static SubPlan *
_copySubPlan(SubPlan *from)
{
@@ -611,10 +575,6 @@ _copySubPlan(SubPlan *from)
COPY_INTLIST_FIELD(parParam);
COPY_NODE_FIELD(sublink);
/* do not copy execution state */
newnode->needShutdown = false;
newnode->curTuple = NULL;
return newnode;
}
@@ -933,313 +893,11 @@ _copyArrayRef(ArrayRef *from)
/* ****************************************************************
* relation.h copy functions
*
* XXX the code to copy RelOptInfo and Path nodes is really completely bogus,
* because it makes no attempt to deal with multiple links from RelOptInfo
* to Paths, nor with back-links from Paths to their parent RelOptInfo.
* Currently, since we never actually try to copy a RelOptInfo, this is okay.
* We don't support copying RelOptInfo, IndexOptInfo, or Path nodes.
* There are some subsidiary structs that are useful to copy, though.
* ****************************************************************
*/
/*
* _copyRelOptInfo
*/
static RelOptInfo *
_copyRelOptInfo(RelOptInfo *from)
{
RelOptInfo *newnode = makeNode(RelOptInfo);
COPY_SCALAR_FIELD(reloptkind);
COPY_INTLIST_FIELD(relids);
COPY_SCALAR_FIELD(rows);
COPY_SCALAR_FIELD(width);
COPY_NODE_FIELD(targetlist);
COPY_NODE_FIELD(pathlist);
/* XXX cheapest-path fields should point to members of pathlist? */
COPY_NODE_FIELD(cheapest_startup_path);
COPY_NODE_FIELD(cheapest_total_path);
COPY_SCALAR_FIELD(pruneable);
COPY_SCALAR_FIELD(rtekind);
COPY_NODE_FIELD(indexlist);
COPY_SCALAR_FIELD(pages);
COPY_SCALAR_FIELD(tuples);
COPY_NODE_FIELD(subplan);
COPY_SCALAR_FIELD(joinrti);
COPY_INTLIST_FIELD(joinrteids);
COPY_NODE_FIELD(baserestrictinfo);
COPY_SCALAR_FIELD(baserestrictcost);
COPY_INTLIST_FIELD(outerjoinset);
COPY_NODE_FIELD(joininfo);
COPY_INTLIST_FIELD(index_outer_relids);
COPY_NODE_FIELD(index_inner_paths);
return newnode;
}
/*
* _copyIndexOptInfo
*/
static IndexOptInfo *
_copyIndexOptInfo(IndexOptInfo *from)
{
IndexOptInfo *newnode = makeNode(IndexOptInfo);
COPY_SCALAR_FIELD(indexoid);
COPY_SCALAR_FIELD(pages);
COPY_SCALAR_FIELD(tuples);
COPY_SCALAR_FIELD(ncolumns);
COPY_SCALAR_FIELD(nkeys);
if (from->classlist)
{
/* copy the trailing zero too */
COPY_POINTER_FIELD(classlist, (from->ncolumns + 1) * sizeof(Oid));
}
if (from->indexkeys)
{
/* copy the trailing zero too */
COPY_POINTER_FIELD(indexkeys, (from->nkeys + 1) * sizeof(int));
}
if (from->ordering)
{
/* copy the trailing zero too */
COPY_POINTER_FIELD(ordering, (from->ncolumns + 1) * sizeof(Oid));
}
COPY_SCALAR_FIELD(relam);
COPY_SCALAR_FIELD(amcostestimate);
COPY_SCALAR_FIELD(indproc);
COPY_NODE_FIELD(indpred);
COPY_SCALAR_FIELD(unique);
COPY_INTLIST_FIELD(outer_relids);
COPY_NODE_FIELD(inner_paths);
return newnode;
}
/*
* CopyPathFields
*
* This function copies the fields of the Path node. It is used by
* all the copy functions for classes which inherit from Path.
*/
static void
CopyPathFields(Path *from, Path *newnode)
{
/*
* Modify the next line, since it causes the copying to cycle (i.e.
* the parent points right back here! -- JMH, 7/7/92. Old version:
* COPY_NODE_FIELD(parent);
*/
COPY_SCALAR_FIELD(parent);
COPY_SCALAR_FIELD(startup_cost);
COPY_SCALAR_FIELD(total_cost);
COPY_SCALAR_FIELD(pathtype);
COPY_NODE_FIELD(pathkeys);
}
/*
* _copyPath
*/
static Path *
_copyPath(Path *from)
{
Path *newnode = makeNode(Path);
CopyPathFields(from, newnode);
return newnode;
}
/*
* _copyIndexPath
*/
static IndexPath *
_copyIndexPath(IndexPath *from)
{
IndexPath *newnode = makeNode(IndexPath);
/*
* copy node superclass fields
*/
CopyPathFields((Path *) from, (Path *) newnode);
/*
* copy remainder of node
*/
COPY_NODE_FIELD(indexinfo);
COPY_NODE_FIELD(indexqual);
COPY_SCALAR_FIELD(indexscandir);
COPY_SCALAR_FIELD(rows);
return newnode;
}
/*
* _copyTidPath
*/
static TidPath *
_copyTidPath(TidPath *from)
{
TidPath *newnode = makeNode(TidPath);
/*
* copy node superclass fields
*/
CopyPathFields((Path *) from, (Path *) newnode);
/*
* copy remainder of node
*/
COPY_NODE_FIELD(tideval);
COPY_INTLIST_FIELD(unjoined_relids);
return newnode;
}
/*
* _copyAppendPath
*/
static AppendPath *
_copyAppendPath(AppendPath *from)
{
AppendPath *newnode = makeNode(AppendPath);
/*
* copy node superclass fields
*/
CopyPathFields((Path *) from, (Path *) newnode);
/*
* copy remainder of node
*/
COPY_NODE_FIELD(subpaths);
return newnode;
}
/*
* _copyResultPath
*/
static ResultPath *
_copyResultPath(ResultPath *from)
{
ResultPath *newnode = makeNode(ResultPath);
/*
* copy node superclass fields
*/
CopyPathFields((Path *) from, (Path *) newnode);
/*
* copy remainder of node
*/
COPY_NODE_FIELD(subpath);
COPY_NODE_FIELD(constantqual);
return newnode;
}
/*
* _copyMaterialPath
*/
static MaterialPath *
_copyMaterialPath(MaterialPath *from)
{
MaterialPath *newnode = makeNode(MaterialPath);
/*
* copy node superclass fields
*/
CopyPathFields((Path *) from, (Path *) newnode);
/*
* copy remainder of node
*/
COPY_NODE_FIELD(subpath);
return newnode;
}
/*
* CopyJoinPathFields
*
* This function copies the fields of the JoinPath node. It is used by
* all the copy functions for classes which inherit from JoinPath.
*/
static void
CopyJoinPathFields(JoinPath *from, JoinPath *newnode)
{
CopyPathFields((Path *) from, (Path *) newnode);
COPY_SCALAR_FIELD(jointype);
COPY_NODE_FIELD(outerjoinpath);
COPY_NODE_FIELD(innerjoinpath);
COPY_NODE_FIELD(joinrestrictinfo);
}
/*
* _copyNestPath
*/
static NestPath *
_copyNestPath(NestPath *from)
{
NestPath *newnode = makeNode(NestPath);
/*
* copy node superclass fields
*/
CopyJoinPathFields((JoinPath *) from, (JoinPath *) newnode);
return newnode;
}
/*
* _copyMergePath
*/
static MergePath *
_copyMergePath(MergePath *from)
{
MergePath *newnode = makeNode(MergePath);
/*
* copy node superclass fields
*/
CopyJoinPathFields((JoinPath *) from, (JoinPath *) newnode);
/*
* copy remainder of node
*/
COPY_NODE_FIELD(path_mergeclauses);
COPY_NODE_FIELD(outersortkeys);
COPY_NODE_FIELD(innersortkeys);
return newnode;
}
/*
* _copyHashPath
*/
static HashPath *
_copyHashPath(HashPath *from)
{
HashPath *newnode = makeNode(HashPath);
/*
* copy node superclass fields
*/
CopyJoinPathFields((JoinPath *) from, (JoinPath *) newnode);
/*
* copy remainder of node
*/
COPY_NODE_FIELD(path_hashclauses);
return newnode;
}
/*
* _copyPathKeyItem
*/
@@ -1301,21 +959,6 @@ _copyJoinInfo(JoinInfo *from)
return newnode;
}
/*
* _copyInnerIndexscanInfo
*/
static InnerIndexscanInfo *
_copyInnerIndexscanInfo(InnerIndexscanInfo *from)
{
InnerIndexscanInfo *newnode = makeNode(InnerIndexscanInfo);
COPY_INTLIST_FIELD(other_relids);
COPY_SCALAR_FIELD(isouterjoin);
COPY_NODE_FIELD(best_innerpath);
return newnode;
}
/* ****************************************************************
* parsenodes.h copy functions
* ****************************************************************
@@ -1737,7 +1380,8 @@ _copyQuery(Query *from)
/*
* We do not copy the planner internal fields: base_rel_list,
* other_rel_list, join_rel_list, equi_key_list, query_pathkeys,
* hasJoinRTEs. Not entirely clear if this is right?
* hasJoinRTEs. That would get us into copying RelOptInfo/Path
* trees, which we don't want to do.
*/
return newnode;
@@ -2683,15 +2327,15 @@ copyObject(void *from)
case T_Unique:
retval = _copyUnique(from);
break;
case T_Hash:
retval = _copyHash(from);
break;
case T_SetOp:
retval = _copySetOp(from);
break;
case T_Limit:
retval = _copyLimit(from);
break;
case T_Hash:
retval = _copyHash(from);
break;
case T_SubPlan:
retval = _copySubPlan(from);
break;
@@ -2757,39 +2401,6 @@ copyObject(void *from)
/*
* RELATION NODES
*/
case T_RelOptInfo:
retval = _copyRelOptInfo(from);
break;
case T_IndexOptInfo:
retval = _copyIndexOptInfo(from);
break;
case T_Path:
retval = _copyPath(from);
break;
case T_IndexPath:
retval = _copyIndexPath(from);
break;
case T_TidPath:
retval = _copyTidPath(from);
break;
case T_AppendPath:
retval = _copyAppendPath(from);
break;
case T_ResultPath:
retval = _copyResultPath(from);
break;
case T_MaterialPath:
retval = _copyMaterialPath(from);
break;
case T_NestPath:
retval = _copyNestPath(from);
break;
case T_MergePath:
retval = _copyMergePath(from);
break;
case T_HashPath:
retval = _copyHashPath(from);
break;
case T_PathKeyItem:
retval = _copyPathKeyItem(from);
break;
@@ -2799,9 +2410,6 @@ copyObject(void *from)
case T_JoinInfo:
retval = _copyJoinInfo(from);
break;
case T_InnerIndexscanInfo:
retval = _copyInnerIndexscanInfo(from);
break;
/*
* VALUE NODES

View File

@@ -3,30 +3,30 @@
* equalfuncs.c
* Equality functions to compare node trees.
*
* NOTE: a general convention when copying or comparing plan nodes is
* that we ignore the executor state subnode. We do not need to look
* at it because no current uses of copyObject() or equal() need to
* deal with already-executing plan trees. By leaving the state subnodes
* out, we avoid needing to write copy/compare routines for all the
* different executor state node types.
* NOTE: we currently support comparing all node types found in parse
* trees. We do not support comparing executor state trees; there
* is no need for that, and no point in maintaining all the code that
* would be needed. We also do not support comparing Path trees, mainly
* because the circular linkages between RelOptInfo and Path nodes can't
* be handled easily in a simple depth-first traversal.
*
* Currently, in fact, equal() doesn't know how to compare Plan nodes
* at all, let alone their executor-state subnodes. This will probably
* need to be fixed someday, but presently there is no need to compare
* plan trees.
* Currently, in fact, equal() doesn't know how to compare Plan trees
* either. This might need to be fixed someday.
*
*
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.170 2002/11/30 05:21:01 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.171 2002/12/05 15:50:34 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "nodes/params.h"
#include "nodes/parsenodes.h"
#include "nodes/plannodes.h"
#include "nodes/relation.h"
#include "utils/datum.h"
@@ -369,147 +369,6 @@ _equalSubPlan(SubPlan *a, SubPlan *b)
* Stuff from relation.h
*/
static bool
_equalRelOptInfo(RelOptInfo *a, RelOptInfo *b)
{
/*
* We treat RelOptInfos as equal if they refer to the same base rels
* joined in the same order. Is this appropriate/sufficient?
*/
COMPARE_INTLIST_FIELD(relids);
return true;
}
static bool
_equalIndexOptInfo(IndexOptInfo *a, IndexOptInfo *b)
{
/*
* We treat IndexOptInfos as equal if they refer to the same index. Is
* this sufficient?
*/
COMPARE_SCALAR_FIELD(indexoid);
return true;
}
static bool
_equalPath(Path *a, Path *b)
{
/* This is safe only because _equalRelOptInfo is incomplete... */
COMPARE_NODE_FIELD(parent);
/*
* do not check path costs, since they may not be set yet, and being
* float values there are roundoff error issues anyway...
*/
COMPARE_SCALAR_FIELD(pathtype);
COMPARE_NODE_FIELD(pathkeys);
return true;
}
static bool
_equalIndexPath(IndexPath *a, IndexPath *b)
{
if (!_equalPath((Path *) a, (Path *) b))
return false;
COMPARE_NODE_FIELD(indexinfo);
COMPARE_NODE_FIELD(indexqual);
COMPARE_SCALAR_FIELD(indexscandir);
/*
* Skip 'rows' because of possibility of floating-point roundoff
* error. It should be derivable from the other fields anyway.
*/
return true;
}
static bool
_equalTidPath(TidPath *a, TidPath *b)
{
if (!_equalPath((Path *) a, (Path *) b))
return false;
COMPARE_NODE_FIELD(tideval);
COMPARE_INTLIST_FIELD(unjoined_relids);
return true;
}
static bool
_equalAppendPath(AppendPath *a, AppendPath *b)
{
if (!_equalPath((Path *) a, (Path *) b))
return false;
COMPARE_NODE_FIELD(subpaths);
return true;
}
static bool
_equalResultPath(ResultPath *a, ResultPath *b)
{
if (!_equalPath((Path *) a, (Path *) b))
return false;
COMPARE_NODE_FIELD(subpath);
COMPARE_NODE_FIELD(constantqual);
return true;
}
static bool
_equalMaterialPath(MaterialPath *a, MaterialPath *b)
{
if (!_equalPath((Path *) a, (Path *) b))
return false;
COMPARE_NODE_FIELD(subpath);
return true;
}
static bool
_equalJoinPath(JoinPath *a, JoinPath *b)
{
if (!_equalPath((Path *) a, (Path *) b))
return false;
COMPARE_SCALAR_FIELD(jointype);
COMPARE_NODE_FIELD(outerjoinpath);
COMPARE_NODE_FIELD(innerjoinpath);
COMPARE_NODE_FIELD(joinrestrictinfo);
return true;
}
static bool
_equalNestPath(NestPath *a, NestPath *b)
{
if (!_equalJoinPath((JoinPath *) a, (JoinPath *) b))
return false;
return true;
}
static bool
_equalMergePath(MergePath *a, MergePath *b)
{
if (!_equalJoinPath((JoinPath *) a, (JoinPath *) b))
return false;
COMPARE_NODE_FIELD(path_mergeclauses);
COMPARE_NODE_FIELD(outersortkeys);
COMPARE_NODE_FIELD(innersortkeys);
return true;
}
static bool
_equalHashPath(HashPath *a, HashPath *b)
{
if (!_equalJoinPath((JoinPath *) a, (JoinPath *) b))
return false;
COMPARE_NODE_FIELD(path_hashclauses);
return true;
}
static bool
_equalPathKeyItem(PathKeyItem *a, PathKeyItem *b)
{
@@ -547,16 +406,6 @@ _equalJoinInfo(JoinInfo *a, JoinInfo *b)
return true;
}
static bool
_equalInnerIndexscanInfo(InnerIndexscanInfo *a, InnerIndexscanInfo *b)
{
COMPARE_INTLIST_FIELD(other_relids);
COMPARE_SCALAR_FIELD(isouterjoin);
COMPARE_NODE_FIELD(best_innerpath);
return true;
}
/*
* Stuff from parsenodes.h
@@ -1711,39 +1560,6 @@ equal(void *a, void *b)
retval = _equalJoinExpr(a, b);
break;
case T_RelOptInfo:
retval = _equalRelOptInfo(a, b);
break;
case T_IndexOptInfo:
retval = _equalIndexOptInfo(a, b);
break;
case T_Path:
retval = _equalPath(a, b);
break;
case T_IndexPath:
retval = _equalIndexPath(a, b);
break;
case T_TidPath:
retval = _equalTidPath(a, b);
break;
case T_AppendPath:
retval = _equalAppendPath(a, b);
break;
case T_ResultPath:
retval = _equalResultPath(a, b);
break;
case T_MaterialPath:
retval = _equalMaterialPath(a, b);
break;
case T_NestPath:
retval = _equalNestPath(a, b);
break;
case T_MergePath:
retval = _equalMergePath(a, b);
break;
case T_HashPath:
retval = _equalHashPath(a, b);
break;
case T_PathKeyItem:
retval = _equalPathKeyItem(a, b);
break;
@@ -1753,9 +1569,6 @@ equal(void *a, void *b)
case T_JoinInfo:
retval = _equalJoinInfo(a, b);
break;
case T_InnerIndexscanInfo:
retval = _equalInnerIndexscanInfo(a, b);
break;
case T_List:
{

View File

@@ -8,13 +8,13 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.185 2002/11/30 05:21:02 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.186 2002/12/05 15:50:35 tgl Exp $
*
* NOTES
* Every node type that can appear in stored rules' parsetrees *must*
* have an output function defined here (as well as an input function
* in readfuncs.c). For use in debugging, we also provide output
* functions for nodes that appear in raw parsetrees and plan trees.
* functions for nodes that appear in raw parsetrees, path, and plan trees.
* These nodes however need not have input functions.
*
*-------------------------------------------------------------------------
@@ -24,10 +24,8 @@
#include <ctype.h>
#include "lib/stringinfo.h"
#include "nodes/nodes.h"
#include "nodes/parsenodes.h"
#include "nodes/plannodes.h"
#include "nodes/primnodes.h"
#include "nodes/relation.h"
#include "parser/parse.h"
#include "utils/datum.h"
@@ -385,11 +383,9 @@ _outPlanInfo(StringInfo str, Plan *node)
WRITE_NODE_FIELD(qual);
WRITE_NODE_FIELD(lefttree);
WRITE_NODE_FIELD(righttree);
WRITE_NODE_FIELD(initPlan);
WRITE_INTLIST_FIELD(extParam);
WRITE_INTLIST_FIELD(locParam);
/* chgParam is execution state too */
WRITE_NODE_FIELD(initPlan);
/* we don't write subPlan; reader must reconstruct list */
WRITE_INT_FIELD(nParamExec);
}
@@ -482,7 +478,6 @@ _outTidScan(StringInfo str, TidScan *node)
_outScanInfo(str, (Scan *) node);
WRITE_BOOL_FIELD(needRescan);
WRITE_NODE_FIELD(tideval);
}
@@ -930,6 +925,8 @@ _outRangeTblEntry(StringInfo str, RangeTblEntry *node)
/*
* print the basic stuff of all nodes that inherit from Path
*
* Note we do NOT print the parent, else we'd be in infinite recursion
*/
static void
_outPathInfo(StringInfo str, Path *node)
@@ -986,7 +983,6 @@ _outTidPath(StringInfo str, TidPath *node)
_outPathInfo(str, (Path *) node);
WRITE_NODE_FIELD(tideval);
WRITE_INTLIST_FIELD(unjoined_relids);
}
static void