const correctness

Started by Thomas Munroabout 14 years ago50 messages
#1Thomas Munro
munro@ip9.org
1 attachment(s)

Hi pgsql-hackers,

I am a long time user and fan of PostgreSQL and have built various
projects large and small on every major release since 6.5. Recently
I decided to try doing something more with the source than just
compiling it, and spent some time 'constifying' some parts of the code
as an exercise (this is an item I saw on the wiki to-do list, and I
figured it might provide me with an educational traversal of the
source tree).

I started looking at backend/nodes (thinking that operations on core
data structures need to be const-friendly before other bits of the
software can), and made the following apparently simple changes:

1. copyObject should take the object to be copied by pointer-to-const
(and therefore so should all the static functions in copyfuncs.c).

2. equal should take the objects to be compared by pointer-to-const
(and therefore so should all the static functions in
equalfuncs.c). Things started to get a bit trickier when dealing
with equality of lists... see below.

3. print, pprint, and various other print functions in print.c should
take the object to be printed/logged with a pointer-to-const
(except print_slot which modifies the slot object in code I don't
yet understand in heaptuple.c).

4. nodeToString should take the object to be written by
pointer-to-const (and therefore so should all the static functions
in outfuncs.c).

5. exprType, exprTypmod, exprIsLengthCoercion, exprCollation,
exprInputCollation, exprLocation should take the expression node
by pointer-to-const (but the functions in nodeFuncs.c that are
implemented via expression_tree_walker are trickier, see note at
end[1]For functions built on top of expression_tree_walker (like expression_returns_set), it seems that it and therefore they can be modified to work entirely on pointers to const Node without any complaints from GCC at least, but only because the walker function pointer is of type bool (*)() (that is, pointer to a function with unspecified arguments, thereby side-stepping all static type checking). But I guess it would only be honest to change the signature of expression_tree_walker to take const Node * if the type of the walker function pointer were changed to bool (*)(const Node *, void *), and the walker mechanism were declared in the comments not to permit any mutation at all (rather than the weaker restriction that routines can modify nodes in-place but not add/delete/replace nodes).).

6. list_length, check_list_invariants, list_copy...,
list_difference..., list_union..., list_intersection,
list_member..., list_nth... should take const List * (and probably
const void * where applicable for datum but only when it is not
captured).

So far so good, but I found that I also needed these extra functions:

7. I made a list_head_const function, which can be used used to get a
pointer to the head cell when you have a pointer to const List; I
needed that so I could make foreach_const and forboth_const; they
were needed to be able to make list_member, _equalList and various
other list-visiting functions work with const List objects.

Perhaps there should be a few more 'XXX_const' accessor function
variants, for example list_nth_const, to allow holders of pointers to
const lists to get a read-only view of the contained data, ie
preventing them from accessing pointers to non-const element (based on
the possibly flawed intuition that a const list should be considered
to have const elements, like std::list<T> in C++, for the constness to
be really useful). Or pehaps that's ridiculous overkill for little
gain in a language with such a blunt and frequently used cast
operator.

I have attached a patch illustrating the changes (don't worry I'm not
submitting it for consideration, I just wanted to discuss the idea at
this stage and generally test the water). I would be grateful for
opinions on whether this approach could be useful. Being new to all
this I have no idea if destructive vs non-destructive confusion (for
example lcons and lappend modifying their arguments) is really a
source of bugs, and more generally what the project's take is on the
appropriate uses of const.

What did the author of the to-do item "Add use of 'const' for
variables in source tree" have in mind, and am I even barking up the
right tree?

Thanks,

Thomas Munro

[1]: For functions built on top of expression_tree_walker (like expression_returns_set), it seems that it and therefore they can be modified to work entirely on pointers to const Node without any complaints from GCC at least, but only because the walker function pointer is of type bool (*)() (that is, pointer to a function with unspecified arguments, thereby side-stepping all static type checking). But I guess it would only be honest to change the signature of expression_tree_walker to take const Node * if the type of the walker function pointer were changed to bool (*)(const Node *, void *), and the walker mechanism were declared in the comments not to permit any mutation at all (rather than the weaker restriction that routines can modify nodes in-place but not add/delete/replace nodes).
expression_returns_set), it seems that it and therefore they can be
modified to work entirely on pointers to const Node without any
complaints from GCC at least, but only because the walker function
pointer is of type bool (*)() (that is, pointer to a function with
unspecified arguments, thereby side-stepping all static type
checking). But I guess it would only be honest to change the
signature of expression_tree_walker to take const Node * if the type
of the walker function pointer were changed to bool (*)(const Node *,
void *), and the walker mechanism were declared in the comments not to
permit any mutation at all (rather than the weaker restriction that
routines can modify nodes in-place but not add/delete/replace nodes).

Attachments:

constify-1.patchtext/x-patch; charset=US-ASCII; name=constify-1.patchDownload
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
new file mode 100644
index 63958c3..fb66b43
*** a/src/backend/nodes/copyfuncs.c
--- b/src/backend/nodes/copyfuncs.c
***************
*** 72,78 ****
   * _copyPlannedStmt
   */
  static PlannedStmt *
! _copyPlannedStmt(PlannedStmt *from)
  {
  	PlannedStmt *newnode = makeNode(PlannedStmt);
  
--- 72,78 ----
   * _copyPlannedStmt
   */
  static PlannedStmt *
! _copyPlannedStmt(const PlannedStmt *from)
  {
  	PlannedStmt *newnode = makeNode(PlannedStmt);
  
*************** _copyPlannedStmt(PlannedStmt *from)
*** 103,109 ****
   *		all the copy functions for classes which inherit from Plan.
   */
  static void
! CopyPlanFields(Plan *from, Plan *newnode)
  {
  	COPY_SCALAR_FIELD(startup_cost);
  	COPY_SCALAR_FIELD(total_cost);
--- 103,109 ----
   *		all the copy functions for classes which inherit from Plan.
   */
  static void
! CopyPlanFields(const Plan *from, Plan *newnode)
  {
  	COPY_SCALAR_FIELD(startup_cost);
  	COPY_SCALAR_FIELD(total_cost);
*************** CopyPlanFields(Plan *from, Plan *newnode
*** 122,128 ****
   * _copyPlan
   */
  static Plan *
! _copyPlan(Plan *from)
  {
  	Plan	   *newnode = makeNode(Plan);
  
--- 122,128 ----
   * _copyPlan
   */
  static Plan *
! _copyPlan(const Plan *from)
  {
  	Plan	   *newnode = makeNode(Plan);
  
*************** _copyPlan(Plan *from)
*** 139,145 ****
   * _copyResult
   */
  static Result *
! _copyResult(Result *from)
  {
  	Result	   *newnode = makeNode(Result);
  
--- 139,145 ----
   * _copyResult
   */
  static Result *
! _copyResult(const Result *from)
  {
  	Result	   *newnode = makeNode(Result);
  
*************** _copyResult(Result *from)
*** 160,166 ****
   * _copyModifyTable
   */
  static ModifyTable *
! _copyModifyTable(ModifyTable *from)
  {
  	ModifyTable *newnode = makeNode(ModifyTable);
  
--- 160,166 ----
   * _copyModifyTable
   */
  static ModifyTable *
! _copyModifyTable(const ModifyTable *from)
  {
  	ModifyTable *newnode = makeNode(ModifyTable);
  
*************** _copyModifyTable(ModifyTable *from)
*** 188,194 ****
   * _copyAppend
   */
  static Append *
! _copyAppend(Append *from)
  {
  	Append	   *newnode = makeNode(Append);
  
--- 188,194 ----
   * _copyAppend
   */
  static Append *
! _copyAppend(const Append *from)
  {
  	Append	   *newnode = makeNode(Append);
  
*************** _copyAppend(Append *from)
*** 209,215 ****
   * _copyMergeAppend
   */
  static MergeAppend *
! _copyMergeAppend(MergeAppend *from)
  {
  	MergeAppend *newnode = makeNode(MergeAppend);
  
--- 209,215 ----
   * _copyMergeAppend
   */
  static MergeAppend *
! _copyMergeAppend(const MergeAppend *from)
  {
  	MergeAppend *newnode = makeNode(MergeAppend);
  
*************** _copyMergeAppend(MergeAppend *from)
*** 235,241 ****
   * _copyRecursiveUnion
   */
  static RecursiveUnion *
! _copyRecursiveUnion(RecursiveUnion *from)
  {
  	RecursiveUnion *newnode = makeNode(RecursiveUnion);
  
--- 235,241 ----
   * _copyRecursiveUnion
   */
  static RecursiveUnion *
! _copyRecursiveUnion(const RecursiveUnion *from)
  {
  	RecursiveUnion *newnode = makeNode(RecursiveUnion);
  
*************** _copyRecursiveUnion(RecursiveUnion *from
*** 263,269 ****
   * _copyBitmapAnd
   */
  static BitmapAnd *
! _copyBitmapAnd(BitmapAnd *from)
  {
  	BitmapAnd  *newnode = makeNode(BitmapAnd);
  
--- 263,269 ----
   * _copyBitmapAnd
   */
  static BitmapAnd *
! _copyBitmapAnd(const BitmapAnd *from)
  {
  	BitmapAnd  *newnode = makeNode(BitmapAnd);
  
*************** _copyBitmapAnd(BitmapAnd *from)
*** 284,290 ****
   * _copyBitmapOr
   */
  static BitmapOr *
! _copyBitmapOr(BitmapOr *from)
  {
  	BitmapOr   *newnode = makeNode(BitmapOr);
  
--- 284,290 ----
   * _copyBitmapOr
   */
  static BitmapOr *
! _copyBitmapOr(const BitmapOr *from)
  {
  	BitmapOr   *newnode = makeNode(BitmapOr);
  
*************** _copyBitmapOr(BitmapOr *from)
*** 309,315 ****
   *		all the copy functions for classes which inherit from Scan.
   */
  static void
! CopyScanFields(Scan *from, Scan *newnode)
  {
  	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
--- 309,315 ----
   *		all the copy functions for classes which inherit from Scan.
   */
  static void
! CopyScanFields(const Scan *from, Scan *newnode)
  {
  	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
*************** CopyScanFields(Scan *from, Scan *newnode
*** 320,326 ****
   * _copyScan
   */
  static Scan *
! _copyScan(Scan *from)
  {
  	Scan	   *newnode = makeNode(Scan);
  
--- 320,326 ----
   * _copyScan
   */
  static Scan *
! _copyScan(const Scan *from)
  {
  	Scan	   *newnode = makeNode(Scan);
  
*************** _copyScan(Scan *from)
*** 336,342 ****
   * _copySeqScan
   */
  static SeqScan *
! _copySeqScan(SeqScan *from)
  {
  	SeqScan    *newnode = makeNode(SeqScan);
  
--- 336,342 ----
   * _copySeqScan
   */
  static SeqScan *
! _copySeqScan(const SeqScan *from)
  {
  	SeqScan    *newnode = makeNode(SeqScan);
  
*************** _copySeqScan(SeqScan *from)
*** 352,358 ****
   * _copyIndexScan
   */
  static IndexScan *
! _copyIndexScan(IndexScan *from)
  {
  	IndexScan  *newnode = makeNode(IndexScan);
  
--- 352,358 ----
   * _copyIndexScan
   */
  static IndexScan *
! _copyIndexScan(const IndexScan *from)
  {
  	IndexScan  *newnode = makeNode(IndexScan);
  
*************** _copyIndexScan(IndexScan *from)
*** 378,384 ****
   * _copyIndexOnlyScan
   */
  static IndexOnlyScan *
! _copyIndexOnlyScan(IndexOnlyScan *from)
  {
  	IndexOnlyScan  *newnode = makeNode(IndexOnlyScan);
  
--- 378,384 ----
   * _copyIndexOnlyScan
   */
  static IndexOnlyScan *
! _copyIndexOnlyScan(const IndexOnlyScan *from)
  {
  	IndexOnlyScan  *newnode = makeNode(IndexOnlyScan);
  
*************** _copyIndexOnlyScan(IndexOnlyScan *from)
*** 403,409 ****
   * _copyBitmapIndexScan
   */
  static BitmapIndexScan *
! _copyBitmapIndexScan(BitmapIndexScan *from)
  {
  	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
  
--- 403,409 ----
   * _copyBitmapIndexScan
   */
  static BitmapIndexScan *
! _copyBitmapIndexScan(const BitmapIndexScan *from)
  {
  	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
  
*************** _copyBitmapIndexScan(BitmapIndexScan *fr
*** 426,432 ****
   * _copyBitmapHeapScan
   */
  static BitmapHeapScan *
! _copyBitmapHeapScan(BitmapHeapScan *from)
  {
  	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
  
--- 426,432 ----
   * _copyBitmapHeapScan
   */
  static BitmapHeapScan *
! _copyBitmapHeapScan(const BitmapHeapScan *from)
  {
  	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
  
*************** _copyBitmapHeapScan(BitmapHeapScan *from
*** 447,453 ****
   * _copyTidScan
   */
  static TidScan *
! _copyTidScan(TidScan *from)
  {
  	TidScan    *newnode = makeNode(TidScan);
  
--- 447,453 ----
   * _copyTidScan
   */
  static TidScan *
! _copyTidScan(const TidScan *from)
  {
  	TidScan    *newnode = makeNode(TidScan);
  
*************** _copyTidScan(TidScan *from)
*** 468,474 ****
   * _copySubqueryScan
   */
  static SubqueryScan *
! _copySubqueryScan(SubqueryScan *from)
  {
  	SubqueryScan *newnode = makeNode(SubqueryScan);
  
--- 468,474 ----
   * _copySubqueryScan
   */
  static SubqueryScan *
! _copySubqueryScan(const SubqueryScan *from)
  {
  	SubqueryScan *newnode = makeNode(SubqueryScan);
  
*************** _copySubqueryScan(SubqueryScan *from)
*** 489,495 ****
   * _copyFunctionScan
   */
  static FunctionScan *
! _copyFunctionScan(FunctionScan *from)
  {
  	FunctionScan *newnode = makeNode(FunctionScan);
  
--- 489,495 ----
   * _copyFunctionScan
   */
  static FunctionScan *
! _copyFunctionScan(const FunctionScan *from)
  {
  	FunctionScan *newnode = makeNode(FunctionScan);
  
*************** _copyFunctionScan(FunctionScan *from)
*** 514,520 ****
   * _copyValuesScan
   */
  static ValuesScan *
! _copyValuesScan(ValuesScan *from)
  {
  	ValuesScan *newnode = makeNode(ValuesScan);
  
--- 514,520 ----
   * _copyValuesScan
   */
  static ValuesScan *
! _copyValuesScan(const ValuesScan *from)
  {
  	ValuesScan *newnode = makeNode(ValuesScan);
  
*************** _copyValuesScan(ValuesScan *from)
*** 535,541 ****
   * _copyCteScan
   */
  static CteScan *
! _copyCteScan(CteScan *from)
  {
  	CteScan    *newnode = makeNode(CteScan);
  
--- 535,541 ----
   * _copyCteScan
   */
  static CteScan *
! _copyCteScan(const CteScan *from)
  {
  	CteScan    *newnode = makeNode(CteScan);
  
*************** _copyCteScan(CteScan *from)
*** 557,563 ****
   * _copyWorkTableScan
   */
  static WorkTableScan *
! _copyWorkTableScan(WorkTableScan *from)
  {
  	WorkTableScan *newnode = makeNode(WorkTableScan);
  
--- 557,563 ----
   * _copyWorkTableScan
   */
  static WorkTableScan *
! _copyWorkTableScan(const WorkTableScan *from)
  {
  	WorkTableScan *newnode = makeNode(WorkTableScan);
  
*************** _copyWorkTableScan(WorkTableScan *from)
*** 578,584 ****
   * _copyForeignScan
   */
  static ForeignScan *
! _copyForeignScan(ForeignScan *from)
  {
  	ForeignScan *newnode = makeNode(ForeignScan);
  
--- 578,584 ----
   * _copyForeignScan
   */
  static ForeignScan *
! _copyForeignScan(const ForeignScan *from)
  {
  	ForeignScan *newnode = makeNode(ForeignScan);
  
*************** _copyForeignScan(ForeignScan *from)
*** 600,606 ****
   * _copyFdwPlan
   */
  static FdwPlan *
! _copyFdwPlan(FdwPlan *from)
  {
  	FdwPlan    *newnode = makeNode(FdwPlan);
  
--- 600,606 ----
   * _copyFdwPlan
   */
  static FdwPlan *
! _copyFdwPlan(const FdwPlan *from)
  {
  	FdwPlan    *newnode = makeNode(FdwPlan);
  
*************** _copyFdwPlan(FdwPlan *from)
*** 618,624 ****
   *		all the copy functions for classes which inherit from Join.
   */
  static void
! CopyJoinFields(Join *from, Join *newnode)
  {
  	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
--- 618,624 ----
   *		all the copy functions for classes which inherit from Join.
   */
  static void
! CopyJoinFields(const Join *from, Join *newnode)
  {
  	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
*************** CopyJoinFields(Join *from, Join *newnode
*** 631,637 ****
   * _copyJoin
   */
  static Join *
! _copyJoin(Join *from)
  {
  	Join	   *newnode = makeNode(Join);
  
--- 631,637 ----
   * _copyJoin
   */
  static Join *
! _copyJoin(const Join *from)
  {
  	Join	   *newnode = makeNode(Join);
  
*************** _copyJoin(Join *from)
*** 648,654 ****
   * _copyNestLoop
   */
  static NestLoop *
! _copyNestLoop(NestLoop *from)
  {
  	NestLoop   *newnode = makeNode(NestLoop);
  
--- 648,654 ----
   * _copyNestLoop
   */
  static NestLoop *
! _copyNestLoop(const NestLoop *from)
  {
  	NestLoop   *newnode = makeNode(NestLoop);
  
*************** _copyNestLoop(NestLoop *from)
*** 670,676 ****
   * _copyMergeJoin
   */
  static MergeJoin *
! _copyMergeJoin(MergeJoin *from)
  {
  	MergeJoin  *newnode = makeNode(MergeJoin);
  	int			numCols;
--- 670,676 ----
   * _copyMergeJoin
   */
  static MergeJoin *
! _copyMergeJoin(const MergeJoin *from)
  {
  	MergeJoin  *newnode = makeNode(MergeJoin);
  	int			numCols;
*************** _copyMergeJoin(MergeJoin *from)
*** 697,703 ****
   * _copyHashJoin
   */
  static HashJoin *
! _copyHashJoin(HashJoin *from)
  {
  	HashJoin   *newnode = makeNode(HashJoin);
  
--- 697,703 ----
   * _copyHashJoin
   */
  static HashJoin *
! _copyHashJoin(const HashJoin *from)
  {
  	HashJoin   *newnode = makeNode(HashJoin);
  
*************** _copyHashJoin(HashJoin *from)
*** 719,725 ****
   * _copyMaterial
   */
  static Material *
! _copyMaterial(Material *from)
  {
  	Material   *newnode = makeNode(Material);
  
--- 719,725 ----
   * _copyMaterial
   */
  static Material *
! _copyMaterial(const Material *from)
  {
  	Material   *newnode = makeNode(Material);
  
*************** _copyMaterial(Material *from)
*** 736,742 ****
   * _copySort
   */
  static Sort *
! _copySort(Sort *from)
  {
  	Sort	   *newnode = makeNode(Sort);
  
--- 736,742 ----
   * _copySort
   */
  static Sort *
! _copySort(const Sort *from)
  {
  	Sort	   *newnode = makeNode(Sort);
  
*************** _copySort(Sort *from)
*** 759,765 ****
   * _copyGroup
   */
  static Group *
! _copyGroup(Group *from)
  {
  	Group	   *newnode = makeNode(Group);
  
--- 759,765 ----
   * _copyGroup
   */
  static Group *
! _copyGroup(const Group *from)
  {
  	Group	   *newnode = makeNode(Group);
  
*************** _copyGroup(Group *from)
*** 776,782 ****
   * _copyAgg
   */
  static Agg *
! _copyAgg(Agg *from)
  {
  	Agg		   *newnode = makeNode(Agg);
  
--- 776,782 ----
   * _copyAgg
   */
  static Agg *
! _copyAgg(const Agg *from)
  {
  	Agg		   *newnode = makeNode(Agg);
  
*************** _copyAgg(Agg *from)
*** 798,804 ****
   * _copyWindowAgg
   */
  static WindowAgg *
! _copyWindowAgg(WindowAgg *from)
  {
  	WindowAgg  *newnode = makeNode(WindowAgg);
  
--- 798,804 ----
   * _copyWindowAgg
   */
  static WindowAgg *
! _copyWindowAgg(const WindowAgg *from)
  {
  	WindowAgg  *newnode = makeNode(WindowAgg);
  
*************** _copyWindowAgg(WindowAgg *from)
*** 828,834 ****
   * _copyUnique
   */
  static Unique *
! _copyUnique(Unique *from)
  {
  	Unique	   *newnode = makeNode(Unique);
  
--- 828,834 ----
   * _copyUnique
   */
  static Unique *
! _copyUnique(const Unique *from)
  {
  	Unique	   *newnode = makeNode(Unique);
  
*************** _copyUnique(Unique *from)
*** 851,857 ****
   * _copyHash
   */
  static Hash *
! _copyHash(Hash *from)
  {
  	Hash	   *newnode = makeNode(Hash);
  
--- 851,857 ----
   * _copyHash
   */
  static Hash *
! _copyHash(const Hash *from)
  {
  	Hash	   *newnode = makeNode(Hash);
  
*************** _copyHash(Hash *from)
*** 876,882 ****
   * _copySetOp
   */
  static SetOp *
! _copySetOp(SetOp *from)
  {
  	SetOp	   *newnode = makeNode(SetOp);
  
--- 876,882 ----
   * _copySetOp
   */
  static SetOp *
! _copySetOp(const SetOp *from)
  {
  	SetOp	   *newnode = makeNode(SetOp);
  
*************** _copySetOp(SetOp *from)
*** 904,910 ****
   * _copyLockRows
   */
  static LockRows *
! _copyLockRows(LockRows *from)
  {
  	LockRows   *newnode = makeNode(LockRows);
  
--- 904,910 ----
   * _copyLockRows
   */
  static LockRows *
! _copyLockRows(const LockRows *from)
  {
  	LockRows   *newnode = makeNode(LockRows);
  
*************** _copyLockRows(LockRows *from)
*** 926,932 ****
   * _copyLimit
   */
  static Limit *
! _copyLimit(Limit *from)
  {
  	Limit	   *newnode = makeNode(Limit);
  
--- 926,932 ----
   * _copyLimit
   */
  static Limit *
! _copyLimit(const Limit *from)
  {
  	Limit	   *newnode = makeNode(Limit);
  
*************** _copyLimit(Limit *from)
*** 948,954 ****
   * _copyNestLoopParam
   */
  static NestLoopParam *
! _copyNestLoopParam(NestLoopParam *from)
  {
  	NestLoopParam *newnode = makeNode(NestLoopParam);
  
--- 948,954 ----
   * _copyNestLoopParam
   */
  static NestLoopParam *
! _copyNestLoopParam(const NestLoopParam *from)
  {
  	NestLoopParam *newnode = makeNode(NestLoopParam);
  
*************** _copyNestLoopParam(NestLoopParam *from)
*** 962,968 ****
   * _copyPlanRowMark
   */
  static PlanRowMark *
! _copyPlanRowMark(PlanRowMark *from)
  {
  	PlanRowMark *newnode = makeNode(PlanRowMark);
  
--- 962,968 ----
   * _copyPlanRowMark
   */
  static PlanRowMark *
! _copyPlanRowMark(const PlanRowMark *from)
  {
  	PlanRowMark *newnode = makeNode(PlanRowMark);
  
*************** _copyPlanRowMark(PlanRowMark *from)
*** 980,986 ****
   * _copyPlanInvalItem
   */
  static PlanInvalItem *
! _copyPlanInvalItem(PlanInvalItem *from)
  {
  	PlanInvalItem *newnode = makeNode(PlanInvalItem);
  
--- 980,986 ----
   * _copyPlanInvalItem
   */
  static PlanInvalItem *
! _copyPlanInvalItem(const PlanInvalItem *from)
  {
  	PlanInvalItem *newnode = makeNode(PlanInvalItem);
  
*************** _copyPlanInvalItem(PlanInvalItem *from)
*** 999,1005 ****
   * _copyAlias
   */
  static Alias *
! _copyAlias(Alias *from)
  {
  	Alias	   *newnode = makeNode(Alias);
  
--- 999,1005 ----
   * _copyAlias
   */
  static Alias *
! _copyAlias(const Alias *from)
  {
  	Alias	   *newnode = makeNode(Alias);
  
*************** _copyAlias(Alias *from)
*** 1013,1019 ****
   * _copyRangeVar
   */
  static RangeVar *
! _copyRangeVar(RangeVar *from)
  {
  	RangeVar   *newnode = makeNode(RangeVar);
  
--- 1013,1019 ----
   * _copyRangeVar
   */
  static RangeVar *
! _copyRangeVar(const RangeVar *from)
  {
  	RangeVar   *newnode = makeNode(RangeVar);
  
*************** _copyRangeVar(RangeVar *from)
*** 1032,1038 ****
   * _copyIntoClause
   */
  static IntoClause *
! _copyIntoClause(IntoClause *from)
  {
  	IntoClause *newnode = makeNode(IntoClause);
  
--- 1032,1038 ----
   * _copyIntoClause
   */
  static IntoClause *
! _copyIntoClause(const IntoClause *from)
  {
  	IntoClause *newnode = makeNode(IntoClause);
  
*************** _copyIntoClause(IntoClause *from)
*** 1056,1062 ****
   * _copyVar
   */
  static Var *
! _copyVar(Var *from)
  {
  	Var		   *newnode = makeNode(Var);
  
--- 1056,1062 ----
   * _copyVar
   */
  static Var *
! _copyVar(const Var *from)
  {
  	Var		   *newnode = makeNode(Var);
  
*************** _copyVar(Var *from)
*** 1077,1083 ****
   * _copyConst
   */
  static Const *
! _copyConst(Const *from)
  {
  	Const	   *newnode = makeNode(Const);
  
--- 1077,1083 ----
   * _copyConst
   */
  static Const *
! _copyConst(const Const *from)
  {
  	Const	   *newnode = makeNode(Const);
  
*************** _copyConst(Const *from)
*** 1115,1121 ****
   * _copyParam
   */
  static Param *
! _copyParam(Param *from)
  {
  	Param	   *newnode = makeNode(Param);
  
--- 1115,1121 ----
   * _copyParam
   */
  static Param *
! _copyParam(const Param *from)
  {
  	Param	   *newnode = makeNode(Param);
  
*************** _copyParam(Param *from)
*** 1133,1139 ****
   * _copyAggref
   */
  static Aggref *
! _copyAggref(Aggref *from)
  {
  	Aggref	   *newnode = makeNode(Aggref);
  
--- 1133,1139 ----
   * _copyAggref
   */
  static Aggref *
! _copyAggref(const Aggref *from)
  {
  	Aggref	   *newnode = makeNode(Aggref);
  
*************** _copyAggref(Aggref *from)
*** 1155,1161 ****
   * _copyWindowFunc
   */
  static WindowFunc *
! _copyWindowFunc(WindowFunc *from)
  {
  	WindowFunc *newnode = makeNode(WindowFunc);
  
--- 1155,1161 ----
   * _copyWindowFunc
   */
  static WindowFunc *
! _copyWindowFunc(const WindowFunc *from)
  {
  	WindowFunc *newnode = makeNode(WindowFunc);
  
*************** _copyWindowFunc(WindowFunc *from)
*** 1176,1182 ****
   * _copyArrayRef
   */
  static ArrayRef *
! _copyArrayRef(ArrayRef *from)
  {
  	ArrayRef   *newnode = makeNode(ArrayRef);
  
--- 1176,1182 ----
   * _copyArrayRef
   */
  static ArrayRef *
! _copyArrayRef(const ArrayRef *from)
  {
  	ArrayRef   *newnode = makeNode(ArrayRef);
  
*************** _copyArrayRef(ArrayRef *from)
*** 1196,1202 ****
   * _copyFuncExpr
   */
  static FuncExpr *
! _copyFuncExpr(FuncExpr *from)
  {
  	FuncExpr   *newnode = makeNode(FuncExpr);
  
--- 1196,1202 ----
   * _copyFuncExpr
   */
  static FuncExpr *
! _copyFuncExpr(const FuncExpr *from)
  {
  	FuncExpr   *newnode = makeNode(FuncExpr);
  
*************** _copyFuncExpr(FuncExpr *from)
*** 1216,1222 ****
   * _copyNamedArgExpr *
   */
  static NamedArgExpr *
! _copyNamedArgExpr(NamedArgExpr *from)
  {
  	NamedArgExpr *newnode = makeNode(NamedArgExpr);
  
--- 1216,1222 ----
   * _copyNamedArgExpr *
   */
  static NamedArgExpr *
! _copyNamedArgExpr(const NamedArgExpr *from)
  {
  	NamedArgExpr *newnode = makeNode(NamedArgExpr);
  
*************** _copyNamedArgExpr(NamedArgExpr *from)
*** 1232,1238 ****
   * _copyOpExpr
   */
  static OpExpr *
! _copyOpExpr(OpExpr *from)
  {
  	OpExpr	   *newnode = makeNode(OpExpr);
  
--- 1232,1238 ----
   * _copyOpExpr
   */
  static OpExpr *
! _copyOpExpr(const OpExpr *from)
  {
  	OpExpr	   *newnode = makeNode(OpExpr);
  
*************** _copyOpExpr(OpExpr *from)
*** 1252,1258 ****
   * _copyDistinctExpr (same as OpExpr)
   */
  static DistinctExpr *
! _copyDistinctExpr(DistinctExpr *from)
  {
  	DistinctExpr *newnode = makeNode(DistinctExpr);
  
--- 1252,1258 ----
   * _copyDistinctExpr (same as OpExpr)
   */
  static DistinctExpr *
! _copyDistinctExpr(const DistinctExpr *from)
  {
  	DistinctExpr *newnode = makeNode(DistinctExpr);
  
*************** _copyDistinctExpr(DistinctExpr *from)
*** 1272,1278 ****
   * _copyNullIfExpr (same as OpExpr)
   */
  static NullIfExpr *
! _copyNullIfExpr(NullIfExpr *from)
  {
  	NullIfExpr *newnode = makeNode(NullIfExpr);
  
--- 1272,1278 ----
   * _copyNullIfExpr (same as OpExpr)
   */
  static NullIfExpr *
! _copyNullIfExpr(const NullIfExpr *from)
  {
  	NullIfExpr *newnode = makeNode(NullIfExpr);
  
*************** _copyNullIfExpr(NullIfExpr *from)
*** 1292,1298 ****
   * _copyScalarArrayOpExpr
   */
  static ScalarArrayOpExpr *
! _copyScalarArrayOpExpr(ScalarArrayOpExpr *from)
  {
  	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
  
--- 1292,1298 ----
   * _copyScalarArrayOpExpr
   */
  static ScalarArrayOpExpr *
! _copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
  {
  	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
  
*************** _copyScalarArrayOpExpr(ScalarArrayOpExpr
*** 1310,1316 ****
   * _copyBoolExpr
   */
  static BoolExpr *
! _copyBoolExpr(BoolExpr *from)
  {
  	BoolExpr   *newnode = makeNode(BoolExpr);
  
--- 1310,1316 ----
   * _copyBoolExpr
   */
  static BoolExpr *
! _copyBoolExpr(const BoolExpr *from)
  {
  	BoolExpr   *newnode = makeNode(BoolExpr);
  
*************** _copyBoolExpr(BoolExpr *from)
*** 1325,1331 ****
   * _copySubLink
   */
  static SubLink *
! _copySubLink(SubLink *from)
  {
  	SubLink    *newnode = makeNode(SubLink);
  
--- 1325,1331 ----
   * _copySubLink
   */
  static SubLink *
! _copySubLink(const SubLink *from)
  {
  	SubLink    *newnode = makeNode(SubLink);
  
*************** _copySubLink(SubLink *from)
*** 1342,1348 ****
   * _copySubPlan
   */
  static SubPlan *
! _copySubPlan(SubPlan *from)
  {
  	SubPlan    *newnode = makeNode(SubPlan);
  
--- 1342,1348 ----
   * _copySubPlan
   */
  static SubPlan *
! _copySubPlan(const SubPlan *from)
  {
  	SubPlan    *newnode = makeNode(SubPlan);
  
*************** _copySubPlan(SubPlan *from)
*** 1369,1375 ****
   * _copyAlternativeSubPlan
   */
  static AlternativeSubPlan *
! _copyAlternativeSubPlan(AlternativeSubPlan *from)
  {
  	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
  
--- 1369,1375 ----
   * _copyAlternativeSubPlan
   */
  static AlternativeSubPlan *
! _copyAlternativeSubPlan(const AlternativeSubPlan *from)
  {
  	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
  
*************** _copyAlternativeSubPlan(AlternativeSubPl
*** 1382,1388 ****
   * _copyFieldSelect
   */
  static FieldSelect *
! _copyFieldSelect(FieldSelect *from)
  {
  	FieldSelect *newnode = makeNode(FieldSelect);
  
--- 1382,1388 ----
   * _copyFieldSelect
   */
  static FieldSelect *
! _copyFieldSelect(const FieldSelect *from)
  {
  	FieldSelect *newnode = makeNode(FieldSelect);
  
*************** _copyFieldSelect(FieldSelect *from)
*** 1399,1405 ****
   * _copyFieldStore
   */
  static FieldStore *
! _copyFieldStore(FieldStore *from)
  {
  	FieldStore *newnode = makeNode(FieldStore);
  
--- 1399,1405 ----
   * _copyFieldStore
   */
  static FieldStore *
! _copyFieldStore(const FieldStore *from)
  {
  	FieldStore *newnode = makeNode(FieldStore);
  
*************** _copyFieldStore(FieldStore *from)
*** 1415,1421 ****
   * _copyRelabelType
   */
  static RelabelType *
! _copyRelabelType(RelabelType *from)
  {
  	RelabelType *newnode = makeNode(RelabelType);
  
--- 1415,1421 ----
   * _copyRelabelType
   */
  static RelabelType *
! _copyRelabelType(const RelabelType *from)
  {
  	RelabelType *newnode = makeNode(RelabelType);
  
*************** _copyRelabelType(RelabelType *from)
*** 1433,1439 ****
   * _copyCoerceViaIO
   */
  static CoerceViaIO *
! _copyCoerceViaIO(CoerceViaIO *from)
  {
  	CoerceViaIO *newnode = makeNode(CoerceViaIO);
  
--- 1433,1439 ----
   * _copyCoerceViaIO
   */
  static CoerceViaIO *
! _copyCoerceViaIO(const CoerceViaIO *from)
  {
  	CoerceViaIO *newnode = makeNode(CoerceViaIO);
  
*************** _copyCoerceViaIO(CoerceViaIO *from)
*** 1450,1456 ****
   * _copyArrayCoerceExpr
   */
  static ArrayCoerceExpr *
! _copyArrayCoerceExpr(ArrayCoerceExpr *from)
  {
  	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
  
--- 1450,1456 ----
   * _copyArrayCoerceExpr
   */
  static ArrayCoerceExpr *
! _copyArrayCoerceExpr(const ArrayCoerceExpr *from)
  {
  	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
  
*************** _copyArrayCoerceExpr(ArrayCoerceExpr *fr
*** 1470,1476 ****
   * _copyConvertRowtypeExpr
   */
  static ConvertRowtypeExpr *
! _copyConvertRowtypeExpr(ConvertRowtypeExpr *from)
  {
  	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
  
--- 1470,1476 ----
   * _copyConvertRowtypeExpr
   */
  static ConvertRowtypeExpr *
! _copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
  {
  	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
  
*************** _copyConvertRowtypeExpr(ConvertRowtypeEx
*** 1486,1492 ****
   * _copyCollateExpr
   */
  static CollateExpr *
! _copyCollateExpr(CollateExpr *from)
  {
  	CollateExpr *newnode = makeNode(CollateExpr);
  
--- 1486,1492 ----
   * _copyCollateExpr
   */
  static CollateExpr *
! _copyCollateExpr(const CollateExpr *from)
  {
  	CollateExpr *newnode = makeNode(CollateExpr);
  
*************** _copyCollateExpr(CollateExpr *from)
*** 1501,1507 ****
   * _copyCaseExpr
   */
  static CaseExpr *
! _copyCaseExpr(CaseExpr *from)
  {
  	CaseExpr   *newnode = makeNode(CaseExpr);
  
--- 1501,1507 ----
   * _copyCaseExpr
   */
  static CaseExpr *
! _copyCaseExpr(const CaseExpr *from)
  {
  	CaseExpr   *newnode = makeNode(CaseExpr);
  
*************** _copyCaseExpr(CaseExpr *from)
*** 1519,1525 ****
   * _copyCaseWhen
   */
  static CaseWhen *
! _copyCaseWhen(CaseWhen *from)
  {
  	CaseWhen   *newnode = makeNode(CaseWhen);
  
--- 1519,1525 ----
   * _copyCaseWhen
   */
  static CaseWhen *
! _copyCaseWhen(const CaseWhen *from)
  {
  	CaseWhen   *newnode = makeNode(CaseWhen);
  
*************** _copyCaseWhen(CaseWhen *from)
*** 1534,1540 ****
   * _copyCaseTestExpr
   */
  static CaseTestExpr *
! _copyCaseTestExpr(CaseTestExpr *from)
  {
  	CaseTestExpr *newnode = makeNode(CaseTestExpr);
  
--- 1534,1540 ----
   * _copyCaseTestExpr
   */
  static CaseTestExpr *
! _copyCaseTestExpr(const CaseTestExpr *from)
  {
  	CaseTestExpr *newnode = makeNode(CaseTestExpr);
  
*************** _copyCaseTestExpr(CaseTestExpr *from)
*** 1549,1555 ****
   * _copyArrayExpr
   */
  static ArrayExpr *
! _copyArrayExpr(ArrayExpr *from)
  {
  	ArrayExpr  *newnode = makeNode(ArrayExpr);
  
--- 1549,1555 ----
   * _copyArrayExpr
   */
  static ArrayExpr *
! _copyArrayExpr(const ArrayExpr *from)
  {
  	ArrayExpr  *newnode = makeNode(ArrayExpr);
  
*************** _copyArrayExpr(ArrayExpr *from)
*** 1567,1573 ****
   * _copyRowExpr
   */
  static RowExpr *
! _copyRowExpr(RowExpr *from)
  {
  	RowExpr    *newnode = makeNode(RowExpr);
  
--- 1567,1573 ----
   * _copyRowExpr
   */
  static RowExpr *
! _copyRowExpr(const RowExpr *from)
  {
  	RowExpr    *newnode = makeNode(RowExpr);
  
*************** _copyRowExpr(RowExpr *from)
*** 1584,1590 ****
   * _copyRowCompareExpr
   */
  static RowCompareExpr *
! _copyRowCompareExpr(RowCompareExpr *from)
  {
  	RowCompareExpr *newnode = makeNode(RowCompareExpr);
  
--- 1584,1590 ----
   * _copyRowCompareExpr
   */
  static RowCompareExpr *
! _copyRowCompareExpr(const RowCompareExpr *from)
  {
  	RowCompareExpr *newnode = makeNode(RowCompareExpr);
  
*************** _copyRowCompareExpr(RowCompareExpr *from
*** 1602,1608 ****
   * _copyCoalesceExpr
   */
  static CoalesceExpr *
! _copyCoalesceExpr(CoalesceExpr *from)
  {
  	CoalesceExpr *newnode = makeNode(CoalesceExpr);
  
--- 1602,1608 ----
   * _copyCoalesceExpr
   */
  static CoalesceExpr *
! _copyCoalesceExpr(const CoalesceExpr *from)
  {
  	CoalesceExpr *newnode = makeNode(CoalesceExpr);
  
*************** _copyCoalesceExpr(CoalesceExpr *from)
*** 1618,1624 ****
   * _copyMinMaxExpr
   */
  static MinMaxExpr *
! _copyMinMaxExpr(MinMaxExpr *from)
  {
  	MinMaxExpr *newnode = makeNode(MinMaxExpr);
  
--- 1618,1624 ----
   * _copyMinMaxExpr
   */
  static MinMaxExpr *
! _copyMinMaxExpr(const MinMaxExpr *from)
  {
  	MinMaxExpr *newnode = makeNode(MinMaxExpr);
  
*************** _copyMinMaxExpr(MinMaxExpr *from)
*** 1636,1642 ****
   * _copyXmlExpr
   */
  static XmlExpr *
! _copyXmlExpr(XmlExpr *from)
  {
  	XmlExpr    *newnode = makeNode(XmlExpr);
  
--- 1636,1642 ----
   * _copyXmlExpr
   */
  static XmlExpr *
! _copyXmlExpr(const XmlExpr *from)
  {
  	XmlExpr    *newnode = makeNode(XmlExpr);
  
*************** _copyXmlExpr(XmlExpr *from)
*** 1657,1663 ****
   * _copyNullTest
   */
  static NullTest *
! _copyNullTest(NullTest *from)
  {
  	NullTest   *newnode = makeNode(NullTest);
  
--- 1657,1663 ----
   * _copyNullTest
   */
  static NullTest *
! _copyNullTest(const NullTest *from)
  {
  	NullTest   *newnode = makeNode(NullTest);
  
*************** _copyNullTest(NullTest *from)
*** 1672,1678 ****
   * _copyBooleanTest
   */
  static BooleanTest *
! _copyBooleanTest(BooleanTest *from)
  {
  	BooleanTest *newnode = makeNode(BooleanTest);
  
--- 1672,1678 ----
   * _copyBooleanTest
   */
  static BooleanTest *
! _copyBooleanTest(const BooleanTest *from)
  {
  	BooleanTest *newnode = makeNode(BooleanTest);
  
*************** _copyBooleanTest(BooleanTest *from)
*** 1686,1692 ****
   * _copyCoerceToDomain
   */
  static CoerceToDomain *
! _copyCoerceToDomain(CoerceToDomain *from)
  {
  	CoerceToDomain *newnode = makeNode(CoerceToDomain);
  
--- 1686,1692 ----
   * _copyCoerceToDomain
   */
  static CoerceToDomain *
! _copyCoerceToDomain(const CoerceToDomain *from)
  {
  	CoerceToDomain *newnode = makeNode(CoerceToDomain);
  
*************** _copyCoerceToDomain(CoerceToDomain *from
*** 1704,1710 ****
   * _copyCoerceToDomainValue
   */
  static CoerceToDomainValue *
! _copyCoerceToDomainValue(CoerceToDomainValue *from)
  {
  	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
  
--- 1704,1710 ----
   * _copyCoerceToDomainValue
   */
  static CoerceToDomainValue *
! _copyCoerceToDomainValue(const CoerceToDomainValue *from)
  {
  	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
  
*************** _copyCoerceToDomainValue(CoerceToDomainV
*** 1720,1726 ****
   * _copySetToDefault
   */
  static SetToDefault *
! _copySetToDefault(SetToDefault *from)
  {
  	SetToDefault *newnode = makeNode(SetToDefault);
  
--- 1720,1726 ----
   * _copySetToDefault
   */
  static SetToDefault *
! _copySetToDefault(const SetToDefault *from)
  {
  	SetToDefault *newnode = makeNode(SetToDefault);
  
*************** _copySetToDefault(SetToDefault *from)
*** 1736,1742 ****
   * _copyCurrentOfExpr
   */
  static CurrentOfExpr *
! _copyCurrentOfExpr(CurrentOfExpr *from)
  {
  	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
  
--- 1736,1742 ----
   * _copyCurrentOfExpr
   */
  static CurrentOfExpr *
! _copyCurrentOfExpr(const CurrentOfExpr *from)
  {
  	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
  
*************** _copyCurrentOfExpr(CurrentOfExpr *from)
*** 1751,1757 ****
   * _copyTargetEntry
   */
  static TargetEntry *
! _copyTargetEntry(TargetEntry *from)
  {
  	TargetEntry *newnode = makeNode(TargetEntry);
  
--- 1751,1757 ----
   * _copyTargetEntry
   */
  static TargetEntry *
! _copyTargetEntry(const TargetEntry *from)
  {
  	TargetEntry *newnode = makeNode(TargetEntry);
  
*************** _copyTargetEntry(TargetEntry *from)
*** 1770,1776 ****
   * _copyRangeTblRef
   */
  static RangeTblRef *
! _copyRangeTblRef(RangeTblRef *from)
  {
  	RangeTblRef *newnode = makeNode(RangeTblRef);
  
--- 1770,1776 ----
   * _copyRangeTblRef
   */
  static RangeTblRef *
! _copyRangeTblRef(const RangeTblRef *from)
  {
  	RangeTblRef *newnode = makeNode(RangeTblRef);
  
*************** _copyRangeTblRef(RangeTblRef *from)
*** 1783,1789 ****
   * _copyJoinExpr
   */
  static JoinExpr *
! _copyJoinExpr(JoinExpr *from)
  {
  	JoinExpr   *newnode = makeNode(JoinExpr);
  
--- 1783,1789 ----
   * _copyJoinExpr
   */
  static JoinExpr *
! _copyJoinExpr(const JoinExpr *from)
  {
  	JoinExpr   *newnode = makeNode(JoinExpr);
  
*************** _copyJoinExpr(JoinExpr *from)
*** 1803,1809 ****
   * _copyFromExpr
   */
  static FromExpr *
! _copyFromExpr(FromExpr *from)
  {
  	FromExpr   *newnode = makeNode(FromExpr);
  
--- 1803,1809 ----
   * _copyFromExpr
   */
  static FromExpr *
! _copyFromExpr(const FromExpr *from)
  {
  	FromExpr   *newnode = makeNode(FromExpr);
  
*************** _copyFromExpr(FromExpr *from)
*** 1825,1831 ****
   * _copyPathKey
   */
  static PathKey *
! _copyPathKey(PathKey *from)
  {
  	PathKey    *newnode = makeNode(PathKey);
  
--- 1825,1831 ----
   * _copyPathKey
   */
  static PathKey *
! _copyPathKey(const PathKey *from)
  {
  	PathKey    *newnode = makeNode(PathKey);
  
*************** _copyPathKey(PathKey *from)
*** 1842,1848 ****
   * _copyRestrictInfo
   */
  static RestrictInfo *
! _copyRestrictInfo(RestrictInfo *from)
  {
  	RestrictInfo *newnode = makeNode(RestrictInfo);
  
--- 1842,1848 ----
   * _copyRestrictInfo
   */
  static RestrictInfo *
! _copyRestrictInfo(const RestrictInfo *from)
  {
  	RestrictInfo *newnode = makeNode(RestrictInfo);
  
*************** _copyRestrictInfo(RestrictInfo *from)
*** 1882,1888 ****
   * _copyPlaceHolderVar
   */
  static PlaceHolderVar *
! _copyPlaceHolderVar(PlaceHolderVar *from)
  {
  	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
  
--- 1882,1888 ----
   * _copyPlaceHolderVar
   */
  static PlaceHolderVar *
! _copyPlaceHolderVar(const PlaceHolderVar *from)
  {
  	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
  
*************** _copyPlaceHolderVar(PlaceHolderVar *from
*** 1898,1904 ****
   * _copySpecialJoinInfo
   */
  static SpecialJoinInfo *
! _copySpecialJoinInfo(SpecialJoinInfo *from)
  {
  	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
  
--- 1898,1904 ----
   * _copySpecialJoinInfo
   */
  static SpecialJoinInfo *
! _copySpecialJoinInfo(const SpecialJoinInfo *from)
  {
  	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
  
*************** _copySpecialJoinInfo(SpecialJoinInfo *fr
*** 1918,1924 ****
   * _copyAppendRelInfo
   */
  static AppendRelInfo *
! _copyAppendRelInfo(AppendRelInfo *from)
  {
  	AppendRelInfo *newnode = makeNode(AppendRelInfo);
  
--- 1918,1924 ----
   * _copyAppendRelInfo
   */
  static AppendRelInfo *
! _copyAppendRelInfo(const AppendRelInfo *from)
  {
  	AppendRelInfo *newnode = makeNode(AppendRelInfo);
  
*************** _copyAppendRelInfo(AppendRelInfo *from)
*** 1936,1942 ****
   * _copyPlaceHolderInfo
   */
  static PlaceHolderInfo *
! _copyPlaceHolderInfo(PlaceHolderInfo *from)
  {
  	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
  
--- 1936,1942 ----
   * _copyPlaceHolderInfo
   */
  static PlaceHolderInfo *
! _copyPlaceHolderInfo(const PlaceHolderInfo *from)
  {
  	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
  
*************** _copyPlaceHolderInfo(PlaceHolderInfo *fr
*** 1956,1962 ****
   */
  
  static RangeTblEntry *
! _copyRangeTblEntry(RangeTblEntry *from)
  {
  	RangeTblEntry *newnode = makeNode(RangeTblEntry);
  
--- 1956,1962 ----
   */
  
  static RangeTblEntry *
! _copyRangeTblEntry(const RangeTblEntry *from)
  {
  	RangeTblEntry *newnode = makeNode(RangeTblEntry);
  
*************** _copyRangeTblEntry(RangeTblEntry *from)
*** 1991,1997 ****
  }
  
  static SortGroupClause *
! _copySortGroupClause(SortGroupClause *from)
  {
  	SortGroupClause *newnode = makeNode(SortGroupClause);
  
--- 1991,1997 ----
  }
  
  static SortGroupClause *
! _copySortGroupClause(const SortGroupClause *from)
  {
  	SortGroupClause *newnode = makeNode(SortGroupClause);
  
*************** _copySortGroupClause(SortGroupClause *fr
*** 2005,2011 ****
  }
  
  static WindowClause *
! _copyWindowClause(WindowClause *from)
  {
  	WindowClause *newnode = makeNode(WindowClause);
  
--- 2005,2011 ----
  }
  
  static WindowClause *
! _copyWindowClause(const WindowClause *from)
  {
  	WindowClause *newnode = makeNode(WindowClause);
  
*************** _copyWindowClause(WindowClause *from)
*** 2023,2029 ****
  }
  
  static RowMarkClause *
! _copyRowMarkClause(RowMarkClause *from)
  {
  	RowMarkClause *newnode = makeNode(RowMarkClause);
  
--- 2023,2029 ----
  }
  
  static RowMarkClause *
! _copyRowMarkClause(const RowMarkClause *from)
  {
  	RowMarkClause *newnode = makeNode(RowMarkClause);
  
*************** _copyRowMarkClause(RowMarkClause *from)
*** 2036,2042 ****
  }
  
  static WithClause *
! _copyWithClause(WithClause *from)
  {
  	WithClause *newnode = makeNode(WithClause);
  
--- 2036,2042 ----
  }
  
  static WithClause *
! _copyWithClause(const WithClause *from)
  {
  	WithClause *newnode = makeNode(WithClause);
  
*************** _copyWithClause(WithClause *from)
*** 2048,2054 ****
  }
  
  static CommonTableExpr *
! _copyCommonTableExpr(CommonTableExpr *from)
  {
  	CommonTableExpr *newnode = makeNode(CommonTableExpr);
  
--- 2048,2054 ----
  }
  
  static CommonTableExpr *
! _copyCommonTableExpr(const CommonTableExpr *from)
  {
  	CommonTableExpr *newnode = makeNode(CommonTableExpr);
  
*************** _copyCommonTableExpr(CommonTableExpr *fr
*** 2067,2073 ****
  }
  
  static A_Expr *
! _copyAExpr(A_Expr *from)
  {
  	A_Expr	   *newnode = makeNode(A_Expr);
  
--- 2067,2073 ----
  }
  
  static A_Expr *
! _copyAExpr(const A_Expr *from)
  {
  	A_Expr	   *newnode = makeNode(A_Expr);
  
*************** _copyAExpr(A_Expr *from)
*** 2081,2087 ****
  }
  
  static ColumnRef *
! _copyColumnRef(ColumnRef *from)
  {
  	ColumnRef  *newnode = makeNode(ColumnRef);
  
--- 2081,2087 ----
  }
  
  static ColumnRef *
! _copyColumnRef(const ColumnRef *from)
  {
  	ColumnRef  *newnode = makeNode(ColumnRef);
  
*************** _copyColumnRef(ColumnRef *from)
*** 2092,2098 ****
  }
  
  static ParamRef *
! _copyParamRef(ParamRef *from)
  {
  	ParamRef   *newnode = makeNode(ParamRef);
  
--- 2092,2098 ----
  }
  
  static ParamRef *
! _copyParamRef(const ParamRef *from)
  {
  	ParamRef   *newnode = makeNode(ParamRef);
  
*************** _copyParamRef(ParamRef *from)
*** 2103,2109 ****
  }
  
  static A_Const *
! _copyAConst(A_Const *from)
  {
  	A_Const    *newnode = makeNode(A_Const);
  
--- 2103,2109 ----
  }
  
  static A_Const *
! _copyAConst(const A_Const *from)
  {
  	A_Const    *newnode = makeNode(A_Const);
  
*************** _copyAConst(A_Const *from)
*** 2134,2140 ****
  }
  
  static FuncCall *
! _copyFuncCall(FuncCall *from)
  {
  	FuncCall   *newnode = makeNode(FuncCall);
  
--- 2134,2140 ----
  }
  
  static FuncCall *
! _copyFuncCall(const FuncCall *from)
  {
  	FuncCall   *newnode = makeNode(FuncCall);
  
*************** _copyFuncCall(FuncCall *from)
*** 2151,2157 ****
  }
  
  static A_Star *
! _copyAStar(A_Star *from)
  {
  	A_Star	   *newnode = makeNode(A_Star);
  
--- 2151,2157 ----
  }
  
  static A_Star *
! _copyAStar(const A_Star *from)
  {
  	A_Star	   *newnode = makeNode(A_Star);
  
*************** _copyAStar(A_Star *from)
*** 2159,2165 ****
  }
  
  static A_Indices *
! _copyAIndices(A_Indices *from)
  {
  	A_Indices  *newnode = makeNode(A_Indices);
  
--- 2159,2165 ----
  }
  
  static A_Indices *
! _copyAIndices(const A_Indices *from)
  {
  	A_Indices  *newnode = makeNode(A_Indices);
  
*************** _copyAIndices(A_Indices *from)
*** 2170,2176 ****
  }
  
  static A_Indirection *
! _copyA_Indirection(A_Indirection *from)
  {
  	A_Indirection *newnode = makeNode(A_Indirection);
  
--- 2170,2176 ----
  }
  
  static A_Indirection *
! _copyA_Indirection(const A_Indirection *from)
  {
  	A_Indirection *newnode = makeNode(A_Indirection);
  
*************** _copyA_Indirection(A_Indirection *from)
*** 2181,2187 ****
  }
  
  static A_ArrayExpr *
! _copyA_ArrayExpr(A_ArrayExpr *from)
  {
  	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
  
--- 2181,2187 ----
  }
  
  static A_ArrayExpr *
! _copyA_ArrayExpr(const A_ArrayExpr *from)
  {
  	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
  
*************** _copyA_ArrayExpr(A_ArrayExpr *from)
*** 2192,2198 ****
  }
  
  static ResTarget *
! _copyResTarget(ResTarget *from)
  {
  	ResTarget  *newnode = makeNode(ResTarget);
  
--- 2192,2198 ----
  }
  
  static ResTarget *
! _copyResTarget(const ResTarget *from)
  {
  	ResTarget  *newnode = makeNode(ResTarget);
  
*************** _copyResTarget(ResTarget *from)
*** 2205,2211 ****
  }
  
  static TypeName *
! _copyTypeName(TypeName *from)
  {
  	TypeName   *newnode = makeNode(TypeName);
  
--- 2205,2211 ----
  }
  
  static TypeName *
! _copyTypeName(const TypeName *from)
  {
  	TypeName   *newnode = makeNode(TypeName);
  
*************** _copyTypeName(TypeName *from)
*** 2222,2228 ****
  }
  
  static SortBy *
! _copySortBy(SortBy *from)
  {
  	SortBy	   *newnode = makeNode(SortBy);
  
--- 2222,2228 ----
  }
  
  static SortBy *
! _copySortBy(const SortBy *from)
  {
  	SortBy	   *newnode = makeNode(SortBy);
  
*************** _copySortBy(SortBy *from)
*** 2236,2242 ****
  }
  
  static WindowDef *
! _copyWindowDef(WindowDef *from)
  {
  	WindowDef  *newnode = makeNode(WindowDef);
  
--- 2236,2242 ----
  }
  
  static WindowDef *
! _copyWindowDef(const WindowDef *from)
  {
  	WindowDef  *newnode = makeNode(WindowDef);
  
*************** _copyWindowDef(WindowDef *from)
*** 2253,2259 ****
  }
  
  static RangeSubselect *
! _copyRangeSubselect(RangeSubselect *from)
  {
  	RangeSubselect *newnode = makeNode(RangeSubselect);
  
--- 2253,2259 ----
  }
  
  static RangeSubselect *
! _copyRangeSubselect(const RangeSubselect *from)
  {
  	RangeSubselect *newnode = makeNode(RangeSubselect);
  
*************** _copyRangeSubselect(RangeSubselect *from
*** 2264,2270 ****
  }
  
  static RangeFunction *
! _copyRangeFunction(RangeFunction *from)
  {
  	RangeFunction *newnode = makeNode(RangeFunction);
  
--- 2264,2270 ----
  }
  
  static RangeFunction *
! _copyRangeFunction(const RangeFunction *from)
  {
  	RangeFunction *newnode = makeNode(RangeFunction);
  
*************** _copyRangeFunction(RangeFunction *from)
*** 2276,2282 ****
  }
  
  static TypeCast *
! _copyTypeCast(TypeCast *from)
  {
  	TypeCast   *newnode = makeNode(TypeCast);
  
--- 2276,2282 ----
  }
  
  static TypeCast *
! _copyTypeCast(const TypeCast *from)
  {
  	TypeCast   *newnode = makeNode(TypeCast);
  
*************** _copyTypeCast(TypeCast *from)
*** 2288,2294 ****
  }
  
  static CollateClause *
! _copyCollateClause(CollateClause *from)
  {
  	CollateClause *newnode = makeNode(CollateClause);
  
--- 2288,2294 ----
  }
  
  static CollateClause *
! _copyCollateClause(const CollateClause *from)
  {
  	CollateClause *newnode = makeNode(CollateClause);
  
*************** _copyCollateClause(CollateClause *from)
*** 2300,2306 ****
  }
  
  static IndexElem *
! _copyIndexElem(IndexElem *from)
  {
  	IndexElem  *newnode = makeNode(IndexElem);
  
--- 2300,2306 ----
  }
  
  static IndexElem *
! _copyIndexElem(const IndexElem *from)
  {
  	IndexElem  *newnode = makeNode(IndexElem);
  
*************** _copyIndexElem(IndexElem *from)
*** 2316,2322 ****
  }
  
  static ColumnDef *
! _copyColumnDef(ColumnDef *from)
  {
  	ColumnDef  *newnode = makeNode(ColumnDef);
  
--- 2316,2322 ----
  }
  
  static ColumnDef *
! _copyColumnDef(const ColumnDef *from)
  {
  	ColumnDef  *newnode = makeNode(ColumnDef);
  
*************** _copyColumnDef(ColumnDef *from)
*** 2338,2344 ****
  }
  
  static Constraint *
! _copyConstraint(Constraint *from)
  {
  	Constraint *newnode = makeNode(Constraint);
  
--- 2338,2344 ----
  }
  
  static Constraint *
! _copyConstraint(const Constraint *from)
  {
  	Constraint *newnode = makeNode(Constraint);
  
*************** _copyConstraint(Constraint *from)
*** 2369,2375 ****
  }
  
  static DefElem *
! _copyDefElem(DefElem *from)
  {
  	DefElem    *newnode = makeNode(DefElem);
  
--- 2369,2375 ----
  }
  
  static DefElem *
! _copyDefElem(const DefElem *from)
  {
  	DefElem    *newnode = makeNode(DefElem);
  
*************** _copyDefElem(DefElem *from)
*** 2382,2388 ****
  }
  
  static LockingClause *
! _copyLockingClause(LockingClause *from)
  {
  	LockingClause *newnode = makeNode(LockingClause);
  
--- 2382,2388 ----
  }
  
  static LockingClause *
! _copyLockingClause(const LockingClause *from)
  {
  	LockingClause *newnode = makeNode(LockingClause);
  
*************** _copyLockingClause(LockingClause *from)
*** 2394,2400 ****
  }
  
  static XmlSerialize *
! _copyXmlSerialize(XmlSerialize *from)
  {
  	XmlSerialize *newnode = makeNode(XmlSerialize);
  
--- 2394,2400 ----
  }
  
  static XmlSerialize *
! _copyXmlSerialize(const XmlSerialize *from)
  {
  	XmlSerialize *newnode = makeNode(XmlSerialize);
  
*************** _copyXmlSerialize(XmlSerialize *from)
*** 2407,2413 ****
  }
  
  static Query *
! _copyQuery(Query *from)
  {
  	Query	   *newnode = makeNode(Query);
  
--- 2407,2413 ----
  }
  
  static Query *
! _copyQuery(const Query *from)
  {
  	Query	   *newnode = makeNode(Query);
  
*************** _copyQuery(Query *from)
*** 2444,2450 ****
  }
  
  static InsertStmt *
! _copyInsertStmt(InsertStmt *from)
  {
  	InsertStmt *newnode = makeNode(InsertStmt);
  
--- 2444,2450 ----
  }
  
  static InsertStmt *
! _copyInsertStmt(const InsertStmt *from)
  {
  	InsertStmt *newnode = makeNode(InsertStmt);
  
*************** _copyInsertStmt(InsertStmt *from)
*** 2458,2464 ****
  }
  
  static DeleteStmt *
! _copyDeleteStmt(DeleteStmt *from)
  {
  	DeleteStmt *newnode = makeNode(DeleteStmt);
  
--- 2458,2464 ----
  }
  
  static DeleteStmt *
! _copyDeleteStmt(const DeleteStmt *from)
  {
  	DeleteStmt *newnode = makeNode(DeleteStmt);
  
*************** _copyDeleteStmt(DeleteStmt *from)
*** 2472,2478 ****
  }
  
  static UpdateStmt *
! _copyUpdateStmt(UpdateStmt *from)
  {
  	UpdateStmt *newnode = makeNode(UpdateStmt);
  
--- 2472,2478 ----
  }
  
  static UpdateStmt *
! _copyUpdateStmt(const UpdateStmt *from)
  {
  	UpdateStmt *newnode = makeNode(UpdateStmt);
  
*************** _copyUpdateStmt(UpdateStmt *from)
*** 2487,2493 ****
  }
  
  static SelectStmt *
! _copySelectStmt(SelectStmt *from)
  {
  	SelectStmt *newnode = makeNode(SelectStmt);
  
--- 2487,2493 ----
  }
  
  static SelectStmt *
! _copySelectStmt(const SelectStmt *from)
  {
  	SelectStmt *newnode = makeNode(SelectStmt);
  
*************** _copySelectStmt(SelectStmt *from)
*** 2514,2520 ****
  }
  
  static SetOperationStmt *
! _copySetOperationStmt(SetOperationStmt *from)
  {
  	SetOperationStmt *newnode = makeNode(SetOperationStmt);
  
--- 2514,2520 ----
  }
  
  static SetOperationStmt *
! _copySetOperationStmt(const SetOperationStmt *from)
  {
  	SetOperationStmt *newnode = makeNode(SetOperationStmt);
  
*************** _copySetOperationStmt(SetOperationStmt *
*** 2531,2537 ****
  }
  
  static AlterTableStmt *
! _copyAlterTableStmt(AlterTableStmt *from)
  {
  	AlterTableStmt *newnode = makeNode(AlterTableStmt);
  
--- 2531,2537 ----
  }
  
  static AlterTableStmt *
! _copyAlterTableStmt(const AlterTableStmt *from)
  {
  	AlterTableStmt *newnode = makeNode(AlterTableStmt);
  
*************** _copyAlterTableStmt(AlterTableStmt *from
*** 2543,2549 ****
  }
  
  static AlterTableCmd *
! _copyAlterTableCmd(AlterTableCmd *from)
  {
  	AlterTableCmd *newnode = makeNode(AlterTableCmd);
  
--- 2543,2549 ----
  }
  
  static AlterTableCmd *
! _copyAlterTableCmd(const AlterTableCmd *from)
  {
  	AlterTableCmd *newnode = makeNode(AlterTableCmd);
  
*************** _copyAlterTableCmd(AlterTableCmd *from)
*** 2557,2563 ****
  }
  
  static AlterDomainStmt *
! _copyAlterDomainStmt(AlterDomainStmt *from)
  {
  	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
  
--- 2557,2563 ----
  }
  
  static AlterDomainStmt *
! _copyAlterDomainStmt(const AlterDomainStmt *from)
  {
  	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
  
*************** _copyAlterDomainStmt(AlterDomainStmt *fr
*** 2571,2577 ****
  }
  
  static GrantStmt *
! _copyGrantStmt(GrantStmt *from)
  {
  	GrantStmt  *newnode = makeNode(GrantStmt);
  
--- 2571,2577 ----
  }
  
  static GrantStmt *
! _copyGrantStmt(const GrantStmt *from)
  {
  	GrantStmt  *newnode = makeNode(GrantStmt);
  
*************** _copyGrantStmt(GrantStmt *from)
*** 2588,2594 ****
  }
  
  static PrivGrantee *
! _copyPrivGrantee(PrivGrantee *from)
  {
  	PrivGrantee *newnode = makeNode(PrivGrantee);
  
--- 2588,2594 ----
  }
  
  static PrivGrantee *
! _copyPrivGrantee(const PrivGrantee *from)
  {
  	PrivGrantee *newnode = makeNode(PrivGrantee);
  
*************** _copyPrivGrantee(PrivGrantee *from)
*** 2598,2604 ****
  }
  
  static FuncWithArgs *
! _copyFuncWithArgs(FuncWithArgs *from)
  {
  	FuncWithArgs *newnode = makeNode(FuncWithArgs);
  
--- 2598,2604 ----
  }
  
  static FuncWithArgs *
! _copyFuncWithArgs(const FuncWithArgs *from)
  {
  	FuncWithArgs *newnode = makeNode(FuncWithArgs);
  
*************** _copyFuncWithArgs(FuncWithArgs *from)
*** 2609,2615 ****
  }
  
  static AccessPriv *
! _copyAccessPriv(AccessPriv *from)
  {
  	AccessPriv *newnode = makeNode(AccessPriv);
  
--- 2609,2615 ----
  }
  
  static AccessPriv *
! _copyAccessPriv(const AccessPriv *from)
  {
  	AccessPriv *newnode = makeNode(AccessPriv);
  
*************** _copyAccessPriv(AccessPriv *from)
*** 2620,2626 ****
  }
  
  static GrantRoleStmt *
! _copyGrantRoleStmt(GrantRoleStmt *from)
  {
  	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
  
--- 2620,2626 ----
  }
  
  static GrantRoleStmt *
! _copyGrantRoleStmt(const GrantRoleStmt *from)
  {
  	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
  
*************** _copyGrantRoleStmt(GrantRoleStmt *from)
*** 2635,2641 ****
  }
  
  static AlterDefaultPrivilegesStmt *
! _copyAlterDefaultPrivilegesStmt(AlterDefaultPrivilegesStmt *from)
  {
  	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
  
--- 2635,2641 ----
  }
  
  static AlterDefaultPrivilegesStmt *
! _copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
  {
  	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
  
*************** _copyAlterDefaultPrivilegesStmt(AlterDef
*** 2646,2652 ****
  }
  
  static DeclareCursorStmt *
! _copyDeclareCursorStmt(DeclareCursorStmt *from)
  {
  	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
  
--- 2646,2652 ----
  }
  
  static DeclareCursorStmt *
! _copyDeclareCursorStmt(const DeclareCursorStmt *from)
  {
  	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
  
*************** _copyDeclareCursorStmt(DeclareCursorStmt
*** 2658,2664 ****
  }
  
  static ClosePortalStmt *
! _copyClosePortalStmt(ClosePortalStmt *from)
  {
  	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
  
--- 2658,2664 ----
  }
  
  static ClosePortalStmt *
! _copyClosePortalStmt(const ClosePortalStmt *from)
  {
  	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
  
*************** _copyClosePortalStmt(ClosePortalStmt *fr
*** 2668,2674 ****
  }
  
  static ClusterStmt *
! _copyClusterStmt(ClusterStmt *from)
  {
  	ClusterStmt *newnode = makeNode(ClusterStmt);
  
--- 2668,2674 ----
  }
  
  static ClusterStmt *
! _copyClusterStmt(const ClusterStmt *from)
  {
  	ClusterStmt *newnode = makeNode(ClusterStmt);
  
*************** _copyClusterStmt(ClusterStmt *from)
*** 2680,2686 ****
  }
  
  static CopyStmt *
! _copyCopyStmt(CopyStmt *from)
  {
  	CopyStmt   *newnode = makeNode(CopyStmt);
  
--- 2680,2686 ----
  }
  
  static CopyStmt *
! _copyCopyStmt(const CopyStmt *from)
  {
  	CopyStmt   *newnode = makeNode(CopyStmt);
  
*************** _copyCopyStmt(CopyStmt *from)
*** 2701,2707 ****
   *		copy functions for classes which inherit from CreateStmt.
   */
  static void
! CopyCreateStmtFields(CreateStmt *from, CreateStmt *newnode)
  {
  	COPY_NODE_FIELD(relation);
  	COPY_NODE_FIELD(tableElts);
--- 2701,2707 ----
   *		copy functions for classes which inherit from CreateStmt.
   */
  static void
! CopyCreateStmtFields(const CreateStmt *from, CreateStmt *newnode)
  {
  	COPY_NODE_FIELD(relation);
  	COPY_NODE_FIELD(tableElts);
*************** CopyCreateStmtFields(CreateStmt *from, C
*** 2715,2721 ****
  }
  
  static CreateStmt *
! _copyCreateStmt(CreateStmt *from)
  {
  	CreateStmt *newnode = makeNode(CreateStmt);
  
--- 2715,2721 ----
  }
  
  static CreateStmt *
! _copyCreateStmt(const CreateStmt *from)
  {
  	CreateStmt *newnode = makeNode(CreateStmt);
  
*************** _copyCreateStmt(CreateStmt *from)
*** 2725,2731 ****
  }
  
  static InhRelation *
! _copyInhRelation(InhRelation *from)
  {
  	InhRelation *newnode = makeNode(InhRelation);
  
--- 2725,2731 ----
  }
  
  static InhRelation *
! _copyInhRelation(const InhRelation *from)
  {
  	InhRelation *newnode = makeNode(InhRelation);
  
*************** _copyInhRelation(InhRelation *from)
*** 2736,2742 ****
  }
  
  static DefineStmt *
! _copyDefineStmt(DefineStmt *from)
  {
  	DefineStmt *newnode = makeNode(DefineStmt);
  
--- 2736,2742 ----
  }
  
  static DefineStmt *
! _copyDefineStmt(const DefineStmt *from)
  {
  	DefineStmt *newnode = makeNode(DefineStmt);
  
*************** _copyDefineStmt(DefineStmt *from)
*** 2750,2756 ****
  }
  
  static DropStmt *
! _copyDropStmt(DropStmt *from)
  {
  	DropStmt   *newnode = makeNode(DropStmt);
  
--- 2750,2756 ----
  }
  
  static DropStmt *
! _copyDropStmt(const DropStmt *from)
  {
  	DropStmt   *newnode = makeNode(DropStmt);
  
*************** _copyDropStmt(DropStmt *from)
*** 2763,2769 ****
  }
  
  static TruncateStmt *
! _copyTruncateStmt(TruncateStmt *from)
  {
  	TruncateStmt *newnode = makeNode(TruncateStmt);
  
--- 2763,2769 ----
  }
  
  static TruncateStmt *
! _copyTruncateStmt(const TruncateStmt *from)
  {
  	TruncateStmt *newnode = makeNode(TruncateStmt);
  
*************** _copyTruncateStmt(TruncateStmt *from)
*** 2775,2781 ****
  }
  
  static CommentStmt *
! _copyCommentStmt(CommentStmt *from)
  {
  	CommentStmt *newnode = makeNode(CommentStmt);
  
--- 2775,2781 ----
  }
  
  static CommentStmt *
! _copyCommentStmt(const CommentStmt *from)
  {
  	CommentStmt *newnode = makeNode(CommentStmt);
  
*************** _copyCommentStmt(CommentStmt *from)
*** 2788,2794 ****
  }
  
  static SecLabelStmt *
! _copySecLabelStmt(SecLabelStmt *from)
  {
  	SecLabelStmt *newnode = makeNode(SecLabelStmt);
  
--- 2788,2794 ----
  }
  
  static SecLabelStmt *
! _copySecLabelStmt(const SecLabelStmt *from)
  {
  	SecLabelStmt *newnode = makeNode(SecLabelStmt);
  
*************** _copySecLabelStmt(SecLabelStmt *from)
*** 2802,2808 ****
  }
  
  static FetchStmt *
! _copyFetchStmt(FetchStmt *from)
  {
  	FetchStmt  *newnode = makeNode(FetchStmt);
  
--- 2802,2808 ----
  }
  
  static FetchStmt *
! _copyFetchStmt(const FetchStmt *from)
  {
  	FetchStmt  *newnode = makeNode(FetchStmt);
  
*************** _copyFetchStmt(FetchStmt *from)
*** 2815,2821 ****
  }
  
  static IndexStmt *
! _copyIndexStmt(IndexStmt *from)
  {
  	IndexStmt  *newnode = makeNode(IndexStmt);
  
--- 2815,2821 ----
  }
  
  static IndexStmt *
! _copyIndexStmt(const IndexStmt *from)
  {
  	IndexStmt  *newnode = makeNode(IndexStmt);
  
*************** _copyIndexStmt(IndexStmt *from)
*** 2840,2846 ****
  }
  
  static CreateFunctionStmt *
! _copyCreateFunctionStmt(CreateFunctionStmt *from)
  {
  	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
  
--- 2840,2846 ----
  }
  
  static CreateFunctionStmt *
! _copyCreateFunctionStmt(const CreateFunctionStmt *from)
  {
  	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
  
*************** _copyCreateFunctionStmt(CreateFunctionSt
*** 2855,2861 ****
  }
  
  static FunctionParameter *
! _copyFunctionParameter(FunctionParameter *from)
  {
  	FunctionParameter *newnode = makeNode(FunctionParameter);
  
--- 2855,2861 ----
  }
  
  static FunctionParameter *
! _copyFunctionParameter(const FunctionParameter *from)
  {
  	FunctionParameter *newnode = makeNode(FunctionParameter);
  
*************** _copyFunctionParameter(FunctionParameter
*** 2868,2874 ****
  }
  
  static AlterFunctionStmt *
! _copyAlterFunctionStmt(AlterFunctionStmt *from)
  {
  	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
  
--- 2868,2874 ----
  }
  
  static AlterFunctionStmt *
! _copyAlterFunctionStmt(const AlterFunctionStmt *from)
  {
  	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
  
*************** _copyAlterFunctionStmt(AlterFunctionStmt
*** 2879,2885 ****
  }
  
  static RemoveFuncStmt *
! _copyRemoveFuncStmt(RemoveFuncStmt *from)
  {
  	RemoveFuncStmt *newnode = makeNode(RemoveFuncStmt);
  
--- 2879,2885 ----
  }
  
  static RemoveFuncStmt *
! _copyRemoveFuncStmt(const RemoveFuncStmt *from)
  {
  	RemoveFuncStmt *newnode = makeNode(RemoveFuncStmt);
  
*************** _copyRemoveFuncStmt(RemoveFuncStmt *from
*** 2893,2899 ****
  }
  
  static DoStmt *
! _copyDoStmt(DoStmt *from)
  {
  	DoStmt	   *newnode = makeNode(DoStmt);
  
--- 2893,2899 ----
  }
  
  static DoStmt *
! _copyDoStmt(const DoStmt *from)
  {
  	DoStmt	   *newnode = makeNode(DoStmt);
  
*************** _copyDoStmt(DoStmt *from)
*** 2903,2909 ****
  }
  
  static RemoveOpClassStmt *
! _copyRemoveOpClassStmt(RemoveOpClassStmt *from)
  {
  	RemoveOpClassStmt *newnode = makeNode(RemoveOpClassStmt);
  
--- 2903,2909 ----
  }
  
  static RemoveOpClassStmt *
! _copyRemoveOpClassStmt(const RemoveOpClassStmt *from)
  {
  	RemoveOpClassStmt *newnode = makeNode(RemoveOpClassStmt);
  
*************** _copyRemoveOpClassStmt(RemoveOpClassStmt
*** 2916,2922 ****
  }
  
  static RemoveOpFamilyStmt *
! _copyRemoveOpFamilyStmt(RemoveOpFamilyStmt *from)
  {
  	RemoveOpFamilyStmt *newnode = makeNode(RemoveOpFamilyStmt);
  
--- 2916,2922 ----
  }
  
  static RemoveOpFamilyStmt *
! _copyRemoveOpFamilyStmt(const RemoveOpFamilyStmt *from)
  {
  	RemoveOpFamilyStmt *newnode = makeNode(RemoveOpFamilyStmt);
  
*************** _copyRemoveOpFamilyStmt(RemoveOpFamilySt
*** 2929,2935 ****
  }
  
  static RenameStmt *
! _copyRenameStmt(RenameStmt *from)
  {
  	RenameStmt *newnode = makeNode(RenameStmt);
  
--- 2929,2935 ----
  }
  
  static RenameStmt *
! _copyRenameStmt(const RenameStmt *from)
  {
  	RenameStmt *newnode = makeNode(RenameStmt);
  
*************** _copyRenameStmt(RenameStmt *from)
*** 2945,2951 ****
  }
  
  static AlterObjectSchemaStmt *
! _copyAlterObjectSchemaStmt(AlterObjectSchemaStmt *from)
  {
  	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
  
--- 2945,2951 ----
  }
  
  static AlterObjectSchemaStmt *
! _copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
  {
  	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
  
*************** _copyAlterObjectSchemaStmt(AlterObjectSc
*** 2960,2966 ****
  }
  
  static AlterOwnerStmt *
! _copyAlterOwnerStmt(AlterOwnerStmt *from)
  {
  	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
  
--- 2960,2966 ----
  }
  
  static AlterOwnerStmt *
! _copyAlterOwnerStmt(const AlterOwnerStmt *from)
  {
  	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
  
*************** _copyAlterOwnerStmt(AlterOwnerStmt *from
*** 2975,2981 ****
  }
  
  static RuleStmt *
! _copyRuleStmt(RuleStmt *from)
  {
  	RuleStmt   *newnode = makeNode(RuleStmt);
  
--- 2975,2981 ----
  }
  
  static RuleStmt *
! _copyRuleStmt(const RuleStmt *from)
  {
  	RuleStmt   *newnode = makeNode(RuleStmt);
  
*************** _copyRuleStmt(RuleStmt *from)
*** 2991,2997 ****
  }
  
  static NotifyStmt *
! _copyNotifyStmt(NotifyStmt *from)
  {
  	NotifyStmt *newnode = makeNode(NotifyStmt);
  
--- 2991,2997 ----
  }
  
  static NotifyStmt *
! _copyNotifyStmt(const NotifyStmt *from)
  {
  	NotifyStmt *newnode = makeNode(NotifyStmt);
  
*************** _copyNotifyStmt(NotifyStmt *from)
*** 3002,3008 ****
  }
  
  static ListenStmt *
! _copyListenStmt(ListenStmt *from)
  {
  	ListenStmt *newnode = makeNode(ListenStmt);
  
--- 3002,3008 ----
  }
  
  static ListenStmt *
! _copyListenStmt(const ListenStmt *from)
  {
  	ListenStmt *newnode = makeNode(ListenStmt);
  
*************** _copyListenStmt(ListenStmt *from)
*** 3012,3018 ****
  }
  
  static UnlistenStmt *
! _copyUnlistenStmt(UnlistenStmt *from)
  {
  	UnlistenStmt *newnode = makeNode(UnlistenStmt);
  
--- 3012,3018 ----
  }
  
  static UnlistenStmt *
! _copyUnlistenStmt(const UnlistenStmt *from)
  {
  	UnlistenStmt *newnode = makeNode(UnlistenStmt);
  
*************** _copyUnlistenStmt(UnlistenStmt *from)
*** 3022,3028 ****
  }
  
  static TransactionStmt *
! _copyTransactionStmt(TransactionStmt *from)
  {
  	TransactionStmt *newnode = makeNode(TransactionStmt);
  
--- 3022,3028 ----
  }
  
  static TransactionStmt *
! _copyTransactionStmt(const TransactionStmt *from)
  {
  	TransactionStmt *newnode = makeNode(TransactionStmt);
  
*************** _copyTransactionStmt(TransactionStmt *fr
*** 3034,3040 ****
  }
  
  static CompositeTypeStmt *
! _copyCompositeTypeStmt(CompositeTypeStmt *from)
  {
  	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
  
--- 3034,3040 ----
  }
  
  static CompositeTypeStmt *
! _copyCompositeTypeStmt(const CompositeTypeStmt *from)
  {
  	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
  
*************** _copyCompositeTypeStmt(CompositeTypeStmt
*** 3045,3051 ****
  }
  
  static CreateEnumStmt *
! _copyCreateEnumStmt(CreateEnumStmt *from)
  {
  	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
  
--- 3045,3051 ----
  }
  
  static CreateEnumStmt *
! _copyCreateEnumStmt(const CreateEnumStmt *from)
  {
  	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
  
*************** _copyCreateEnumStmt(CreateEnumStmt *from
*** 3056,3062 ****
  }
  
  static CreateRangeStmt *
! _copyCreateRangeStmt(CreateRangeStmt *from)
  {
  	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
  
--- 3056,3062 ----
  }
  
  static CreateRangeStmt *
! _copyCreateRangeStmt(const CreateRangeStmt *from)
  {
  	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
  
*************** _copyCreateRangeStmt(CreateRangeStmt *fr
*** 3067,3073 ****
  }
  
  static AlterEnumStmt *
! _copyAlterEnumStmt(AlterEnumStmt *from)
  {
  	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
  
--- 3067,3073 ----
  }
  
  static AlterEnumStmt *
! _copyAlterEnumStmt(const AlterEnumStmt *from)
  {
  	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
  
*************** _copyAlterEnumStmt(AlterEnumStmt *from)
*** 3080,3086 ****
  }
  
  static ViewStmt *
! _copyViewStmt(ViewStmt *from)
  {
  	ViewStmt   *newnode = makeNode(ViewStmt);
  
--- 3080,3086 ----
  }
  
  static ViewStmt *
! _copyViewStmt(const ViewStmt *from)
  {
  	ViewStmt   *newnode = makeNode(ViewStmt);
  
*************** _copyViewStmt(ViewStmt *from)
*** 3093,3099 ****
  }
  
  static LoadStmt *
! _copyLoadStmt(LoadStmt *from)
  {
  	LoadStmt   *newnode = makeNode(LoadStmt);
  
--- 3093,3099 ----
  }
  
  static LoadStmt *
! _copyLoadStmt(const LoadStmt *from)
  {
  	LoadStmt   *newnode = makeNode(LoadStmt);
  
*************** _copyLoadStmt(LoadStmt *from)
*** 3103,3109 ****
  }
  
  static CreateDomainStmt *
! _copyCreateDomainStmt(CreateDomainStmt *from)
  {
  	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
  
--- 3103,3109 ----
  }
  
  static CreateDomainStmt *
! _copyCreateDomainStmt(const CreateDomainStmt *from)
  {
  	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
  
*************** _copyCreateDomainStmt(CreateDomainStmt *
*** 3116,3122 ****
  }
  
  static CreateOpClassStmt *
! _copyCreateOpClassStmt(CreateOpClassStmt *from)
  {
  	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
  
--- 3116,3122 ----
  }
  
  static CreateOpClassStmt *
! _copyCreateOpClassStmt(const CreateOpClassStmt *from)
  {
  	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
  
*************** _copyCreateOpClassStmt(CreateOpClassStmt
*** 3131,3137 ****
  }
  
  static CreateOpClassItem *
! _copyCreateOpClassItem(CreateOpClassItem *from)
  {
  	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
  
--- 3131,3137 ----
  }
  
  static CreateOpClassItem *
! _copyCreateOpClassItem(const CreateOpClassItem *from)
  {
  	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
  
*************** _copyCreateOpClassItem(CreateOpClassItem
*** 3147,3153 ****
  }
  
  static CreateOpFamilyStmt *
! _copyCreateOpFamilyStmt(CreateOpFamilyStmt *from)
  {
  	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
  
--- 3147,3153 ----
  }
  
  static CreateOpFamilyStmt *
! _copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
  {
  	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
  
*************** _copyCreateOpFamilyStmt(CreateOpFamilySt
*** 3158,3164 ****
  }
  
  static AlterOpFamilyStmt *
! _copyAlterOpFamilyStmt(AlterOpFamilyStmt *from)
  {
  	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
  
--- 3158,3164 ----
  }
  
  static AlterOpFamilyStmt *
! _copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
  {
  	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
  
*************** _copyAlterOpFamilyStmt(AlterOpFamilyStmt
*** 3171,3177 ****
  }
  
  static CreatedbStmt *
! _copyCreatedbStmt(CreatedbStmt *from)
  {
  	CreatedbStmt *newnode = makeNode(CreatedbStmt);
  
--- 3171,3177 ----
  }
  
  static CreatedbStmt *
! _copyCreatedbStmt(const CreatedbStmt *from)
  {
  	CreatedbStmt *newnode = makeNode(CreatedbStmt);
  
*************** _copyCreatedbStmt(CreatedbStmt *from)
*** 3182,3188 ****
  }
  
  static AlterDatabaseStmt *
! _copyAlterDatabaseStmt(AlterDatabaseStmt *from)
  {
  	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
  
--- 3182,3188 ----
  }
  
  static AlterDatabaseStmt *
! _copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
  {
  	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
  
*************** _copyAlterDatabaseStmt(AlterDatabaseStmt
*** 3193,3199 ****
  }
  
  static AlterDatabaseSetStmt *
! _copyAlterDatabaseSetStmt(AlterDatabaseSetStmt *from)
  {
  	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
  
--- 3193,3199 ----
  }
  
  static AlterDatabaseSetStmt *
! _copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
  {
  	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
  
*************** _copyAlterDatabaseSetStmt(AlterDatabaseS
*** 3204,3210 ****
  }
  
  static DropdbStmt *
! _copyDropdbStmt(DropdbStmt *from)
  {
  	DropdbStmt *newnode = makeNode(DropdbStmt);
  
--- 3204,3210 ----
  }
  
  static DropdbStmt *
! _copyDropdbStmt(const DropdbStmt *from)
  {
  	DropdbStmt *newnode = makeNode(DropdbStmt);
  
*************** _copyDropdbStmt(DropdbStmt *from)
*** 3215,3221 ****
  }
  
  static VacuumStmt *
! _copyVacuumStmt(VacuumStmt *from)
  {
  	VacuumStmt *newnode = makeNode(VacuumStmt);
  
--- 3215,3221 ----
  }
  
  static VacuumStmt *
! _copyVacuumStmt(const VacuumStmt *from)
  {
  	VacuumStmt *newnode = makeNode(VacuumStmt);
  
*************** _copyVacuumStmt(VacuumStmt *from)
*** 3229,3235 ****
  }
  
  static ExplainStmt *
! _copyExplainStmt(ExplainStmt *from)
  {
  	ExplainStmt *newnode = makeNode(ExplainStmt);
  
--- 3229,3235 ----
  }
  
  static ExplainStmt *
! _copyExplainStmt(const ExplainStmt *from)
  {
  	ExplainStmt *newnode = makeNode(ExplainStmt);
  
*************** _copyExplainStmt(ExplainStmt *from)
*** 3240,3246 ****
  }
  
  static CreateSeqStmt *
! _copyCreateSeqStmt(CreateSeqStmt *from)
  {
  	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
  
--- 3240,3246 ----
  }
  
  static CreateSeqStmt *
! _copyCreateSeqStmt(const CreateSeqStmt *from)
  {
  	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
  
*************** _copyCreateSeqStmt(CreateSeqStmt *from)
*** 3252,3258 ****
  }
  
  static AlterSeqStmt *
! _copyAlterSeqStmt(AlterSeqStmt *from)
  {
  	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
  
--- 3252,3258 ----
  }
  
  static AlterSeqStmt *
! _copyAlterSeqStmt(const AlterSeqStmt *from)
  {
  	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
  
*************** _copyAlterSeqStmt(AlterSeqStmt *from)
*** 3263,3269 ****
  }
  
  static VariableSetStmt *
! _copyVariableSetStmt(VariableSetStmt *from)
  {
  	VariableSetStmt *newnode = makeNode(VariableSetStmt);
  
--- 3263,3269 ----
  }
  
  static VariableSetStmt *
! _copyVariableSetStmt(const VariableSetStmt *from)
  {
  	VariableSetStmt *newnode = makeNode(VariableSetStmt);
  
*************** _copyVariableSetStmt(VariableSetStmt *fr
*** 3276,3282 ****
  }
  
  static VariableShowStmt *
! _copyVariableShowStmt(VariableShowStmt *from)
  {
  	VariableShowStmt *newnode = makeNode(VariableShowStmt);
  
--- 3276,3282 ----
  }
  
  static VariableShowStmt *
! _copyVariableShowStmt(const VariableShowStmt *from)
  {
  	VariableShowStmt *newnode = makeNode(VariableShowStmt);
  
*************** _copyVariableShowStmt(VariableShowStmt *
*** 3286,3292 ****
  }
  
  static DiscardStmt *
! _copyDiscardStmt(DiscardStmt *from)
  {
  	DiscardStmt *newnode = makeNode(DiscardStmt);
  
--- 3286,3292 ----
  }
  
  static DiscardStmt *
! _copyDiscardStmt(const DiscardStmt *from)
  {
  	DiscardStmt *newnode = makeNode(DiscardStmt);
  
*************** _copyDiscardStmt(DiscardStmt *from)
*** 3296,3302 ****
  }
  
  static CreateTableSpaceStmt *
! _copyCreateTableSpaceStmt(CreateTableSpaceStmt *from)
  {
  	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
  
--- 3296,3302 ----
  }
  
  static CreateTableSpaceStmt *
! _copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
  {
  	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
  
*************** _copyCreateTableSpaceStmt(CreateTableSpa
*** 3308,3314 ****
  }
  
  static DropTableSpaceStmt *
! _copyDropTableSpaceStmt(DropTableSpaceStmt *from)
  {
  	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
  
--- 3308,3314 ----
  }
  
  static DropTableSpaceStmt *
! _copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
  {
  	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
  
*************** _copyDropTableSpaceStmt(DropTableSpaceSt
*** 3319,3325 ****
  }
  
  static AlterTableSpaceOptionsStmt *
! _copyAlterTableSpaceOptionsStmt(AlterTableSpaceOptionsStmt *from)
  {
  	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
  
--- 3319,3325 ----
  }
  
  static AlterTableSpaceOptionsStmt *
! _copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
  {
  	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
  
*************** _copyAlterTableSpaceOptionsStmt(AlterTab
*** 3331,3337 ****
  }
  
  static CreateExtensionStmt *
! _copyCreateExtensionStmt(CreateExtensionStmt *from)
  {
  	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
  
--- 3331,3337 ----
  }
  
  static CreateExtensionStmt *
! _copyCreateExtensionStmt(const CreateExtensionStmt *from)
  {
  	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
  
*************** _copyCreateExtensionStmt(CreateExtension
*** 3343,3349 ****
  }
  
  static AlterExtensionStmt *
! _copyAlterExtensionStmt(AlterExtensionStmt *from)
  {
  	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
  
--- 3343,3349 ----
  }
  
  static AlterExtensionStmt *
! _copyAlterExtensionStmt(const AlterExtensionStmt *from)
  {
  	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
  
*************** _copyAlterExtensionStmt(AlterExtensionSt
*** 3354,3360 ****
  }
  
  static AlterExtensionContentsStmt *
! _copyAlterExtensionContentsStmt(AlterExtensionContentsStmt *from)
  {
  	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
  
--- 3354,3360 ----
  }
  
  static AlterExtensionContentsStmt *
! _copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
  {
  	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
  
*************** _copyAlterExtensionContentsStmt(AlterExt
*** 3368,3374 ****
  }
  
  static CreateFdwStmt *
! _copyCreateFdwStmt(CreateFdwStmt *from)
  {
  	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
  
--- 3368,3374 ----
  }
  
  static CreateFdwStmt *
! _copyCreateFdwStmt(const CreateFdwStmt *from)
  {
  	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
  
*************** _copyCreateFdwStmt(CreateFdwStmt *from)
*** 3380,3386 ****
  }
  
  static AlterFdwStmt *
! _copyAlterFdwStmt(AlterFdwStmt *from)
  {
  	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
  
--- 3380,3386 ----
  }
  
  static AlterFdwStmt *
! _copyAlterFdwStmt(const AlterFdwStmt *from)
  {
  	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
  
*************** _copyAlterFdwStmt(AlterFdwStmt *from)
*** 3392,3398 ****
  }
  
  static DropFdwStmt *
! _copyDropFdwStmt(DropFdwStmt *from)
  {
  	DropFdwStmt *newnode = makeNode(DropFdwStmt);
  
--- 3392,3398 ----
  }
  
  static DropFdwStmt *
! _copyDropFdwStmt(const DropFdwStmt *from)
  {
  	DropFdwStmt *newnode = makeNode(DropFdwStmt);
  
*************** _copyDropFdwStmt(DropFdwStmt *from)
*** 3404,3410 ****
  }
  
  static CreateForeignServerStmt *
! _copyCreateForeignServerStmt(CreateForeignServerStmt *from)
  {
  	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
  
--- 3404,3410 ----
  }
  
  static CreateForeignServerStmt *
! _copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
  {
  	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
  
*************** _copyCreateForeignServerStmt(CreateForei
*** 3418,3424 ****
  }
  
  static AlterForeignServerStmt *
! _copyAlterForeignServerStmt(AlterForeignServerStmt *from)
  {
  	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
  
--- 3418,3424 ----
  }
  
  static AlterForeignServerStmt *
! _copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
  {
  	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
  
*************** _copyAlterForeignServerStmt(AlterForeign
*** 3431,3437 ****
  }
  
  static DropForeignServerStmt *
! _copyDropForeignServerStmt(DropForeignServerStmt *from)
  {
  	DropForeignServerStmt *newnode = makeNode(DropForeignServerStmt);
  
--- 3431,3437 ----
  }
  
  static DropForeignServerStmt *
! _copyDropForeignServerStmt(const DropForeignServerStmt *from)
  {
  	DropForeignServerStmt *newnode = makeNode(DropForeignServerStmt);
  
*************** _copyDropForeignServerStmt(DropForeignSe
*** 3443,3449 ****
  }
  
  static CreateUserMappingStmt *
! _copyCreateUserMappingStmt(CreateUserMappingStmt *from)
  {
  	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
  
--- 3443,3449 ----
  }
  
  static CreateUserMappingStmt *
! _copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
  {
  	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
  
*************** _copyCreateUserMappingStmt(CreateUserMap
*** 3455,3461 ****
  }
  
  static AlterUserMappingStmt *
! _copyAlterUserMappingStmt(AlterUserMappingStmt *from)
  {
  	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
  
--- 3455,3461 ----
  }
  
  static AlterUserMappingStmt *
! _copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
  {
  	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
  
*************** _copyAlterUserMappingStmt(AlterUserMappi
*** 3467,3473 ****
  }
  
  static DropUserMappingStmt *
! _copyDropUserMappingStmt(DropUserMappingStmt *from)
  {
  	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
  
--- 3467,3473 ----
  }
  
  static DropUserMappingStmt *
! _copyDropUserMappingStmt(const DropUserMappingStmt *from)
  {
  	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
  
*************** _copyDropUserMappingStmt(DropUserMapping
*** 3479,3485 ****
  }
  
  static CreateForeignTableStmt *
! _copyCreateForeignTableStmt(CreateForeignTableStmt *from)
  {
  	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
  
--- 3479,3485 ----
  }
  
  static CreateForeignTableStmt *
! _copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
  {
  	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
  
*************** _copyCreateForeignTableStmt(CreateForeig
*** 3492,3498 ****
  }
  
  static CreateTrigStmt *
! _copyCreateTrigStmt(CreateTrigStmt *from)
  {
  	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
  
--- 3492,3498 ----
  }
  
  static CreateTrigStmt *
! _copyCreateTrigStmt(const CreateTrigStmt *from)
  {
  	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
  
*************** _copyCreateTrigStmt(CreateTrigStmt *from
*** 3514,3520 ****
  }
  
  static DropPropertyStmt *
! _copyDropPropertyStmt(DropPropertyStmt *from)
  {
  	DropPropertyStmt *newnode = makeNode(DropPropertyStmt);
  
--- 3514,3520 ----
  }
  
  static DropPropertyStmt *
! _copyDropPropertyStmt(const DropPropertyStmt *from)
  {
  	DropPropertyStmt *newnode = makeNode(DropPropertyStmt);
  
*************** _copyDropPropertyStmt(DropPropertyStmt *
*** 3528,3534 ****
  }
  
  static CreatePLangStmt *
! _copyCreatePLangStmt(CreatePLangStmt *from)
  {
  	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
  
--- 3528,3534 ----
  }
  
  static CreatePLangStmt *
! _copyCreatePLangStmt(const CreatePLangStmt *from)
  {
  	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
  
*************** _copyCreatePLangStmt(CreatePLangStmt *fr
*** 3543,3549 ****
  }
  
  static DropPLangStmt *
! _copyDropPLangStmt(DropPLangStmt *from)
  {
  	DropPLangStmt *newnode = makeNode(DropPLangStmt);
  
--- 3543,3549 ----
  }
  
  static DropPLangStmt *
! _copyDropPLangStmt(const DropPLangStmt *from)
  {
  	DropPLangStmt *newnode = makeNode(DropPLangStmt);
  
*************** _copyDropPLangStmt(DropPLangStmt *from)
*** 3555,3561 ****
  }
  
  static CreateRoleStmt *
! _copyCreateRoleStmt(CreateRoleStmt *from)
  {
  	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
  
--- 3555,3561 ----
  }
  
  static CreateRoleStmt *
! _copyCreateRoleStmt(const CreateRoleStmt *from)
  {
  	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
  
*************** _copyCreateRoleStmt(CreateRoleStmt *from
*** 3567,3573 ****
  }
  
  static AlterRoleStmt *
! _copyAlterRoleStmt(AlterRoleStmt *from)
  {
  	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
  
--- 3567,3573 ----
  }
  
  static AlterRoleStmt *
! _copyAlterRoleStmt(const AlterRoleStmt *from)
  {
  	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
  
*************** _copyAlterRoleStmt(AlterRoleStmt *from)
*** 3579,3585 ****
  }
  
  static AlterRoleSetStmt *
! _copyAlterRoleSetStmt(AlterRoleSetStmt *from)
  {
  	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
  
--- 3579,3585 ----
  }
  
  static AlterRoleSetStmt *
! _copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
  {
  	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
  
*************** _copyAlterRoleSetStmt(AlterRoleSetStmt *
*** 3591,3597 ****
  }
  
  static DropRoleStmt *
! _copyDropRoleStmt(DropRoleStmt *from)
  {
  	DropRoleStmt *newnode = makeNode(DropRoleStmt);
  
--- 3591,3597 ----
  }
  
  static DropRoleStmt *
! _copyDropRoleStmt(const DropRoleStmt *from)
  {
  	DropRoleStmt *newnode = makeNode(DropRoleStmt);
  
*************** _copyDropRoleStmt(DropRoleStmt *from)
*** 3602,3608 ****
  }
  
  static LockStmt *
! _copyLockStmt(LockStmt *from)
  {
  	LockStmt   *newnode = makeNode(LockStmt);
  
--- 3602,3608 ----
  }
  
  static LockStmt *
! _copyLockStmt(const LockStmt *from)
  {
  	LockStmt   *newnode = makeNode(LockStmt);
  
*************** _copyLockStmt(LockStmt *from)
*** 3614,3620 ****
  }
  
  static ConstraintsSetStmt *
! _copyConstraintsSetStmt(ConstraintsSetStmt *from)
  {
  	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
  
--- 3614,3620 ----
  }
  
  static ConstraintsSetStmt *
! _copyConstraintsSetStmt(const ConstraintsSetStmt *from)
  {
  	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
  
*************** _copyConstraintsSetStmt(ConstraintsSetSt
*** 3625,3631 ****
  }
  
  static ReindexStmt *
! _copyReindexStmt(ReindexStmt *from)
  {
  	ReindexStmt *newnode = makeNode(ReindexStmt);
  
--- 3625,3631 ----
  }
  
  static ReindexStmt *
! _copyReindexStmt(const ReindexStmt *from)
  {
  	ReindexStmt *newnode = makeNode(ReindexStmt);
  
*************** _copyReindexStmt(ReindexStmt *from)
*** 3639,3645 ****
  }
  
  static CreateSchemaStmt *
! _copyCreateSchemaStmt(CreateSchemaStmt *from)
  {
  	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
  
--- 3639,3645 ----
  }
  
  static CreateSchemaStmt *
! _copyCreateSchemaStmt(const CreateSchemaStmt *from)
  {
  	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
  
*************** _copyCreateSchemaStmt(CreateSchemaStmt *
*** 3651,3657 ****
  }
  
  static CreateConversionStmt *
! _copyCreateConversionStmt(CreateConversionStmt *from)
  {
  	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
  
--- 3651,3657 ----
  }
  
  static CreateConversionStmt *
! _copyCreateConversionStmt(const CreateConversionStmt *from)
  {
  	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
  
*************** _copyCreateConversionStmt(CreateConversi
*** 3665,3671 ****
  }
  
  static CreateCastStmt *
! _copyCreateCastStmt(CreateCastStmt *from)
  {
  	CreateCastStmt *newnode = makeNode(CreateCastStmt);
  
--- 3665,3671 ----
  }
  
  static CreateCastStmt *
! _copyCreateCastStmt(const CreateCastStmt *from)
  {
  	CreateCastStmt *newnode = makeNode(CreateCastStmt);
  
*************** _copyCreateCastStmt(CreateCastStmt *from
*** 3679,3685 ****
  }
  
  static DropCastStmt *
! _copyDropCastStmt(DropCastStmt *from)
  {
  	DropCastStmt *newnode = makeNode(DropCastStmt);
  
--- 3679,3685 ----
  }
  
  static DropCastStmt *
! _copyDropCastStmt(const DropCastStmt *from)
  {
  	DropCastStmt *newnode = makeNode(DropCastStmt);
  
*************** _copyDropCastStmt(DropCastStmt *from)
*** 3692,3698 ****
  }
  
  static PrepareStmt *
! _copyPrepareStmt(PrepareStmt *from)
  {
  	PrepareStmt *newnode = makeNode(PrepareStmt);
  
--- 3692,3698 ----
  }
  
  static PrepareStmt *
! _copyPrepareStmt(const PrepareStmt *from)
  {
  	PrepareStmt *newnode = makeNode(PrepareStmt);
  
*************** _copyPrepareStmt(PrepareStmt *from)
*** 3704,3710 ****
  }
  
  static ExecuteStmt *
! _copyExecuteStmt(ExecuteStmt *from)
  {
  	ExecuteStmt *newnode = makeNode(ExecuteStmt);
  
--- 3704,3710 ----
  }
  
  static ExecuteStmt *
! _copyExecuteStmt(const ExecuteStmt *from)
  {
  	ExecuteStmt *newnode = makeNode(ExecuteStmt);
  
*************** _copyExecuteStmt(ExecuteStmt *from)
*** 3716,3722 ****
  }
  
  static DeallocateStmt *
! _copyDeallocateStmt(DeallocateStmt *from)
  {
  	DeallocateStmt *newnode = makeNode(DeallocateStmt);
  
--- 3716,3722 ----
  }
  
  static DeallocateStmt *
! _copyDeallocateStmt(const DeallocateStmt *from)
  {
  	DeallocateStmt *newnode = makeNode(DeallocateStmt);
  
*************** _copyDeallocateStmt(DeallocateStmt *from
*** 3726,3732 ****
  }
  
  static DropOwnedStmt *
! _copyDropOwnedStmt(DropOwnedStmt *from)
  {
  	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
  
--- 3726,3732 ----
  }
  
  static DropOwnedStmt *
! _copyDropOwnedStmt(const DropOwnedStmt *from)
  {
  	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
  
*************** _copyDropOwnedStmt(DropOwnedStmt *from)
*** 3737,3743 ****
  }
  
  static ReassignOwnedStmt *
! _copyReassignOwnedStmt(ReassignOwnedStmt *from)
  {
  	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
  
--- 3737,3743 ----
  }
  
  static ReassignOwnedStmt *
! _copyReassignOwnedStmt(const ReassignOwnedStmt *from)
  {
  	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
  
*************** _copyReassignOwnedStmt(ReassignOwnedStmt
*** 3748,3754 ****
  }
  
  static AlterTSDictionaryStmt *
! _copyAlterTSDictionaryStmt(AlterTSDictionaryStmt *from)
  {
  	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
  
--- 3748,3754 ----
  }
  
  static AlterTSDictionaryStmt *
! _copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
  {
  	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
  
*************** _copyAlterTSDictionaryStmt(AlterTSDictio
*** 3759,3765 ****
  }
  
  static AlterTSConfigurationStmt *
! _copyAlterTSConfigurationStmt(AlterTSConfigurationStmt *from)
  {
  	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
  
--- 3759,3765 ----
  }
  
  static AlterTSConfigurationStmt *
! _copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
  {
  	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
  
*************** _copyAlterTSConfigurationStmt(AlterTSCon
*** 3788,3794 ****
  	lfirst(new) = copyObject(lfirst(old));
  
  static List *
! _copyList(List *from)
  {
  	List	   *new;
  	ListCell   *curr_old;
--- 3788,3794 ----
  	lfirst(new) = copyObject(lfirst(old));
  
  static List *
! _copyList(const List *from)
  {
  	List	   *new;
  	ListCell   *curr_old;
*************** _copyList(List *from)
*** 3820,3826 ****
   * ****************************************************************
   */
  static Value *
! _copyValue(Value *from)
  {
  	Value	   *newnode = makeNode(Value);
  
--- 3820,3826 ----
   * ****************************************************************
   */
  static Value *
! _copyValue(const Value *from)
  {
  	Value	   *newnode = makeNode(Value);
  
*************** _copyValue(Value *from)
*** 3855,3861 ****
   * substructure is copied too, recursively.
   */
  void *
! copyObject(void *from)
  {
  	void	   *retval;
  
--- 3855,3861 ----
   * substructure is copied too, recursively.
   */
  void *
! copyObject(const void *from)
  {
  	void	   *retval;
  
*************** copyObject(void *from)
*** 4585,4591 ****
  
  		default:
  			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(from));
! 			retval = from;		/* keep compiler quiet */
  			break;
  	}
  
--- 4585,4591 ----
  
  		default:
  			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(from));
! 			retval = 0;		/* keep compiler quiet */
  			break;
  	}
  
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c
new file mode 100644
index f3a34a1..80c925c
*** a/src/backend/nodes/equalfuncs.c
--- b/src/backend/nodes/equalfuncs.c
***************
*** 89,95 ****
   */
  
  static bool
! _equalAlias(Alias *a, Alias *b)
  {
  	COMPARE_STRING_FIELD(aliasname);
  	COMPARE_NODE_FIELD(colnames);
--- 89,95 ----
   */
  
  static bool
! _equalAlias(const Alias *a, const Alias *b)
  {
  	COMPARE_STRING_FIELD(aliasname);
  	COMPARE_NODE_FIELD(colnames);
*************** _equalAlias(Alias *a, Alias *b)
*** 98,104 ****
  }
  
  static bool
! _equalRangeVar(RangeVar *a, RangeVar *b)
  {
  	COMPARE_STRING_FIELD(catalogname);
  	COMPARE_STRING_FIELD(schemaname);
--- 98,104 ----
  }
  
  static bool
! _equalRangeVar(const RangeVar *a, const RangeVar *b)
  {
  	COMPARE_STRING_FIELD(catalogname);
  	COMPARE_STRING_FIELD(schemaname);
*************** _equalRangeVar(RangeVar *a, RangeVar *b)
*** 112,118 ****
  }
  
  static bool
! _equalIntoClause(IntoClause *a, IntoClause *b)
  {
  	COMPARE_NODE_FIELD(rel);
  	COMPARE_NODE_FIELD(colNames);
--- 112,118 ----
  }
  
  static bool
! _equalIntoClause(const IntoClause *a, const IntoClause *b)
  {
  	COMPARE_NODE_FIELD(rel);
  	COMPARE_NODE_FIELD(colNames);
*************** _equalIntoClause(IntoClause *a, IntoClau
*** 131,137 ****
   */
  
  static bool
! _equalVar(Var *a, Var *b)
  {
  	COMPARE_SCALAR_FIELD(varno);
  	COMPARE_SCALAR_FIELD(varattno);
--- 131,137 ----
   */
  
  static bool
! _equalVar(const Var *a, const Var *b)
  {
  	COMPARE_SCALAR_FIELD(varno);
  	COMPARE_SCALAR_FIELD(varattno);
*************** _equalVar(Var *a, Var *b)
*** 147,153 ****
  }
  
  static bool
! _equalConst(Const *a, Const *b)
  {
  	COMPARE_SCALAR_FIELD(consttype);
  	COMPARE_SCALAR_FIELD(consttypmod);
--- 147,153 ----
  }
  
  static bool
! _equalConst(const Const *a, const Const *b)
  {
  	COMPARE_SCALAR_FIELD(consttype);
  	COMPARE_SCALAR_FIELD(consttypmod);
*************** _equalConst(Const *a, Const *b)
*** 168,174 ****
  }
  
  static bool
! _equalParam(Param *a, Param *b)
  {
  	COMPARE_SCALAR_FIELD(paramkind);
  	COMPARE_SCALAR_FIELD(paramid);
--- 168,174 ----
  }
  
  static bool
! _equalParam(const Param *a, const Param *b)
  {
  	COMPARE_SCALAR_FIELD(paramkind);
  	COMPARE_SCALAR_FIELD(paramid);
*************** _equalParam(Param *a, Param *b)
*** 181,187 ****
  }
  
  static bool
! _equalAggref(Aggref *a, Aggref *b)
  {
  	COMPARE_SCALAR_FIELD(aggfnoid);
  	COMPARE_SCALAR_FIELD(aggtype);
--- 181,187 ----
  }
  
  static bool
! _equalAggref(const Aggref *a, const Aggref *b)
  {
  	COMPARE_SCALAR_FIELD(aggfnoid);
  	COMPARE_SCALAR_FIELD(aggtype);
*************** _equalAggref(Aggref *a, Aggref *b)
*** 198,204 ****
  }
  
  static bool
! _equalWindowFunc(WindowFunc *a, WindowFunc *b)
  {
  	COMPARE_SCALAR_FIELD(winfnoid);
  	COMPARE_SCALAR_FIELD(wintype);
--- 198,204 ----
  }
  
  static bool
! _equalWindowFunc(const WindowFunc *a, const WindowFunc *b)
  {
  	COMPARE_SCALAR_FIELD(winfnoid);
  	COMPARE_SCALAR_FIELD(wintype);
*************** _equalWindowFunc(WindowFunc *a, WindowFu
*** 214,220 ****
  }
  
  static bool
! _equalArrayRef(ArrayRef *a, ArrayRef *b)
  {
  	COMPARE_SCALAR_FIELD(refarraytype);
  	COMPARE_SCALAR_FIELD(refelemtype);
--- 214,220 ----
  }
  
  static bool
! _equalArrayRef(const ArrayRef *a, const ArrayRef *b)
  {
  	COMPARE_SCALAR_FIELD(refarraytype);
  	COMPARE_SCALAR_FIELD(refelemtype);
*************** _equalArrayRef(ArrayRef *a, ArrayRef *b)
*** 229,235 ****
  }
  
  static bool
! _equalFuncExpr(FuncExpr *a, FuncExpr *b)
  {
  	COMPARE_SCALAR_FIELD(funcid);
  	COMPARE_SCALAR_FIELD(funcresulttype);
--- 229,235 ----
  }
  
  static bool
! _equalFuncExpr(const FuncExpr *a, const FuncExpr *b)
  {
  	COMPARE_SCALAR_FIELD(funcid);
  	COMPARE_SCALAR_FIELD(funcresulttype);
*************** _equalFuncExpr(FuncExpr *a, FuncExpr *b)
*** 253,259 ****
  }
  
  static bool
! _equalNamedArgExpr(NamedArgExpr *a, NamedArgExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_STRING_FIELD(name);
--- 253,259 ----
  }
  
  static bool
! _equalNamedArgExpr(const NamedArgExpr *a, const NamedArgExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_STRING_FIELD(name);
*************** _equalNamedArgExpr(NamedArgExpr *a, Name
*** 264,270 ****
  }
  
  static bool
! _equalOpExpr(OpExpr *a, OpExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
--- 264,270 ----
  }
  
  static bool
! _equalOpExpr(const OpExpr *a, const OpExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
*************** _equalOpExpr(OpExpr *a, OpExpr *b)
*** 290,296 ****
  }
  
  static bool
! _equalDistinctExpr(DistinctExpr *a, DistinctExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
--- 290,296 ----
  }
  
  static bool
! _equalDistinctExpr(const DistinctExpr *a, const DistinctExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
*************** _equalDistinctExpr(DistinctExpr *a, Dist
*** 316,322 ****
  }
  
  static bool
! _equalNullIfExpr(NullIfExpr *a, NullIfExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
--- 316,322 ----
  }
  
  static bool
! _equalNullIfExpr(const NullIfExpr *a, const NullIfExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
*************** _equalNullIfExpr(NullIfExpr *a, NullIfEx
*** 342,348 ****
  }
  
  static bool
! _equalScalarArrayOpExpr(ScalarArrayOpExpr *a, ScalarArrayOpExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
--- 342,348 ----
  }
  
  static bool
! _equalScalarArrayOpExpr(const ScalarArrayOpExpr *a, const ScalarArrayOpExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
*************** _equalScalarArrayOpExpr(ScalarArrayOpExp
*** 366,372 ****
  }
  
  static bool
! _equalBoolExpr(BoolExpr *a, BoolExpr *b)
  {
  	COMPARE_SCALAR_FIELD(boolop);
  	COMPARE_NODE_FIELD(args);
--- 366,372 ----
  }
  
  static bool
! _equalBoolExpr(const BoolExpr *a, const BoolExpr *b)
  {
  	COMPARE_SCALAR_FIELD(boolop);
  	COMPARE_NODE_FIELD(args);
*************** _equalBoolExpr(BoolExpr *a, BoolExpr *b)
*** 376,382 ****
  }
  
  static bool
! _equalSubLink(SubLink *a, SubLink *b)
  {
  	COMPARE_SCALAR_FIELD(subLinkType);
  	COMPARE_NODE_FIELD(testexpr);
--- 376,382 ----
  }
  
  static bool
! _equalSubLink(const SubLink *a, const SubLink *b)
  {
  	COMPARE_SCALAR_FIELD(subLinkType);
  	COMPARE_NODE_FIELD(testexpr);
*************** _equalSubLink(SubLink *a, SubLink *b)
*** 388,394 ****
  }
  
  static bool
! _equalSubPlan(SubPlan *a, SubPlan *b)
  {
  	COMPARE_SCALAR_FIELD(subLinkType);
  	COMPARE_NODE_FIELD(testexpr);
--- 388,394 ----
  }
  
  static bool
! _equalSubPlan(const SubPlan *a, const SubPlan *b)
  {
  	COMPARE_SCALAR_FIELD(subLinkType);
  	COMPARE_NODE_FIELD(testexpr);
*************** _equalSubPlan(SubPlan *a, SubPlan *b)
*** 410,416 ****
  }
  
  static bool
! _equalAlternativeSubPlan(AlternativeSubPlan *a, AlternativeSubPlan *b)
  {
  	COMPARE_NODE_FIELD(subplans);
  
--- 410,416 ----
  }
  
  static bool
! _equalAlternativeSubPlan(const AlternativeSubPlan *a, const AlternativeSubPlan *b)
  {
  	COMPARE_NODE_FIELD(subplans);
  
*************** _equalAlternativeSubPlan(AlternativeSubP
*** 418,424 ****
  }
  
  static bool
! _equalFieldSelect(FieldSelect *a, FieldSelect *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(fieldnum);
--- 418,424 ----
  }
  
  static bool
! _equalFieldSelect(const FieldSelect *a, const FieldSelect *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(fieldnum);
*************** _equalFieldSelect(FieldSelect *a, FieldS
*** 430,436 ****
  }
  
  static bool
! _equalFieldStore(FieldStore *a, FieldStore *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(newvals);
--- 430,436 ----
  }
  
  static bool
! _equalFieldStore(const FieldStore *a, const FieldStore *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(newvals);
*************** _equalFieldStore(FieldStore *a, FieldSto
*** 441,447 ****
  }
  
  static bool
! _equalRelabelType(RelabelType *a, RelabelType *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
--- 441,447 ----
  }
  
  static bool
! _equalRelabelType(const RelabelType *a, const RelabelType *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
*************** _equalRelabelType(RelabelType *a, Relabe
*** 463,469 ****
  }
  
  static bool
! _equalCoerceViaIO(CoerceViaIO *a, CoerceViaIO *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
--- 463,469 ----
  }
  
  static bool
! _equalCoerceViaIO(const CoerceViaIO *a, const CoerceViaIO *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
*************** _equalCoerceViaIO(CoerceViaIO *a, Coerce
*** 484,490 ****
  }
  
  static bool
! _equalArrayCoerceExpr(ArrayCoerceExpr *a, ArrayCoerceExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(elemfuncid);
--- 484,490 ----
  }
  
  static bool
! _equalArrayCoerceExpr(const ArrayCoerceExpr *a, const ArrayCoerceExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(elemfuncid);
*************** _equalArrayCoerceExpr(ArrayCoerceExpr *a
*** 508,514 ****
  }
  
  static bool
! _equalConvertRowtypeExpr(ConvertRowtypeExpr *a, ConvertRowtypeExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
--- 508,514 ----
  }
  
  static bool
! _equalConvertRowtypeExpr(const ConvertRowtypeExpr *a, const ConvertRowtypeExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
*************** _equalConvertRowtypeExpr(ConvertRowtypeE
*** 528,534 ****
  }
  
  static bool
! _equalCollateExpr(CollateExpr *a, CollateExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(collOid);
--- 528,534 ----
  }
  
  static bool
! _equalCollateExpr(const CollateExpr *a, const CollateExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(collOid);
*************** _equalCollateExpr(CollateExpr *a, Collat
*** 538,544 ****
  }
  
  static bool
! _equalCaseExpr(CaseExpr *a, CaseExpr *b)
  {
  	COMPARE_SCALAR_FIELD(casetype);
  	COMPARE_SCALAR_FIELD(casecollid);
--- 538,544 ----
  }
  
  static bool
! _equalCaseExpr(const CaseExpr *a, const CaseExpr *b)
  {
  	COMPARE_SCALAR_FIELD(casetype);
  	COMPARE_SCALAR_FIELD(casecollid);
*************** _equalCaseExpr(CaseExpr *a, CaseExpr *b)
*** 551,557 ****
  }
  
  static bool
! _equalCaseWhen(CaseWhen *a, CaseWhen *b)
  {
  	COMPARE_NODE_FIELD(expr);
  	COMPARE_NODE_FIELD(result);
--- 551,557 ----
  }
  
  static bool
! _equalCaseWhen(const CaseWhen *a, const CaseWhen *b)
  {
  	COMPARE_NODE_FIELD(expr);
  	COMPARE_NODE_FIELD(result);
*************** _equalCaseWhen(CaseWhen *a, CaseWhen *b)
*** 561,567 ****
  }
  
  static bool
! _equalCaseTestExpr(CaseTestExpr *a, CaseTestExpr *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
--- 561,567 ----
  }
  
  static bool
! _equalCaseTestExpr(const CaseTestExpr *a, const CaseTestExpr *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
*************** _equalCaseTestExpr(CaseTestExpr *a, Case
*** 571,577 ****
  }
  
  static bool
! _equalArrayExpr(ArrayExpr *a, ArrayExpr *b)
  {
  	COMPARE_SCALAR_FIELD(array_typeid);
  	COMPARE_SCALAR_FIELD(array_collid);
--- 571,577 ----
  }
  
  static bool
! _equalArrayExpr(const ArrayExpr *a, const ArrayExpr *b)
  {
  	COMPARE_SCALAR_FIELD(array_typeid);
  	COMPARE_SCALAR_FIELD(array_collid);
*************** _equalArrayExpr(ArrayExpr *a, ArrayExpr
*** 584,590 ****
  }
  
  static bool
! _equalRowExpr(RowExpr *a, RowExpr *b)
  {
  	COMPARE_NODE_FIELD(args);
  	COMPARE_SCALAR_FIELD(row_typeid);
--- 584,590 ----
  }
  
  static bool
! _equalRowExpr(const RowExpr *a, const RowExpr *b)
  {
  	COMPARE_NODE_FIELD(args);
  	COMPARE_SCALAR_FIELD(row_typeid);
*************** _equalRowExpr(RowExpr *a, RowExpr *b)
*** 605,611 ****
  }
  
  static bool
! _equalRowCompareExpr(RowCompareExpr *a, RowCompareExpr *b)
  {
  	COMPARE_SCALAR_FIELD(rctype);
  	COMPARE_NODE_FIELD(opnos);
--- 605,611 ----
  }
  
  static bool
! _equalRowCompareExpr(const RowCompareExpr *a, const RowCompareExpr *b)
  {
  	COMPARE_SCALAR_FIELD(rctype);
  	COMPARE_NODE_FIELD(opnos);
*************** _equalRowCompareExpr(RowCompareExpr *a,
*** 618,624 ****
  }
  
  static bool
! _equalCoalesceExpr(CoalesceExpr *a, CoalesceExpr *b)
  {
  	COMPARE_SCALAR_FIELD(coalescetype);
  	COMPARE_SCALAR_FIELD(coalescecollid);
--- 618,624 ----
  }
  
  static bool
! _equalCoalesceExpr(const CoalesceExpr *a, const CoalesceExpr *b)
  {
  	COMPARE_SCALAR_FIELD(coalescetype);
  	COMPARE_SCALAR_FIELD(coalescecollid);
*************** _equalCoalesceExpr(CoalesceExpr *a, Coal
*** 629,635 ****
  }
  
  static bool
! _equalMinMaxExpr(MinMaxExpr *a, MinMaxExpr *b)
  {
  	COMPARE_SCALAR_FIELD(minmaxtype);
  	COMPARE_SCALAR_FIELD(minmaxcollid);
--- 629,635 ----
  }
  
  static bool
! _equalMinMaxExpr(const MinMaxExpr *a, const MinMaxExpr *b)
  {
  	COMPARE_SCALAR_FIELD(minmaxtype);
  	COMPARE_SCALAR_FIELD(minmaxcollid);
*************** _equalMinMaxExpr(MinMaxExpr *a, MinMaxEx
*** 642,648 ****
  }
  
  static bool
! _equalXmlExpr(XmlExpr *a, XmlExpr *b)
  {
  	COMPARE_SCALAR_FIELD(op);
  	COMPARE_STRING_FIELD(name);
--- 642,648 ----
  }
  
  static bool
! _equalXmlExpr(const XmlExpr *a, const XmlExpr *b)
  {
  	COMPARE_SCALAR_FIELD(op);
  	COMPARE_STRING_FIELD(name);
*************** _equalXmlExpr(XmlExpr *a, XmlExpr *b)
*** 658,664 ****
  }
  
  static bool
! _equalNullTest(NullTest *a, NullTest *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(nulltesttype);
--- 658,664 ----
  }
  
  static bool
! _equalNullTest(const NullTest *a, const NullTest *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(nulltesttype);
*************** _equalNullTest(NullTest *a, NullTest *b)
*** 668,674 ****
  }
  
  static bool
! _equalBooleanTest(BooleanTest *a, BooleanTest *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(booltesttype);
--- 668,674 ----
  }
  
  static bool
! _equalBooleanTest(const BooleanTest *a, const BooleanTest *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(booltesttype);
*************** _equalBooleanTest(BooleanTest *a, Boolea
*** 677,683 ****
  }
  
  static bool
! _equalCoerceToDomain(CoerceToDomain *a, CoerceToDomain *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
--- 677,683 ----
  }
  
  static bool
! _equalCoerceToDomain(const CoerceToDomain *a, const CoerceToDomain *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
*************** _equalCoerceToDomain(CoerceToDomain *a,
*** 699,705 ****
  }
  
  static bool
! _equalCoerceToDomainValue(CoerceToDomainValue *a, CoerceToDomainValue *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
--- 699,705 ----
  }
  
  static bool
! _equalCoerceToDomainValue(const CoerceToDomainValue *a, const CoerceToDomainValue *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
*************** _equalCoerceToDomainValue(CoerceToDomain
*** 710,716 ****
  }
  
  static bool
! _equalSetToDefault(SetToDefault *a, SetToDefault *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
--- 710,716 ----
  }
  
  static bool
! _equalSetToDefault(const SetToDefault *a, const SetToDefault *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
*************** _equalSetToDefault(SetToDefault *a, SetT
*** 721,727 ****
  }
  
  static bool
! _equalCurrentOfExpr(CurrentOfExpr *a, CurrentOfExpr *b)
  {
  	COMPARE_SCALAR_FIELD(cvarno);
  	COMPARE_STRING_FIELD(cursor_name);
--- 721,727 ----
  }
  
  static bool
! _equalCurrentOfExpr(const CurrentOfExpr *a, const CurrentOfExpr *b)
  {
  	COMPARE_SCALAR_FIELD(cvarno);
  	COMPARE_STRING_FIELD(cursor_name);
*************** _equalCurrentOfExpr(CurrentOfExpr *a, Cu
*** 731,737 ****
  }
  
  static bool
! _equalTargetEntry(TargetEntry *a, TargetEntry *b)
  {
  	COMPARE_NODE_FIELD(expr);
  	COMPARE_SCALAR_FIELD(resno);
--- 731,737 ----
  }
  
  static bool
! _equalTargetEntry(const TargetEntry *a, const TargetEntry *b)
  {
  	COMPARE_NODE_FIELD(expr);
  	COMPARE_SCALAR_FIELD(resno);
*************** _equalTargetEntry(TargetEntry *a, Target
*** 745,751 ****
  }
  
  static bool
! _equalRangeTblRef(RangeTblRef *a, RangeTblRef *b)
  {
  	COMPARE_SCALAR_FIELD(rtindex);
  
--- 745,751 ----
  }
  
  static bool
! _equalRangeTblRef(const RangeTblRef *a, const RangeTblRef *b)
  {
  	COMPARE_SCALAR_FIELD(rtindex);
  
*************** _equalRangeTblRef(RangeTblRef *a, RangeT
*** 753,759 ****
  }
  
  static bool
! _equalJoinExpr(JoinExpr *a, JoinExpr *b)
  {
  	COMPARE_SCALAR_FIELD(jointype);
  	COMPARE_SCALAR_FIELD(isNatural);
--- 753,759 ----
  }
  
  static bool
! _equalJoinExpr(const JoinExpr *a, const JoinExpr *b)
  {
  	COMPARE_SCALAR_FIELD(jointype);
  	COMPARE_SCALAR_FIELD(isNatural);
*************** _equalJoinExpr(JoinExpr *a, JoinExpr *b)
*** 768,774 ****
  }
  
  static bool
! _equalFromExpr(FromExpr *a, FromExpr *b)
  {
  	COMPARE_NODE_FIELD(fromlist);
  	COMPARE_NODE_FIELD(quals);
--- 768,774 ----
  }
  
  static bool
! _equalFromExpr(const FromExpr *a, const FromExpr *b)
  {
  	COMPARE_NODE_FIELD(fromlist);
  	COMPARE_NODE_FIELD(quals);
*************** _equalFromExpr(FromExpr *a, FromExpr *b)
*** 782,788 ****
   */
  
  static bool
! _equalPathKey(PathKey *a, PathKey *b)
  {
  	/*
  	 * This is normally used on non-canonicalized PathKeys, so must chase up
--- 782,788 ----
   */
  
  static bool
! _equalPathKey(const PathKey *a, const PathKey *b)
  {
  	/*
  	 * This is normally used on non-canonicalized PathKeys, so must chase up
*************** _equalPathKey(PathKey *a, PathKey *b)
*** 808,814 ****
  }
  
  static bool
! _equalRestrictInfo(RestrictInfo *a, RestrictInfo *b)
  {
  	COMPARE_NODE_FIELD(clause);
  	COMPARE_SCALAR_FIELD(is_pushed_down);
--- 808,814 ----
  }
  
  static bool
! _equalRestrictInfo(const RestrictInfo *a, const RestrictInfo *b)
  {
  	COMPARE_NODE_FIELD(clause);
  	COMPARE_SCALAR_FIELD(is_pushed_down);
*************** _equalRestrictInfo(RestrictInfo *a, Rest
*** 825,831 ****
  }
  
  static bool
! _equalPlaceHolderVar(PlaceHolderVar *a, PlaceHolderVar *b)
  {
  	/*
  	 * We intentionally do not compare phexpr.	Two PlaceHolderVars with the
--- 825,831 ----
  }
  
  static bool
! _equalPlaceHolderVar(const PlaceHolderVar *a, const PlaceHolderVar *b)
  {
  	/*
  	 * We intentionally do not compare phexpr.	Two PlaceHolderVars with the
*************** _equalPlaceHolderVar(PlaceHolderVar *a,
*** 846,852 ****
  }
  
  static bool
! _equalSpecialJoinInfo(SpecialJoinInfo *a, SpecialJoinInfo *b)
  {
  	COMPARE_BITMAPSET_FIELD(min_lefthand);
  	COMPARE_BITMAPSET_FIELD(min_righthand);
--- 846,852 ----
  }
  
  static bool
! _equalSpecialJoinInfo(const SpecialJoinInfo *a, const SpecialJoinInfo *b)
  {
  	COMPARE_BITMAPSET_FIELD(min_lefthand);
  	COMPARE_BITMAPSET_FIELD(min_righthand);
*************** _equalSpecialJoinInfo(SpecialJoinInfo *a
*** 861,867 ****
  }
  
  static bool
! _equalAppendRelInfo(AppendRelInfo *a, AppendRelInfo *b)
  {
  	COMPARE_SCALAR_FIELD(parent_relid);
  	COMPARE_SCALAR_FIELD(child_relid);
--- 861,867 ----
  }
  
  static bool
! _equalAppendRelInfo(const AppendRelInfo *a, const AppendRelInfo *b)
  {
  	COMPARE_SCALAR_FIELD(parent_relid);
  	COMPARE_SCALAR_FIELD(child_relid);
*************** _equalAppendRelInfo(AppendRelInfo *a, Ap
*** 874,880 ****
  }
  
  static bool
! _equalPlaceHolderInfo(PlaceHolderInfo *a, PlaceHolderInfo *b)
  {
  	COMPARE_SCALAR_FIELD(phid);
  	COMPARE_NODE_FIELD(ph_var);
--- 874,880 ----
  }
  
  static bool
! _equalPlaceHolderInfo(const PlaceHolderInfo *a, const PlaceHolderInfo *b)
  {
  	COMPARE_SCALAR_FIELD(phid);
  	COMPARE_NODE_FIELD(ph_var);
*************** _equalPlaceHolderInfo(PlaceHolderInfo *a
*** 892,898 ****
   */
  
  static bool
! _equalQuery(Query *a, Query *b)
  {
  	COMPARE_SCALAR_FIELD(commandType);
  	COMPARE_SCALAR_FIELD(querySource);
--- 892,898 ----
   */
  
  static bool
! _equalQuery(const Query *a, const Query *b)
  {
  	COMPARE_SCALAR_FIELD(commandType);
  	COMPARE_SCALAR_FIELD(querySource);
*************** _equalQuery(Query *a, Query *b)
*** 927,933 ****
  }
  
  static bool
! _equalInsertStmt(InsertStmt *a, InsertStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(cols);
--- 927,933 ----
  }
  
  static bool
! _equalInsertStmt(const InsertStmt *a, const InsertStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(cols);
*************** _equalInsertStmt(InsertStmt *a, InsertSt
*** 939,945 ****
  }
  
  static bool
! _equalDeleteStmt(DeleteStmt *a, DeleteStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(usingClause);
--- 939,945 ----
  }
  
  static bool
! _equalDeleteStmt(const DeleteStmt *a, const DeleteStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(usingClause);
*************** _equalDeleteStmt(DeleteStmt *a, DeleteSt
*** 951,957 ****
  }
  
  static bool
! _equalUpdateStmt(UpdateStmt *a, UpdateStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(targetList);
--- 951,957 ----
  }
  
  static bool
! _equalUpdateStmt(const UpdateStmt *a, const UpdateStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(targetList);
*************** _equalUpdateStmt(UpdateStmt *a, UpdateSt
*** 964,970 ****
  }
  
  static bool
! _equalSelectStmt(SelectStmt *a, SelectStmt *b)
  {
  	COMPARE_NODE_FIELD(distinctClause);
  	COMPARE_NODE_FIELD(intoClause);
--- 964,970 ----
  }
  
  static bool
! _equalSelectStmt(const SelectStmt *a, const SelectStmt *b)
  {
  	COMPARE_NODE_FIELD(distinctClause);
  	COMPARE_NODE_FIELD(intoClause);
*************** _equalSelectStmt(SelectStmt *a, SelectSt
*** 989,995 ****
  }
  
  static bool
! _equalSetOperationStmt(SetOperationStmt *a, SetOperationStmt *b)
  {
  	COMPARE_SCALAR_FIELD(op);
  	COMPARE_SCALAR_FIELD(all);
--- 989,995 ----
  }
  
  static bool
! _equalSetOperationStmt(const SetOperationStmt *a, const SetOperationStmt *b)
  {
  	COMPARE_SCALAR_FIELD(op);
  	COMPARE_SCALAR_FIELD(all);
*************** _equalSetOperationStmt(SetOperationStmt
*** 1004,1010 ****
  }
  
  static bool
! _equalAlterTableStmt(AlterTableStmt *a, AlterTableStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(cmds);
--- 1004,1010 ----
  }
  
  static bool
! _equalAlterTableStmt(const AlterTableStmt *a, const AlterTableStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(cmds);
*************** _equalAlterTableStmt(AlterTableStmt *a,
*** 1014,1020 ****
  }
  
  static bool
! _equalAlterTableCmd(AlterTableCmd *a, AlterTableCmd *b)
  {
  	COMPARE_SCALAR_FIELD(subtype);
  	COMPARE_STRING_FIELD(name);
--- 1014,1020 ----
  }
  
  static bool
! _equalAlterTableCmd(const AlterTableCmd *a, const AlterTableCmd *b)
  {
  	COMPARE_SCALAR_FIELD(subtype);
  	COMPARE_STRING_FIELD(name);
*************** _equalAlterTableCmd(AlterTableCmd *a, Al
*** 1026,1032 ****
  }
  
  static bool
! _equalAlterDomainStmt(AlterDomainStmt *a, AlterDomainStmt *b)
  {
  	COMPARE_SCALAR_FIELD(subtype);
  	COMPARE_NODE_FIELD(typeName);
--- 1026,1032 ----
  }
  
  static bool
! _equalAlterDomainStmt(const AlterDomainStmt *a, const AlterDomainStmt *b)
  {
  	COMPARE_SCALAR_FIELD(subtype);
  	COMPARE_NODE_FIELD(typeName);
*************** _equalAlterDomainStmt(AlterDomainStmt *a
*** 1038,1044 ****
  }
  
  static bool
! _equalGrantStmt(GrantStmt *a, GrantStmt *b)
  {
  	COMPARE_SCALAR_FIELD(is_grant);
  	COMPARE_SCALAR_FIELD(targtype);
--- 1038,1044 ----
  }
  
  static bool
! _equalGrantStmt(const GrantStmt *a, const GrantStmt *b)
  {
  	COMPARE_SCALAR_FIELD(is_grant);
  	COMPARE_SCALAR_FIELD(targtype);
*************** _equalGrantStmt(GrantStmt *a, GrantStmt
*** 1053,1059 ****
  }
  
  static bool
! _equalPrivGrantee(PrivGrantee *a, PrivGrantee *b)
  {
  	COMPARE_STRING_FIELD(rolname);
  
--- 1053,1059 ----
  }
  
  static bool
! _equalPrivGrantee(const PrivGrantee *a, const PrivGrantee *b)
  {
  	COMPARE_STRING_FIELD(rolname);
  
*************** _equalPrivGrantee(PrivGrantee *a, PrivGr
*** 1061,1067 ****
  }
  
  static bool
! _equalFuncWithArgs(FuncWithArgs *a, FuncWithArgs *b)
  {
  	COMPARE_NODE_FIELD(funcname);
  	COMPARE_NODE_FIELD(funcargs);
--- 1061,1067 ----
  }
  
  static bool
! _equalFuncWithArgs(const FuncWithArgs *a, const FuncWithArgs *b)
  {
  	COMPARE_NODE_FIELD(funcname);
  	COMPARE_NODE_FIELD(funcargs);
*************** _equalFuncWithArgs(FuncWithArgs *a, Func
*** 1070,1076 ****
  }
  
  static bool
! _equalAccessPriv(AccessPriv *a, AccessPriv *b)
  {
  	COMPARE_STRING_FIELD(priv_name);
  	COMPARE_NODE_FIELD(cols);
--- 1070,1076 ----
  }
  
  static bool
! _equalAccessPriv(const AccessPriv *a, const AccessPriv *b)
  {
  	COMPARE_STRING_FIELD(priv_name);
  	COMPARE_NODE_FIELD(cols);
*************** _equalAccessPriv(AccessPriv *a, AccessPr
*** 1079,1085 ****
  }
  
  static bool
! _equalGrantRoleStmt(GrantRoleStmt *a, GrantRoleStmt *b)
  {
  	COMPARE_NODE_FIELD(granted_roles);
  	COMPARE_NODE_FIELD(grantee_roles);
--- 1079,1085 ----
  }
  
  static bool
! _equalGrantRoleStmt(const GrantRoleStmt *a, const GrantRoleStmt *b)
  {
  	COMPARE_NODE_FIELD(granted_roles);
  	COMPARE_NODE_FIELD(grantee_roles);
*************** _equalGrantRoleStmt(GrantRoleStmt *a, Gr
*** 1092,1098 ****
  }
  
  static bool
! _equalAlterDefaultPrivilegesStmt(AlterDefaultPrivilegesStmt *a, AlterDefaultPrivilegesStmt *b)
  {
  	COMPARE_NODE_FIELD(options);
  	COMPARE_NODE_FIELD(action);
--- 1092,1098 ----
  }
  
  static bool
! _equalAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *a, const AlterDefaultPrivilegesStmt *b)
  {
  	COMPARE_NODE_FIELD(options);
  	COMPARE_NODE_FIELD(action);
*************** _equalAlterDefaultPrivilegesStmt(AlterDe
*** 1101,1107 ****
  }
  
  static bool
! _equalDeclareCursorStmt(DeclareCursorStmt *a, DeclareCursorStmt *b)
  {
  	COMPARE_STRING_FIELD(portalname);
  	COMPARE_SCALAR_FIELD(options);
--- 1101,1107 ----
  }
  
  static bool
! _equalDeclareCursorStmt(const DeclareCursorStmt *a, const DeclareCursorStmt *b)
  {
  	COMPARE_STRING_FIELD(portalname);
  	COMPARE_SCALAR_FIELD(options);
*************** _equalDeclareCursorStmt(DeclareCursorStm
*** 1111,1117 ****
  }
  
  static bool
! _equalClosePortalStmt(ClosePortalStmt *a, ClosePortalStmt *b)
  {
  	COMPARE_STRING_FIELD(portalname);
  
--- 1111,1117 ----
  }
  
  static bool
! _equalClosePortalStmt(const ClosePortalStmt *a, const ClosePortalStmt *b)
  {
  	COMPARE_STRING_FIELD(portalname);
  
*************** _equalClosePortalStmt(ClosePortalStmt *a
*** 1119,1125 ****
  }
  
  static bool
! _equalClusterStmt(ClusterStmt *a, ClusterStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(indexname);
--- 1119,1125 ----
  }
  
  static bool
! _equalClusterStmt(const ClusterStmt *a, const ClusterStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(indexname);
*************** _equalClusterStmt(ClusterStmt *a, Cluste
*** 1129,1135 ****
  }
  
  static bool
! _equalCopyStmt(CopyStmt *a, CopyStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(query);
--- 1129,1135 ----
  }
  
  static bool
! _equalCopyStmt(const CopyStmt *a, const CopyStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(query);
*************** _equalCopyStmt(CopyStmt *a, CopyStmt *b)
*** 1142,1148 ****
  }
  
  static bool
! _equalCreateStmt(CreateStmt *a, CreateStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(tableElts);
--- 1142,1148 ----
  }
  
  static bool
! _equalCreateStmt(const CreateStmt *a, const CreateStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(tableElts);
*************** _equalCreateStmt(CreateStmt *a, CreateSt
*** 1158,1164 ****
  }
  
  static bool
! _equalInhRelation(InhRelation *a, InhRelation *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_SCALAR_FIELD(options);
--- 1158,1164 ----
  }
  
  static bool
! _equalInhRelation(const InhRelation *a, const InhRelation *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_SCALAR_FIELD(options);
*************** _equalInhRelation(InhRelation *a, InhRel
*** 1167,1173 ****
  }
  
  static bool
! _equalDefineStmt(DefineStmt *a, DefineStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_SCALAR_FIELD(oldstyle);
--- 1167,1173 ----
  }
  
  static bool
! _equalDefineStmt(const DefineStmt *a, const DefineStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_SCALAR_FIELD(oldstyle);
*************** _equalDefineStmt(DefineStmt *a, DefineSt
*** 1179,1185 ****
  }
  
  static bool
! _equalDropStmt(DropStmt *a, DropStmt *b)
  {
  	COMPARE_NODE_FIELD(objects);
  	COMPARE_SCALAR_FIELD(removeType);
--- 1179,1185 ----
  }
  
  static bool
! _equalDropStmt(const DropStmt *a, const DropStmt *b)
  {
  	COMPARE_NODE_FIELD(objects);
  	COMPARE_SCALAR_FIELD(removeType);
*************** _equalDropStmt(DropStmt *a, DropStmt *b)
*** 1190,1196 ****
  }
  
  static bool
! _equalTruncateStmt(TruncateStmt *a, TruncateStmt *b)
  {
  	COMPARE_NODE_FIELD(relations);
  	COMPARE_SCALAR_FIELD(restart_seqs);
--- 1190,1196 ----
  }
  
  static bool
! _equalTruncateStmt(const TruncateStmt *a, const TruncateStmt *b)
  {
  	COMPARE_NODE_FIELD(relations);
  	COMPARE_SCALAR_FIELD(restart_seqs);
*************** _equalTruncateStmt(TruncateStmt *a, Trun
*** 1200,1206 ****
  }
  
  static bool
! _equalCommentStmt(CommentStmt *a, CommentStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objtype);
  	COMPARE_NODE_FIELD(objname);
--- 1200,1206 ----
  }
  
  static bool
! _equalCommentStmt(const CommentStmt *a, const CommentStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objtype);
  	COMPARE_NODE_FIELD(objname);
*************** _equalCommentStmt(CommentStmt *a, Commen
*** 1211,1217 ****
  }
  
  static bool
! _equalSecLabelStmt(SecLabelStmt *a, SecLabelStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objtype);
  	COMPARE_NODE_FIELD(objname);
--- 1211,1217 ----
  }
  
  static bool
! _equalSecLabelStmt(const SecLabelStmt *a, const SecLabelStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objtype);
  	COMPARE_NODE_FIELD(objname);
*************** _equalSecLabelStmt(SecLabelStmt *a, SecL
*** 1223,1229 ****
  }
  
  static bool
! _equalFetchStmt(FetchStmt *a, FetchStmt *b)
  {
  	COMPARE_SCALAR_FIELD(direction);
  	COMPARE_SCALAR_FIELD(howMany);
--- 1223,1229 ----
  }
  
  static bool
! _equalFetchStmt(const FetchStmt *a, const FetchStmt *b)
  {
  	COMPARE_SCALAR_FIELD(direction);
  	COMPARE_SCALAR_FIELD(howMany);
*************** _equalFetchStmt(FetchStmt *a, FetchStmt
*** 1234,1240 ****
  }
  
  static bool
! _equalIndexStmt(IndexStmt *a, IndexStmt *b)
  {
  	COMPARE_STRING_FIELD(idxname);
  	COMPARE_NODE_FIELD(relation);
--- 1234,1240 ----
  }
  
  static bool
! _equalIndexStmt(const IndexStmt *a, const IndexStmt *b)
  {
  	COMPARE_STRING_FIELD(idxname);
  	COMPARE_NODE_FIELD(relation);
*************** _equalIndexStmt(IndexStmt *a, IndexStmt
*** 1257,1263 ****
  }
  
  static bool
! _equalCreateFunctionStmt(CreateFunctionStmt *a, CreateFunctionStmt *b)
  {
  	COMPARE_SCALAR_FIELD(replace);
  	COMPARE_NODE_FIELD(funcname);
--- 1257,1263 ----
  }
  
  static bool
! _equalCreateFunctionStmt(const CreateFunctionStmt *a, const CreateFunctionStmt *b)
  {
  	COMPARE_SCALAR_FIELD(replace);
  	COMPARE_NODE_FIELD(funcname);
*************** _equalCreateFunctionStmt(CreateFunctionS
*** 1270,1276 ****
  }
  
  static bool
! _equalFunctionParameter(FunctionParameter *a, FunctionParameter *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(argType);
--- 1270,1276 ----
  }
  
  static bool
! _equalFunctionParameter(const FunctionParameter *a, const FunctionParameter *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(argType);
*************** _equalFunctionParameter(FunctionParamete
*** 1281,1287 ****
  }
  
  static bool
! _equalAlterFunctionStmt(AlterFunctionStmt *a, AlterFunctionStmt *b)
  {
  	COMPARE_NODE_FIELD(func);
  	COMPARE_NODE_FIELD(actions);
--- 1281,1287 ----
  }
  
  static bool
! _equalAlterFunctionStmt(const AlterFunctionStmt *a, const AlterFunctionStmt *b)
  {
  	COMPARE_NODE_FIELD(func);
  	COMPARE_NODE_FIELD(actions);
*************** _equalAlterFunctionStmt(AlterFunctionStm
*** 1290,1296 ****
  }
  
  static bool
! _equalRemoveFuncStmt(RemoveFuncStmt *a, RemoveFuncStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(name);
--- 1290,1296 ----
  }
  
  static bool
! _equalRemoveFuncStmt(const RemoveFuncStmt *a, const RemoveFuncStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(name);
*************** _equalRemoveFuncStmt(RemoveFuncStmt *a,
*** 1302,1308 ****
  }
  
  static bool
! _equalDoStmt(DoStmt *a, DoStmt *b)
  {
  	COMPARE_NODE_FIELD(args);
  
--- 1302,1308 ----
  }
  
  static bool
! _equalDoStmt(const DoStmt *a, const DoStmt *b)
  {
  	COMPARE_NODE_FIELD(args);
  
*************** _equalDoStmt(DoStmt *a, DoStmt *b)
*** 1310,1316 ****
  }
  
  static bool
! _equalRemoveOpClassStmt(RemoveOpClassStmt *a, RemoveOpClassStmt *b)
  {
  	COMPARE_NODE_FIELD(opclassname);
  	COMPARE_STRING_FIELD(amname);
--- 1310,1316 ----
  }
  
  static bool
! _equalRemoveOpClassStmt(const RemoveOpClassStmt *a, const RemoveOpClassStmt *b)
  {
  	COMPARE_NODE_FIELD(opclassname);
  	COMPARE_STRING_FIELD(amname);
*************** _equalRemoveOpClassStmt(RemoveOpClassStm
*** 1321,1327 ****
  }
  
  static bool
! _equalRemoveOpFamilyStmt(RemoveOpFamilyStmt *a, RemoveOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
--- 1321,1327 ----
  }
  
  static bool
! _equalRemoveOpFamilyStmt(const RemoveOpFamilyStmt *a, const RemoveOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
*************** _equalRemoveOpFamilyStmt(RemoveOpFamilyS
*** 1332,1338 ****
  }
  
  static bool
! _equalRenameStmt(RenameStmt *a, RenameStmt *b)
  {
  	COMPARE_SCALAR_FIELD(renameType);
  	COMPARE_NODE_FIELD(relation);
--- 1332,1338 ----
  }
  
  static bool
! _equalRenameStmt(const RenameStmt *a, const RenameStmt *b)
  {
  	COMPARE_SCALAR_FIELD(renameType);
  	COMPARE_NODE_FIELD(relation);
*************** _equalRenameStmt(RenameStmt *a, RenameSt
*** 1346,1352 ****
  }
  
  static bool
! _equalAlterObjectSchemaStmt(AlterObjectSchemaStmt *a, AlterObjectSchemaStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objectType);
  	COMPARE_NODE_FIELD(relation);
--- 1346,1352 ----
  }
  
  static bool
! _equalAlterObjectSchemaStmt(const AlterObjectSchemaStmt *a, const AlterObjectSchemaStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objectType);
  	COMPARE_NODE_FIELD(relation);
*************** _equalAlterObjectSchemaStmt(AlterObjectS
*** 1359,1365 ****
  }
  
  static bool
! _equalAlterOwnerStmt(AlterOwnerStmt *a, AlterOwnerStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objectType);
  	COMPARE_NODE_FIELD(relation);
--- 1359,1365 ----
  }
  
  static bool
! _equalAlterOwnerStmt(const AlterOwnerStmt *a, const AlterOwnerStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objectType);
  	COMPARE_NODE_FIELD(relation);
*************** _equalAlterOwnerStmt(AlterOwnerStmt *a,
*** 1372,1378 ****
  }
  
  static bool
! _equalRuleStmt(RuleStmt *a, RuleStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(rulename);
--- 1372,1378 ----
  }
  
  static bool
! _equalRuleStmt(const RuleStmt *a, const RuleStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(rulename);
*************** _equalRuleStmt(RuleStmt *a, RuleStmt *b)
*** 1386,1392 ****
  }
  
  static bool
! _equalNotifyStmt(NotifyStmt *a, NotifyStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  	COMPARE_STRING_FIELD(payload);
--- 1386,1392 ----
  }
  
  static bool
! _equalNotifyStmt(const NotifyStmt *a, const NotifyStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  	COMPARE_STRING_FIELD(payload);
*************** _equalNotifyStmt(NotifyStmt *a, NotifySt
*** 1395,1401 ****
  }
  
  static bool
! _equalListenStmt(ListenStmt *a, ListenStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  
--- 1395,1401 ----
  }
  
  static bool
! _equalListenStmt(const ListenStmt *a, const ListenStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  
*************** _equalListenStmt(ListenStmt *a, ListenSt
*** 1403,1409 ****
  }
  
  static bool
! _equalUnlistenStmt(UnlistenStmt *a, UnlistenStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  
--- 1403,1409 ----
  }
  
  static bool
! _equalUnlistenStmt(const UnlistenStmt *a, const UnlistenStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  
*************** _equalUnlistenStmt(UnlistenStmt *a, Unli
*** 1411,1417 ****
  }
  
  static bool
! _equalTransactionStmt(TransactionStmt *a, TransactionStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(options);
--- 1411,1417 ----
  }
  
  static bool
! _equalTransactionStmt(const TransactionStmt *a, const TransactionStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(options);
*************** _equalTransactionStmt(TransactionStmt *a
*** 1421,1427 ****
  }
  
  static bool
! _equalCompositeTypeStmt(CompositeTypeStmt *a, CompositeTypeStmt *b)
  {
  	COMPARE_NODE_FIELD(typevar);
  	COMPARE_NODE_FIELD(coldeflist);
--- 1421,1427 ----
  }
  
  static bool
! _equalCompositeTypeStmt(const CompositeTypeStmt *a, const CompositeTypeStmt *b)
  {
  	COMPARE_NODE_FIELD(typevar);
  	COMPARE_NODE_FIELD(coldeflist);
*************** _equalCompositeTypeStmt(CompositeTypeStm
*** 1430,1436 ****
  }
  
  static bool
! _equalCreateEnumStmt(CreateEnumStmt *a, CreateEnumStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_NODE_FIELD(vals);
--- 1430,1436 ----
  }
  
  static bool
! _equalCreateEnumStmt(const CreateEnumStmt *a, const CreateEnumStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_NODE_FIELD(vals);
*************** _equalCreateEnumStmt(CreateEnumStmt *a,
*** 1439,1445 ****
  }
  
  static bool
! _equalCreateRangeStmt(CreateRangeStmt *a, CreateRangeStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_NODE_FIELD(params);
--- 1439,1445 ----
  }
  
  static bool
! _equalCreateRangeStmt(const CreateRangeStmt *a, const CreateRangeStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_NODE_FIELD(params);
*************** _equalCreateRangeStmt(CreateRangeStmt *a
*** 1448,1454 ****
  }
  
  static bool
! _equalAlterEnumStmt(AlterEnumStmt *a, AlterEnumStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_STRING_FIELD(newVal);
--- 1448,1454 ----
  }
  
  static bool
! _equalAlterEnumStmt(const AlterEnumStmt *a, const AlterEnumStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_STRING_FIELD(newVal);
*************** _equalAlterEnumStmt(AlterEnumStmt *a, Al
*** 1459,1465 ****
  }
  
  static bool
! _equalViewStmt(ViewStmt *a, ViewStmt *b)
  {
  	COMPARE_NODE_FIELD(view);
  	COMPARE_NODE_FIELD(aliases);
--- 1459,1465 ----
  }
  
  static bool
! _equalViewStmt(const ViewStmt *a, const ViewStmt *b)
  {
  	COMPARE_NODE_FIELD(view);
  	COMPARE_NODE_FIELD(aliases);
*************** _equalViewStmt(ViewStmt *a, ViewStmt *b)
*** 1470,1476 ****
  }
  
  static bool
! _equalLoadStmt(LoadStmt *a, LoadStmt *b)
  {
  	COMPARE_STRING_FIELD(filename);
  
--- 1470,1476 ----
  }
  
  static bool
! _equalLoadStmt(const LoadStmt *a, const LoadStmt *b)
  {
  	COMPARE_STRING_FIELD(filename);
  
*************** _equalLoadStmt(LoadStmt *a, LoadStmt *b)
*** 1478,1484 ****
  }
  
  static bool
! _equalCreateDomainStmt(CreateDomainStmt *a, CreateDomainStmt *b)
  {
  	COMPARE_NODE_FIELD(domainname);
  	COMPARE_NODE_FIELD(typeName);
--- 1478,1484 ----
  }
  
  static bool
! _equalCreateDomainStmt(const CreateDomainStmt *a, const CreateDomainStmt *b)
  {
  	COMPARE_NODE_FIELD(domainname);
  	COMPARE_NODE_FIELD(typeName);
*************** _equalCreateDomainStmt(CreateDomainStmt
*** 1489,1495 ****
  }
  
  static bool
! _equalCreateOpClassStmt(CreateOpClassStmt *a, CreateOpClassStmt *b)
  {
  	COMPARE_NODE_FIELD(opclassname);
  	COMPARE_NODE_FIELD(opfamilyname);
--- 1489,1495 ----
  }
  
  static bool
! _equalCreateOpClassStmt(const CreateOpClassStmt *a, const CreateOpClassStmt *b)
  {
  	COMPARE_NODE_FIELD(opclassname);
  	COMPARE_NODE_FIELD(opfamilyname);
*************** _equalCreateOpClassStmt(CreateOpClassStm
*** 1502,1508 ****
  }
  
  static bool
! _equalCreateOpClassItem(CreateOpClassItem *a, CreateOpClassItem *b)
  {
  	COMPARE_SCALAR_FIELD(itemtype);
  	COMPARE_NODE_FIELD(name);
--- 1502,1508 ----
  }
  
  static bool
! _equalCreateOpClassItem(const CreateOpClassItem *a, const CreateOpClassItem *b)
  {
  	COMPARE_SCALAR_FIELD(itemtype);
  	COMPARE_NODE_FIELD(name);
*************** _equalCreateOpClassItem(CreateOpClassIte
*** 1516,1522 ****
  }
  
  static bool
! _equalCreateOpFamilyStmt(CreateOpFamilyStmt *a, CreateOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
--- 1516,1522 ----
  }
  
  static bool
! _equalCreateOpFamilyStmt(const CreateOpFamilyStmt *a, const CreateOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
*************** _equalCreateOpFamilyStmt(CreateOpFamilyS
*** 1525,1531 ****
  }
  
  static bool
! _equalAlterOpFamilyStmt(AlterOpFamilyStmt *a, AlterOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
--- 1525,1531 ----
  }
  
  static bool
! _equalAlterOpFamilyStmt(const AlterOpFamilyStmt *a, const AlterOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
*************** _equalAlterOpFamilyStmt(AlterOpFamilyStm
*** 1536,1542 ****
  }
  
  static bool
! _equalCreatedbStmt(CreatedbStmt *a, CreatedbStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(options);
--- 1536,1542 ----
  }
  
  static bool
! _equalCreatedbStmt(const CreatedbStmt *a, const CreatedbStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(options);
*************** _equalCreatedbStmt(CreatedbStmt *a, Crea
*** 1545,1551 ****
  }
  
  static bool
! _equalAlterDatabaseStmt(AlterDatabaseStmt *a, AlterDatabaseStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(options);
--- 1545,1551 ----
  }
  
  static bool
! _equalAlterDatabaseStmt(const AlterDatabaseStmt *a, const AlterDatabaseStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(options);
*************** _equalAlterDatabaseStmt(AlterDatabaseStm
*** 1554,1560 ****
  }
  
  static bool
! _equalAlterDatabaseSetStmt(AlterDatabaseSetStmt *a, AlterDatabaseSetStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(setstmt);
--- 1554,1560 ----
  }
  
  static bool
! _equalAlterDatabaseSetStmt(const AlterDatabaseSetStmt *a, const AlterDatabaseSetStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(setstmt);
*************** _equalAlterDatabaseSetStmt(AlterDatabase
*** 1563,1569 ****
  }
  
  static bool
! _equalDropdbStmt(DropdbStmt *a, DropdbStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_SCALAR_FIELD(missing_ok);
--- 1563,1569 ----
  }
  
  static bool
! _equalDropdbStmt(const DropdbStmt *a, const DropdbStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_SCALAR_FIELD(missing_ok);
*************** _equalDropdbStmt(DropdbStmt *a, DropdbSt
*** 1572,1578 ****
  }
  
  static bool
! _equalVacuumStmt(VacuumStmt *a, VacuumStmt *b)
  {
  	COMPARE_SCALAR_FIELD(options);
  	COMPARE_SCALAR_FIELD(freeze_min_age);
--- 1572,1578 ----
  }
  
  static bool
! _equalVacuumStmt(const VacuumStmt *a, const VacuumStmt *b)
  {
  	COMPARE_SCALAR_FIELD(options);
  	COMPARE_SCALAR_FIELD(freeze_min_age);
*************** _equalVacuumStmt(VacuumStmt *a, VacuumSt
*** 1584,1590 ****
  }
  
  static bool
! _equalExplainStmt(ExplainStmt *a, ExplainStmt *b)
  {
  	COMPARE_NODE_FIELD(query);
  	COMPARE_NODE_FIELD(options);
--- 1584,1590 ----
  }
  
  static bool
! _equalExplainStmt(const ExplainStmt *a, const ExplainStmt *b)
  {
  	COMPARE_NODE_FIELD(query);
  	COMPARE_NODE_FIELD(options);
*************** _equalExplainStmt(ExplainStmt *a, Explai
*** 1593,1599 ****
  }
  
  static bool
! _equalCreateSeqStmt(CreateSeqStmt *a, CreateSeqStmt *b)
  {
  	COMPARE_NODE_FIELD(sequence);
  	COMPARE_NODE_FIELD(options);
--- 1593,1599 ----
  }
  
  static bool
! _equalCreateSeqStmt(const CreateSeqStmt *a, const CreateSeqStmt *b)
  {
  	COMPARE_NODE_FIELD(sequence);
  	COMPARE_NODE_FIELD(options);
*************** _equalCreateSeqStmt(CreateSeqStmt *a, Cr
*** 1603,1609 ****
  }
  
  static bool
! _equalAlterSeqStmt(AlterSeqStmt *a, AlterSeqStmt *b)
  {
  	COMPARE_NODE_FIELD(sequence);
  	COMPARE_NODE_FIELD(options);
--- 1603,1609 ----
  }
  
  static bool
! _equalAlterSeqStmt(const AlterSeqStmt *a, const AlterSeqStmt *b)
  {
  	COMPARE_NODE_FIELD(sequence);
  	COMPARE_NODE_FIELD(options);
*************** _equalAlterSeqStmt(AlterSeqStmt *a, Alte
*** 1612,1618 ****
  }
  
  static bool
! _equalVariableSetStmt(VariableSetStmt *a, VariableSetStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_STRING_FIELD(name);
--- 1612,1618 ----
  }
  
  static bool
! _equalVariableSetStmt(const VariableSetStmt *a, const VariableSetStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_STRING_FIELD(name);
*************** _equalVariableSetStmt(VariableSetStmt *a
*** 1623,1629 ****
  }
  
  static bool
! _equalVariableShowStmt(VariableShowStmt *a, VariableShowStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  
--- 1623,1629 ----
  }
  
  static bool
! _equalVariableShowStmt(const VariableShowStmt *a, const VariableShowStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  
*************** _equalVariableShowStmt(VariableShowStmt
*** 1631,1637 ****
  }
  
  static bool
! _equalDiscardStmt(DiscardStmt *a, DiscardStmt *b)
  {
  	COMPARE_SCALAR_FIELD(target);
  
--- 1631,1637 ----
  }
  
  static bool
! _equalDiscardStmt(const DiscardStmt *a, const DiscardStmt *b)
  {
  	COMPARE_SCALAR_FIELD(target);
  
*************** _equalDiscardStmt(DiscardStmt *a, Discar
*** 1639,1645 ****
  }
  
  static bool
! _equalCreateTableSpaceStmt(CreateTableSpaceStmt *a, CreateTableSpaceStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_STRING_FIELD(owner);
--- 1639,1645 ----
  }
  
  static bool
! _equalCreateTableSpaceStmt(const CreateTableSpaceStmt *a, const CreateTableSpaceStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_STRING_FIELD(owner);
*************** _equalCreateTableSpaceStmt(CreateTableSp
*** 1649,1655 ****
  }
  
  static bool
! _equalDropTableSpaceStmt(DropTableSpaceStmt *a, DropTableSpaceStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_SCALAR_FIELD(missing_ok);
--- 1649,1655 ----
  }
  
  static bool
! _equalDropTableSpaceStmt(const DropTableSpaceStmt *a, const DropTableSpaceStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_SCALAR_FIELD(missing_ok);
*************** _equalDropTableSpaceStmt(DropTableSpaceS
*** 1658,1665 ****
  }
  
  static bool
! _equalAlterTableSpaceOptionsStmt(AlterTableSpaceOptionsStmt *a,
! 								 AlterTableSpaceOptionsStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_NODE_FIELD(options);
--- 1658,1665 ----
  }
  
  static bool
! _equalAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *a,
! 								 const AlterTableSpaceOptionsStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_NODE_FIELD(options);
*************** _equalAlterTableSpaceOptionsStmt(AlterTa
*** 1669,1675 ****
  }
  
  static bool
! _equalCreateExtensionStmt(CreateExtensionStmt *a, CreateExtensionStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_SCALAR_FIELD(if_not_exists);
--- 1669,1675 ----
  }
  
  static bool
! _equalCreateExtensionStmt(const CreateExtensionStmt *a, const CreateExtensionStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_SCALAR_FIELD(if_not_exists);
*************** _equalCreateExtensionStmt(CreateExtensio
*** 1679,1685 ****
  }
  
  static bool
! _equalAlterExtensionStmt(AlterExtensionStmt *a, AlterExtensionStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_NODE_FIELD(options);
--- 1679,1685 ----
  }
  
  static bool
! _equalAlterExtensionStmt(const AlterExtensionStmt *a, const AlterExtensionStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_NODE_FIELD(options);
*************** _equalAlterExtensionStmt(AlterExtensionS
*** 1688,1694 ****
  }
  
  static bool
! _equalAlterExtensionContentsStmt(AlterExtensionContentsStmt *a, AlterExtensionContentsStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_SCALAR_FIELD(action);
--- 1688,1694 ----
  }
  
  static bool
! _equalAlterExtensionContentsStmt(const AlterExtensionContentsStmt *a, const AlterExtensionContentsStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_SCALAR_FIELD(action);
*************** _equalAlterExtensionContentsStmt(AlterEx
*** 1700,1706 ****
  }
  
  static bool
! _equalCreateFdwStmt(CreateFdwStmt *a, CreateFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_NODE_FIELD(func_options);
--- 1700,1706 ----
  }
  
  static bool
! _equalCreateFdwStmt(const CreateFdwStmt *a, const CreateFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_NODE_FIELD(func_options);
*************** _equalCreateFdwStmt(CreateFdwStmt *a, Cr
*** 1710,1716 ****
  }
  
  static bool
! _equalAlterFdwStmt(AlterFdwStmt *a, AlterFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_NODE_FIELD(func_options);
--- 1710,1716 ----
  }
  
  static bool
! _equalAlterFdwStmt(const AlterFdwStmt *a, const AlterFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_NODE_FIELD(func_options);
*************** _equalAlterFdwStmt(AlterFdwStmt *a, Alte
*** 1720,1726 ****
  }
  
  static bool
! _equalDropFdwStmt(DropFdwStmt *a, DropFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_SCALAR_FIELD(missing_ok);
--- 1720,1726 ----
  }
  
  static bool
! _equalDropFdwStmt(const DropFdwStmt *a, const DropFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_SCALAR_FIELD(missing_ok);
*************** _equalDropFdwStmt(DropFdwStmt *a, DropFd
*** 1730,1736 ****
  }
  
  static bool
! _equalCreateForeignServerStmt(CreateForeignServerStmt *a, CreateForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_STRING_FIELD(servertype);
--- 1730,1736 ----
  }
  
  static bool
! _equalCreateForeignServerStmt(const CreateForeignServerStmt *a, const CreateForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_STRING_FIELD(servertype);
*************** _equalCreateForeignServerStmt(CreateFore
*** 1742,1748 ****
  }
  
  static bool
! _equalAlterForeignServerStmt(AlterForeignServerStmt *a, AlterForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_STRING_FIELD(version);
--- 1742,1748 ----
  }
  
  static bool
! _equalAlterForeignServerStmt(const AlterForeignServerStmt *a, const AlterForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_STRING_FIELD(version);
*************** _equalAlterForeignServerStmt(AlterForeig
*** 1753,1759 ****
  }
  
  static bool
! _equalDropForeignServerStmt(DropForeignServerStmt *a, DropForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_SCALAR_FIELD(missing_ok);
--- 1753,1759 ----
  }
  
  static bool
! _equalDropForeignServerStmt(const DropForeignServerStmt *a, const DropForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_SCALAR_FIELD(missing_ok);
*************** _equalDropForeignServerStmt(DropForeignS
*** 1763,1769 ****
  }
  
  static bool
! _equalCreateUserMappingStmt(CreateUserMappingStmt *a, CreateUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
--- 1763,1769 ----
  }
  
  static bool
! _equalCreateUserMappingStmt(const CreateUserMappingStmt *a, const CreateUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
*************** _equalCreateUserMappingStmt(CreateUserMa
*** 1773,1779 ****
  }
  
  static bool
! _equalAlterUserMappingStmt(AlterUserMappingStmt *a, AlterUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
--- 1773,1779 ----
  }
  
  static bool
! _equalAlterUserMappingStmt(const AlterUserMappingStmt *a, const AlterUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
*************** _equalAlterUserMappingStmt(AlterUserMapp
*** 1783,1789 ****
  }
  
  static bool
! _equalDropUserMappingStmt(DropUserMappingStmt *a, DropUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
--- 1783,1789 ----
  }
  
  static bool
! _equalDropUserMappingStmt(const DropUserMappingStmt *a, const DropUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
*************** _equalDropUserMappingStmt(DropUserMappin
*** 1793,1799 ****
  }
  
  static bool
! _equalCreateForeignTableStmt(CreateForeignTableStmt *a, CreateForeignTableStmt *b)
  {
  	if (!_equalCreateStmt(&a->base, &b->base))
  		return false;
--- 1793,1799 ----
  }
  
  static bool
! _equalCreateForeignTableStmt(const CreateForeignTableStmt *a, const CreateForeignTableStmt *b)
  {
  	if (!_equalCreateStmt(&a->base, &b->base))
  		return false;
*************** _equalCreateForeignTableStmt(CreateForei
*** 1805,1811 ****
  }
  
  static bool
! _equalCreateTrigStmt(CreateTrigStmt *a, CreateTrigStmt *b)
  {
  	COMPARE_STRING_FIELD(trigname);
  	COMPARE_NODE_FIELD(relation);
--- 1805,1811 ----
  }
  
  static bool
! _equalCreateTrigStmt(const CreateTrigStmt *a, const CreateTrigStmt *b)
  {
  	COMPARE_STRING_FIELD(trigname);
  	COMPARE_NODE_FIELD(relation);
*************** _equalCreateTrigStmt(CreateTrigStmt *a,
*** 1825,1831 ****
  }
  
  static bool
! _equalDropPropertyStmt(DropPropertyStmt *a, DropPropertyStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(property);
--- 1825,1831 ----
  }
  
  static bool
! _equalDropPropertyStmt(const DropPropertyStmt *a, const DropPropertyStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(property);
*************** _equalDropPropertyStmt(DropPropertyStmt
*** 1837,1843 ****
  }
  
  static bool
! _equalCreatePLangStmt(CreatePLangStmt *a, CreatePLangStmt *b)
  {
  	COMPARE_SCALAR_FIELD(replace);
  	COMPARE_STRING_FIELD(plname);
--- 1837,1843 ----
  }
  
  static bool
! _equalCreatePLangStmt(const CreatePLangStmt *a, const CreatePLangStmt *b)
  {
  	COMPARE_SCALAR_FIELD(replace);
  	COMPARE_STRING_FIELD(plname);
*************** _equalCreatePLangStmt(CreatePLangStmt *a
*** 1850,1856 ****
  }
  
  static bool
! _equalDropPLangStmt(DropPLangStmt *a, DropPLangStmt *b)
  {
  	COMPARE_STRING_FIELD(plname);
  	COMPARE_SCALAR_FIELD(behavior);
--- 1850,1856 ----
  }
  
  static bool
! _equalDropPLangStmt(const DropPLangStmt *a, const DropPLangStmt *b)
  {
  	COMPARE_STRING_FIELD(plname);
  	COMPARE_SCALAR_FIELD(behavior);
*************** _equalDropPLangStmt(DropPLangStmt *a, Dr
*** 1860,1866 ****
  }
  
  static bool
! _equalCreateRoleStmt(CreateRoleStmt *a, CreateRoleStmt *b)
  {
  	COMPARE_SCALAR_FIELD(stmt_type);
  	COMPARE_STRING_FIELD(role);
--- 1860,1866 ----
  }
  
  static bool
! _equalCreateRoleStmt(const CreateRoleStmt *a, const CreateRoleStmt *b)
  {
  	COMPARE_SCALAR_FIELD(stmt_type);
  	COMPARE_STRING_FIELD(role);
*************** _equalCreateRoleStmt(CreateRoleStmt *a,
*** 1870,1876 ****
  }
  
  static bool
! _equalAlterRoleStmt(AlterRoleStmt *a, AlterRoleStmt *b)
  {
  	COMPARE_STRING_FIELD(role);
  	COMPARE_NODE_FIELD(options);
--- 1870,1876 ----
  }
  
  static bool
! _equalAlterRoleStmt(const AlterRoleStmt *a, const AlterRoleStmt *b)
  {
  	COMPARE_STRING_FIELD(role);
  	COMPARE_NODE_FIELD(options);
*************** _equalAlterRoleStmt(AlterRoleStmt *a, Al
*** 1880,1886 ****
  }
  
  static bool
! _equalAlterRoleSetStmt(AlterRoleSetStmt *a, AlterRoleSetStmt *b)
  {
  	COMPARE_STRING_FIELD(role);
  	COMPARE_STRING_FIELD(database);
--- 1880,1886 ----
  }
  
  static bool
! _equalAlterRoleSetStmt(const AlterRoleSetStmt *a, const AlterRoleSetStmt *b)
  {
  	COMPARE_STRING_FIELD(role);
  	COMPARE_STRING_FIELD(database);
*************** _equalAlterRoleSetStmt(AlterRoleSetStmt
*** 1890,1896 ****
  }
  
  static bool
! _equalDropRoleStmt(DropRoleStmt *a, DropRoleStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_SCALAR_FIELD(missing_ok);
--- 1890,1896 ----
  }
  
  static bool
! _equalDropRoleStmt(const DropRoleStmt *a, const DropRoleStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_SCALAR_FIELD(missing_ok);
*************** _equalDropRoleStmt(DropRoleStmt *a, Drop
*** 1899,1905 ****
  }
  
  static bool
! _equalLockStmt(LockStmt *a, LockStmt *b)
  {
  	COMPARE_NODE_FIELD(relations);
  	COMPARE_SCALAR_FIELD(mode);
--- 1899,1905 ----
  }
  
  static bool
! _equalLockStmt(const LockStmt *a, const LockStmt *b)
  {
  	COMPARE_NODE_FIELD(relations);
  	COMPARE_SCALAR_FIELD(mode);
*************** _equalLockStmt(LockStmt *a, LockStmt *b)
*** 1909,1915 ****
  }
  
  static bool
! _equalConstraintsSetStmt(ConstraintsSetStmt *a, ConstraintsSetStmt *b)
  {
  	COMPARE_NODE_FIELD(constraints);
  	COMPARE_SCALAR_FIELD(deferred);
--- 1909,1915 ----
  }
  
  static bool
! _equalConstraintsSetStmt(const ConstraintsSetStmt *a, const ConstraintsSetStmt *b)
  {
  	COMPARE_NODE_FIELD(constraints);
  	COMPARE_SCALAR_FIELD(deferred);
*************** _equalConstraintsSetStmt(ConstraintsSetS
*** 1918,1924 ****
  }
  
  static bool
! _equalReindexStmt(ReindexStmt *a, ReindexStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(relation);
--- 1918,1924 ----
  }
  
  static bool
! _equalReindexStmt(const ReindexStmt *a, const ReindexStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(relation);
*************** _equalReindexStmt(ReindexStmt *a, Reinde
*** 1930,1936 ****
  }
  
  static bool
! _equalCreateSchemaStmt(CreateSchemaStmt *a, CreateSchemaStmt *b)
  {
  	COMPARE_STRING_FIELD(schemaname);
  	COMPARE_STRING_FIELD(authid);
--- 1930,1936 ----
  }
  
  static bool
! _equalCreateSchemaStmt(const CreateSchemaStmt *a, const CreateSchemaStmt *b)
  {
  	COMPARE_STRING_FIELD(schemaname);
  	COMPARE_STRING_FIELD(authid);
*************** _equalCreateSchemaStmt(CreateSchemaStmt
*** 1940,1946 ****
  }
  
  static bool
! _equalCreateConversionStmt(CreateConversionStmt *a, CreateConversionStmt *b)
  {
  	COMPARE_NODE_FIELD(conversion_name);
  	COMPARE_STRING_FIELD(for_encoding_name);
--- 1940,1946 ----
  }
  
  static bool
! _equalCreateConversionStmt(const CreateConversionStmt *a, const CreateConversionStmt *b)
  {
  	COMPARE_NODE_FIELD(conversion_name);
  	COMPARE_STRING_FIELD(for_encoding_name);
*************** _equalCreateConversionStmt(CreateConvers
*** 1952,1958 ****
  }
  
  static bool
! _equalCreateCastStmt(CreateCastStmt *a, CreateCastStmt *b)
  {
  	COMPARE_NODE_FIELD(sourcetype);
  	COMPARE_NODE_FIELD(targettype);
--- 1952,1958 ----
  }
  
  static bool
! _equalCreateCastStmt(const CreateCastStmt *a, const CreateCastStmt *b)
  {
  	COMPARE_NODE_FIELD(sourcetype);
  	COMPARE_NODE_FIELD(targettype);
*************** _equalCreateCastStmt(CreateCastStmt *a,
*** 1964,1970 ****
  }
  
  static bool
! _equalDropCastStmt(DropCastStmt *a, DropCastStmt *b)
  {
  	COMPARE_NODE_FIELD(sourcetype);
  	COMPARE_NODE_FIELD(targettype);
--- 1964,1970 ----
  }
  
  static bool
! _equalDropCastStmt(const DropCastStmt *a, const DropCastStmt *b)
  {
  	COMPARE_NODE_FIELD(sourcetype);
  	COMPARE_NODE_FIELD(targettype);
*************** _equalDropCastStmt(DropCastStmt *a, Drop
*** 1975,1981 ****
  }
  
  static bool
! _equalPrepareStmt(PrepareStmt *a, PrepareStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(argtypes);
--- 1975,1981 ----
  }
  
  static bool
! _equalPrepareStmt(const PrepareStmt *a, const PrepareStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(argtypes);
*************** _equalPrepareStmt(PrepareStmt *a, Prepar
*** 1985,1991 ****
  }
  
  static bool
! _equalExecuteStmt(ExecuteStmt *a, ExecuteStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(into);
--- 1985,1991 ----
  }
  
  static bool
! _equalExecuteStmt(const ExecuteStmt *a, const ExecuteStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(into);
*************** _equalExecuteStmt(ExecuteStmt *a, Execut
*** 1995,2001 ****
  }
  
  static bool
! _equalDeallocateStmt(DeallocateStmt *a, DeallocateStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  
--- 1995,2001 ----
  }
  
  static bool
! _equalDeallocateStmt(const DeallocateStmt *a, const DeallocateStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  
*************** _equalDeallocateStmt(DeallocateStmt *a,
*** 2003,2009 ****
  }
  
  static bool
! _equalDropOwnedStmt(DropOwnedStmt *a, DropOwnedStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_SCALAR_FIELD(behavior);
--- 2003,2009 ----
  }
  
  static bool
! _equalDropOwnedStmt(const DropOwnedStmt *a, const DropOwnedStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_SCALAR_FIELD(behavior);
*************** _equalDropOwnedStmt(DropOwnedStmt *a, Dr
*** 2012,2018 ****
  }
  
  static bool
! _equalReassignOwnedStmt(ReassignOwnedStmt *a, ReassignOwnedStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_NODE_FIELD(newrole);
--- 2012,2018 ----
  }
  
  static bool
! _equalReassignOwnedStmt(const ReassignOwnedStmt *a, const ReassignOwnedStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_NODE_FIELD(newrole);
*************** _equalReassignOwnedStmt(ReassignOwnedStm
*** 2021,2027 ****
  }
  
  static bool
! _equalAlterTSDictionaryStmt(AlterTSDictionaryStmt *a, AlterTSDictionaryStmt *b)
  {
  	COMPARE_NODE_FIELD(dictname);
  	COMPARE_NODE_FIELD(options);
--- 2021,2027 ----
  }
  
  static bool
! _equalAlterTSDictionaryStmt(const AlterTSDictionaryStmt *a, const AlterTSDictionaryStmt *b)
  {
  	COMPARE_NODE_FIELD(dictname);
  	COMPARE_NODE_FIELD(options);
*************** _equalAlterTSDictionaryStmt(AlterTSDicti
*** 2030,2037 ****
  }
  
  static bool
! _equalAlterTSConfigurationStmt(AlterTSConfigurationStmt *a,
! 							   AlterTSConfigurationStmt *b)
  {
  	COMPARE_NODE_FIELD(cfgname);
  	COMPARE_NODE_FIELD(tokentype);
--- 2030,2037 ----
  }
  
  static bool
! _equalAlterTSConfigurationStmt(const AlterTSConfigurationStmt *a,
! 							   const AlterTSConfigurationStmt *b)
  {
  	COMPARE_NODE_FIELD(cfgname);
  	COMPARE_NODE_FIELD(tokentype);
*************** _equalAlterTSConfigurationStmt(AlterTSCo
*** 2044,2050 ****
  }
  
  static bool
! _equalAExpr(A_Expr *a, A_Expr *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(name);
--- 2044,2050 ----
  }
  
  static bool
! _equalAExpr(const A_Expr *a, const A_Expr *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(name);
*************** _equalAExpr(A_Expr *a, A_Expr *b)
*** 2056,2062 ****
  }
  
  static bool
! _equalColumnRef(ColumnRef *a, ColumnRef *b)
  {
  	COMPARE_NODE_FIELD(fields);
  	COMPARE_LOCATION_FIELD(location);
--- 2056,2062 ----
  }
  
  static bool
! _equalColumnRef(const ColumnRef *a, const ColumnRef *b)
  {
  	COMPARE_NODE_FIELD(fields);
  	COMPARE_LOCATION_FIELD(location);
*************** _equalColumnRef(ColumnRef *a, ColumnRef
*** 2065,2071 ****
  }
  
  static bool
! _equalParamRef(ParamRef *a, ParamRef *b)
  {
  	COMPARE_SCALAR_FIELD(number);
  	COMPARE_LOCATION_FIELD(location);
--- 2065,2071 ----
  }
  
  static bool
! _equalParamRef(const ParamRef *a, const ParamRef *b)
  {
  	COMPARE_SCALAR_FIELD(number);
  	COMPARE_LOCATION_FIELD(location);
*************** _equalParamRef(ParamRef *a, ParamRef *b)
*** 2074,2080 ****
  }
  
  static bool
! _equalAConst(A_Const *a, A_Const *b)
  {
  	if (!equal(&a->val, &b->val))		/* hack for in-line Value field */
  		return false;
--- 2074,2080 ----
  }
  
  static bool
! _equalAConst(const A_Const *a, const A_Const *b)
  {
  	if (!equal(&a->val, &b->val))		/* hack for in-line Value field */
  		return false;
*************** _equalAConst(A_Const *a, A_Const *b)
*** 2084,2090 ****
  }
  
  static bool
! _equalFuncCall(FuncCall *a, FuncCall *b)
  {
  	COMPARE_NODE_FIELD(funcname);
  	COMPARE_NODE_FIELD(args);
--- 2084,2090 ----
  }
  
  static bool
! _equalFuncCall(const FuncCall *a, const FuncCall *b)
  {
  	COMPARE_NODE_FIELD(funcname);
  	COMPARE_NODE_FIELD(args);
*************** _equalFuncCall(FuncCall *a, FuncCall *b)
*** 2099,2111 ****
  }
  
  static bool
! _equalAStar(A_Star *a, A_Star *b)
  {
  	return true;
  }
  
  static bool
! _equalAIndices(A_Indices *a, A_Indices *b)
  {
  	COMPARE_NODE_FIELD(lidx);
  	COMPARE_NODE_FIELD(uidx);
--- 2099,2111 ----
  }
  
  static bool
! _equalAStar(const A_Star *a, const A_Star *b)
  {
  	return true;
  }
  
  static bool
! _equalAIndices(const A_Indices *a, const A_Indices *b)
  {
  	COMPARE_NODE_FIELD(lidx);
  	COMPARE_NODE_FIELD(uidx);
*************** _equalAIndices(A_Indices *a, A_Indices *
*** 2114,2120 ****
  }
  
  static bool
! _equalA_Indirection(A_Indirection *a, A_Indirection *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(indirection);
--- 2114,2120 ----
  }
  
  static bool
! _equalA_Indirection(const A_Indirection *a, const A_Indirection *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(indirection);
*************** _equalA_Indirection(A_Indirection *a, A_
*** 2123,2129 ****
  }
  
  static bool
! _equalA_ArrayExpr(A_ArrayExpr *a, A_ArrayExpr *b)
  {
  	COMPARE_NODE_FIELD(elements);
  	COMPARE_LOCATION_FIELD(location);
--- 2123,2129 ----
  }
  
  static bool
! _equalA_ArrayExpr(const A_ArrayExpr *a, const A_ArrayExpr *b)
  {
  	COMPARE_NODE_FIELD(elements);
  	COMPARE_LOCATION_FIELD(location);
*************** _equalA_ArrayExpr(A_ArrayExpr *a, A_Arra
*** 2132,2138 ****
  }
  
  static bool
! _equalResTarget(ResTarget *a, ResTarget *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(indirection);
--- 2132,2138 ----
  }
  
  static bool
! _equalResTarget(const ResTarget *a, const ResTarget *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(indirection);
*************** _equalResTarget(ResTarget *a, ResTarget
*** 2143,2149 ****
  }
  
  static bool
! _equalTypeName(TypeName *a, TypeName *b)
  {
  	COMPARE_NODE_FIELD(names);
  	COMPARE_SCALAR_FIELD(typeOid);
--- 2143,2149 ----
  }
  
  static bool
! _equalTypeName(const TypeName *a, const TypeName *b)
  {
  	COMPARE_NODE_FIELD(names);
  	COMPARE_SCALAR_FIELD(typeOid);
*************** _equalTypeName(TypeName *a, TypeName *b)
*** 2158,2164 ****
  }
  
  static bool
! _equalTypeCast(TypeCast *a, TypeCast *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(typeName);
--- 2158,2164 ----
  }
  
  static bool
! _equalTypeCast(const TypeCast *a, const TypeCast *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(typeName);
*************** _equalTypeCast(TypeCast *a, TypeCast *b)
*** 2168,2174 ****
  }
  
  static bool
! _equalCollateClause(CollateClause *a, CollateClause *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(collname);
--- 2168,2174 ----
  }
  
  static bool
! _equalCollateClause(const CollateClause *a, const CollateClause *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(collname);
*************** _equalCollateClause(CollateClause *a, Co
*** 2178,2184 ****
  }
  
  static bool
! _equalSortBy(SortBy *a, SortBy *b)
  {
  	COMPARE_NODE_FIELD(node);
  	COMPARE_SCALAR_FIELD(sortby_dir);
--- 2178,2184 ----
  }
  
  static bool
! _equalSortBy(const SortBy *a, const SortBy *b)
  {
  	COMPARE_NODE_FIELD(node);
  	COMPARE_SCALAR_FIELD(sortby_dir);
*************** _equalSortBy(SortBy *a, SortBy *b)
*** 2190,2196 ****
  }
  
  static bool
! _equalWindowDef(WindowDef *a, WindowDef *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_STRING_FIELD(refname);
--- 2190,2196 ----
  }
  
  static bool
! _equalWindowDef(const WindowDef *a, const WindowDef *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_STRING_FIELD(refname);
*************** _equalWindowDef(WindowDef *a, WindowDef
*** 2205,2211 ****
  }
  
  static bool
! _equalRangeSubselect(RangeSubselect *a, RangeSubselect *b)
  {
  	COMPARE_NODE_FIELD(subquery);
  	COMPARE_NODE_FIELD(alias);
--- 2205,2211 ----
  }
  
  static bool
! _equalRangeSubselect(const RangeSubselect *a, const RangeSubselect *b)
  {
  	COMPARE_NODE_FIELD(subquery);
  	COMPARE_NODE_FIELD(alias);
*************** _equalRangeSubselect(RangeSubselect *a,
*** 2214,2220 ****
  }
  
  static bool
! _equalRangeFunction(RangeFunction *a, RangeFunction *b)
  {
  	COMPARE_NODE_FIELD(funccallnode);
  	COMPARE_NODE_FIELD(alias);
--- 2214,2220 ----
  }
  
  static bool
! _equalRangeFunction(const RangeFunction *a, const RangeFunction *b)
  {
  	COMPARE_NODE_FIELD(funccallnode);
  	COMPARE_NODE_FIELD(alias);
*************** _equalRangeFunction(RangeFunction *a, Ra
*** 2224,2230 ****
  }
  
  static bool
! _equalIndexElem(IndexElem *a, IndexElem *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(expr);
--- 2224,2230 ----
  }
  
  static bool
! _equalIndexElem(const IndexElem *a, const IndexElem *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(expr);
*************** _equalIndexElem(IndexElem *a, IndexElem
*** 2238,2244 ****
  }
  
  static bool
! _equalColumnDef(ColumnDef *a, ColumnDef *b)
  {
  	COMPARE_STRING_FIELD(colname);
  	COMPARE_NODE_FIELD(typeName);
--- 2238,2244 ----
  }
  
  static bool
! _equalColumnDef(const ColumnDef *a, const ColumnDef *b)
  {
  	COMPARE_STRING_FIELD(colname);
  	COMPARE_NODE_FIELD(typeName);
*************** _equalColumnDef(ColumnDef *a, ColumnDef
*** 2257,2263 ****
  }
  
  static bool
! _equalConstraint(Constraint *a, Constraint *b)
  {
  	COMPARE_SCALAR_FIELD(contype);
  	COMPARE_STRING_FIELD(conname);
--- 2257,2263 ----
  }
  
  static bool
! _equalConstraint(const Constraint *a, const Constraint *b)
  {
  	COMPARE_SCALAR_FIELD(contype);
  	COMPARE_STRING_FIELD(conname);
*************** _equalConstraint(Constraint *a, Constrai
*** 2286,2292 ****
  }
  
  static bool
! _equalDefElem(DefElem *a, DefElem *b)
  {
  	COMPARE_STRING_FIELD(defnamespace);
  	COMPARE_STRING_FIELD(defname);
--- 2286,2292 ----
  }
  
  static bool
! _equalDefElem(const DefElem *a, const DefElem *b)
  {
  	COMPARE_STRING_FIELD(defnamespace);
  	COMPARE_STRING_FIELD(defname);
*************** _equalDefElem(DefElem *a, DefElem *b)
*** 2297,2303 ****
  }
  
  static bool
! _equalLockingClause(LockingClause *a, LockingClause *b)
  {
  	COMPARE_NODE_FIELD(lockedRels);
  	COMPARE_SCALAR_FIELD(forUpdate);
--- 2297,2303 ----
  }
  
  static bool
! _equalLockingClause(const LockingClause *a, const LockingClause *b)
  {
  	COMPARE_NODE_FIELD(lockedRels);
  	COMPARE_SCALAR_FIELD(forUpdate);
*************** _equalLockingClause(LockingClause *a, Lo
*** 2307,2313 ****
  }
  
  static bool
! _equalRangeTblEntry(RangeTblEntry *a, RangeTblEntry *b)
  {
  	COMPARE_SCALAR_FIELD(rtekind);
  	COMPARE_SCALAR_FIELD(relid);
--- 2307,2313 ----
  }
  
  static bool
! _equalRangeTblEntry(const RangeTblEntry *a, const RangeTblEntry *b)
  {
  	COMPARE_SCALAR_FIELD(rtekind);
  	COMPARE_SCALAR_FIELD(relid);
*************** _equalRangeTblEntry(RangeTblEntry *a, Ra
*** 2340,2346 ****
  }
  
  static bool
! _equalSortGroupClause(SortGroupClause *a, SortGroupClause *b)
  {
  	COMPARE_SCALAR_FIELD(tleSortGroupRef);
  	COMPARE_SCALAR_FIELD(eqop);
--- 2340,2346 ----
  }
  
  static bool
! _equalSortGroupClause(const SortGroupClause *a, const SortGroupClause *b)
  {
  	COMPARE_SCALAR_FIELD(tleSortGroupRef);
  	COMPARE_SCALAR_FIELD(eqop);
*************** _equalSortGroupClause(SortGroupClause *a
*** 2352,2358 ****
  }
  
  static bool
! _equalWindowClause(WindowClause *a, WindowClause *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_STRING_FIELD(refname);
--- 2352,2358 ----
  }
  
  static bool
! _equalWindowClause(const WindowClause *a, const WindowClause *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_STRING_FIELD(refname);
*************** _equalWindowClause(WindowClause *a, Wind
*** 2368,2374 ****
  }
  
  static bool
! _equalRowMarkClause(RowMarkClause *a, RowMarkClause *b)
  {
  	COMPARE_SCALAR_FIELD(rti);
  	COMPARE_SCALAR_FIELD(forUpdate);
--- 2368,2374 ----
  }
  
  static bool
! _equalRowMarkClause(const RowMarkClause *a, const RowMarkClause *b)
  {
  	COMPARE_SCALAR_FIELD(rti);
  	COMPARE_SCALAR_FIELD(forUpdate);
*************** _equalRowMarkClause(RowMarkClause *a, Ro
*** 2379,2385 ****
  }
  
  static bool
! _equalWithClause(WithClause *a, WithClause *b)
  {
  	COMPARE_NODE_FIELD(ctes);
  	COMPARE_SCALAR_FIELD(recursive);
--- 2379,2385 ----
  }
  
  static bool
! _equalWithClause(const WithClause *a, const WithClause *b)
  {
  	COMPARE_NODE_FIELD(ctes);
  	COMPARE_SCALAR_FIELD(recursive);
*************** _equalWithClause(WithClause *a, WithClau
*** 2389,2395 ****
  }
  
  static bool
! _equalCommonTableExpr(CommonTableExpr *a, CommonTableExpr *b)
  {
  	COMPARE_STRING_FIELD(ctename);
  	COMPARE_NODE_FIELD(aliascolnames);
--- 2389,2395 ----
  }
  
  static bool
! _equalCommonTableExpr(const CommonTableExpr *a, const CommonTableExpr *b)
  {
  	COMPARE_STRING_FIELD(ctename);
  	COMPARE_NODE_FIELD(aliascolnames);
*************** _equalCommonTableExpr(CommonTableExpr *a
*** 2406,2412 ****
  }
  
  static bool
! _equalXmlSerialize(XmlSerialize *a, XmlSerialize *b)
  {
  	COMPARE_SCALAR_FIELD(xmloption);
  	COMPARE_NODE_FIELD(expr);
--- 2406,2412 ----
  }
  
  static bool
! _equalXmlSerialize(const XmlSerialize *a, const XmlSerialize *b)
  {
  	COMPARE_SCALAR_FIELD(xmloption);
  	COMPARE_NODE_FIELD(expr);
*************** _equalXmlSerialize(XmlSerialize *a, XmlS
*** 2421,2430 ****
   */
  
  static bool
! _equalList(List *a, List *b)
  {
! 	ListCell   *item_a;
! 	ListCell   *item_b;
  
  	/*
  	 * Try to reject by simple scalar checks before grovelling through all the
--- 2421,2430 ----
   */
  
  static bool
! _equalList(const List *a, const List *b)
  {
! 	const ListCell   *item_a;
! 	const ListCell   *item_b;
  
  	/*
  	 * Try to reject by simple scalar checks before grovelling through all the
*************** _equalList(List *a, List *b)
*** 2440,2460 ****
  	switch (a->type)
  	{
  		case T_List:
! 			forboth(item_a, a, item_b, b)
  			{
  				if (!equal(lfirst(item_a), lfirst(item_b)))
  					return false;
  			}
  			break;
  		case T_IntList:
! 			forboth(item_a, a, item_b, b)
  			{
  				if (lfirst_int(item_a) != lfirst_int(item_b))
  					return false;
  			}
  			break;
  		case T_OidList:
! 			forboth(item_a, a, item_b, b)
  			{
  				if (lfirst_oid(item_a) != lfirst_oid(item_b))
  					return false;
--- 2440,2460 ----
  	switch (a->type)
  	{
  		case T_List:
! 			forboth_const(item_a, a, item_b, b)
  			{
  				if (!equal(lfirst(item_a), lfirst(item_b)))
  					return false;
  			}
  			break;
  		case T_IntList:
! 			forboth_const(item_a, a, item_b, b)
  			{
  				if (lfirst_int(item_a) != lfirst_int(item_b))
  					return false;
  			}
  			break;
  		case T_OidList:
! 			forboth_const(item_a, a, item_b, b)
  			{
  				if (lfirst_oid(item_a) != lfirst_oid(item_b))
  					return false;
*************** _equalList(List *a, List *b)
*** 2480,2486 ****
   */
  
  static bool
! _equalValue(Value *a, Value *b)
  {
  	COMPARE_SCALAR_FIELD(type);
  
--- 2480,2486 ----
   */
  
  static bool
! _equalValue(const Value *a, const Value *b)
  {
  	COMPARE_SCALAR_FIELD(type);
  
*************** _equalValue(Value *a, Value *b)
*** 2510,2516 ****
   *	  returns whether two nodes are equal
   */
  bool
! equal(void *a, void *b)
  {
  	bool		retval;
  
--- 2510,2516 ----
   *	  returns whether two nodes are equal
   */
  bool
! equal(const void *a, const void *b)
  {
  	bool		retval;
  
diff --git a/src/backend/nodes/list.c b/src/backend/nodes/list.c
new file mode 100644
index d4684d3..8dfbcb7
*** a/src/backend/nodes/list.c
--- b/src/backend/nodes/list.c
***************
*** 31,37 ****
   * Check that the specified List is valid (so far as we can tell).
   */
  static void
! check_list_invariants(List *list)
  {
  	if (list == NIL)
  		return;
--- 31,37 ----
   * Check that the specified List is valid (so far as we can tell).
   */
  static void
! check_list_invariants(const List *list)
  {
  	if (list == NIL)
  		return;
*************** list_truncate(List *list, int new_size)
*** 383,389 ****
   * failure if there is no such cell.
   */
  static ListCell *
! list_nth_cell(List *list, int n)
  {
  	ListCell   *match;
  
--- 383,389 ----
   * failure if there is no such cell.
   */
  static ListCell *
! list_nth_cell(const List *list, int n)
  {
  	ListCell   *match;
  
*************** list_nth_cell(List *list, int n)
*** 407,413 ****
   * specified list. (List elements begin at 0.)
   */
  void *
! list_nth(List *list, int n)
  {
  	Assert(IsPointerList(list));
  	return lfirst(list_nth_cell(list, n));
--- 407,413 ----
   * specified list. (List elements begin at 0.)
   */
  void *
! list_nth(const List *list, int n)
  {
  	Assert(IsPointerList(list));
  	return lfirst(list_nth_cell(list, n));
*************** list_nth(List *list, int n)
*** 418,424 ****
   * specified list.
   */
  int
! list_nth_int(List *list, int n)
  {
  	Assert(IsIntegerList(list));
  	return lfirst_int(list_nth_cell(list, n));
--- 418,424 ----
   * specified list.
   */
  int
! list_nth_int(const List *list, int n)
  {
  	Assert(IsIntegerList(list));
  	return lfirst_int(list_nth_cell(list, n));
*************** list_nth_int(List *list, int n)
*** 429,435 ****
   * list.
   */
  Oid
! list_nth_oid(List *list, int n)
  {
  	Assert(IsOidList(list));
  	return lfirst_oid(list_nth_cell(list, n));
--- 429,435 ----
   * list.
   */
  Oid
! list_nth_oid(const List *list, int n)
  {
  	Assert(IsOidList(list));
  	return lfirst_oid(list_nth_cell(list, n));
*************** list_nth_oid(List *list, int n)
*** 441,454 ****
   * Node as 'datum'.
   */
  bool
! list_member(List *list, void *datum)
  {
! 	ListCell   *cell;
  
  	Assert(IsPointerList(list));
  	check_list_invariants(list);
  
! 	foreach(cell, list)
  	{
  		if (equal(lfirst(cell), datum))
  			return true;
--- 441,454 ----
   * Node as 'datum'.
   */
  bool
! list_member(const List *list, const void *datum)
  {
! 	const ListCell   *cell;
  
  	Assert(IsPointerList(list));
  	check_list_invariants(list);
  
! 	foreach_const(cell, list)
  	{
  		if (equal(lfirst(cell), datum))
  			return true;
*************** list_member(List *list, void *datum)
*** 462,475 ****
   * determined by using simple pointer comparison.
   */
  bool
! list_member_ptr(List *list, void *datum)
  {
! 	ListCell   *cell;
  
  	Assert(IsPointerList(list));
  	check_list_invariants(list);
  
! 	foreach(cell, list)
  	{
  		if (lfirst(cell) == datum)
  			return true;
--- 462,475 ----
   * determined by using simple pointer comparison.
   */
  bool
! list_member_ptr(const List *list, const void *datum)
  {
! 	const ListCell   *cell;
  
  	Assert(IsPointerList(list));
  	check_list_invariants(list);
  
! 	foreach_const(cell, list)
  	{
  		if (lfirst(cell) == datum)
  			return true;
*************** list_member_ptr(List *list, void *datum)
*** 482,495 ****
   * Return true iff the integer 'datum' is a member of the list.
   */
  bool
! list_member_int(List *list, int datum)
  {
! 	ListCell   *cell;
  
  	Assert(IsIntegerList(list));
  	check_list_invariants(list);
  
! 	foreach(cell, list)
  	{
  		if (lfirst_int(cell) == datum)
  			return true;
--- 482,495 ----
   * Return true iff the integer 'datum' is a member of the list.
   */
  bool
! list_member_int(const List *list, int datum)
  {
! 	const ListCell   *cell;
  
  	Assert(IsIntegerList(list));
  	check_list_invariants(list);
  
! 	foreach_const(cell, list)
  	{
  		if (lfirst_int(cell) == datum)
  			return true;
*************** list_member_int(List *list, int datum)
*** 502,515 ****
   * Return true iff the OID 'datum' is a member of the list.
   */
  bool
! list_member_oid(List *list, Oid datum)
  {
! 	ListCell   *cell;
  
  	Assert(IsOidList(list));
  	check_list_invariants(list);
  
! 	foreach(cell, list)
  	{
  		if (lfirst_oid(cell) == datum)
  			return true;
--- 502,515 ----
   * Return true iff the OID 'datum' is a member of the list.
   */
  bool
! list_member_oid(const List *list, Oid datum)
  {
! 	const ListCell   *cell;
  
  	Assert(IsOidList(list));
  	check_list_invariants(list);
  
! 	foreach_const(cell, list)
  	{
  		if (lfirst_oid(cell) == datum)
  			return true;
*************** list_delete_first(List *list)
*** 694,709 ****
   * performance bottleneck.
   */
  List *
! list_union(List *list1, List *list2)
  {
  	List	   *result;
! 	ListCell   *cell;
  
  	Assert(IsPointerList(list1));
  	Assert(IsPointerList(list2));
  
  	result = list_copy(list1);
! 	foreach(cell, list2)
  	{
  		if (!list_member(result, lfirst(cell)))
  			result = lappend(result, lfirst(cell));
--- 694,709 ----
   * performance bottleneck.
   */
  List *
! list_union(const List *list1, const List *list2)
  {
  	List	   *result;
! 	const ListCell   *cell;
  
  	Assert(IsPointerList(list1));
  	Assert(IsPointerList(list2));
  
  	result = list_copy(list1);
! 	foreach_const(cell, list2)
  	{
  		if (!list_member(result, lfirst(cell)))
  			result = lappend(result, lfirst(cell));
*************** list_union(List *list1, List *list2)
*** 718,733 ****
   * pointer comparison.
   */
  List *
! list_union_ptr(List *list1, List *list2)
  {
  	List	   *result;
! 	ListCell   *cell;
  
  	Assert(IsPointerList(list1));
  	Assert(IsPointerList(list2));
  
  	result = list_copy(list1);
! 	foreach(cell, list2)
  	{
  		if (!list_member_ptr(result, lfirst(cell)))
  			result = lappend(result, lfirst(cell));
--- 718,733 ----
   * pointer comparison.
   */
  List *
! list_union_ptr(const List *list1, const List *list2)
  {
  	List	   *result;
! 	const ListCell   *cell;
  
  	Assert(IsPointerList(list1));
  	Assert(IsPointerList(list2));
  
  	result = list_copy(list1);
! 	foreach_const(cell, list2)
  	{
  		if (!list_member_ptr(result, lfirst(cell)))
  			result = lappend(result, lfirst(cell));
*************** list_union_ptr(List *list1, List *list2)
*** 741,756 ****
   * This variant of list_union() operates upon lists of integers.
   */
  List *
! list_union_int(List *list1, List *list2)
  {
  	List	   *result;
! 	ListCell   *cell;
  
  	Assert(IsIntegerList(list1));
  	Assert(IsIntegerList(list2));
  
  	result = list_copy(list1);
! 	foreach(cell, list2)
  	{
  		if (!list_member_int(result, lfirst_int(cell)))
  			result = lappend_int(result, lfirst_int(cell));
--- 741,756 ----
   * This variant of list_union() operates upon lists of integers.
   */
  List *
! list_union_int(const List *list1, const List *list2)
  {
  	List	   *result;
! 	const ListCell   *cell;
  
  	Assert(IsIntegerList(list1));
  	Assert(IsIntegerList(list2));
  
  	result = list_copy(list1);
! 	foreach_const(cell, list2)
  	{
  		if (!list_member_int(result, lfirst_int(cell)))
  			result = lappend_int(result, lfirst_int(cell));
*************** list_union_int(List *list1, List *list2)
*** 764,779 ****
   * This variant of list_union() operates upon lists of OIDs.
   */
  List *
! list_union_oid(List *list1, List *list2)
  {
  	List	   *result;
! 	ListCell   *cell;
  
  	Assert(IsOidList(list1));
  	Assert(IsOidList(list2));
  
  	result = list_copy(list1);
! 	foreach(cell, list2)
  	{
  		if (!list_member_oid(result, lfirst_oid(cell)))
  			result = lappend_oid(result, lfirst_oid(cell));
--- 764,779 ----
   * This variant of list_union() operates upon lists of OIDs.
   */
  List *
! list_union_oid(const List *list1, const List *list2)
  {
  	List	   *result;
! 	const ListCell   *cell;
  
  	Assert(IsOidList(list1));
  	Assert(IsOidList(list2));
  
  	result = list_copy(list1);
! 	foreach_const(cell, list2)
  	{
  		if (!list_member_oid(result, lfirst_oid(cell)))
  			result = lappend_oid(result, lfirst_oid(cell));
*************** list_union_oid(List *list1, List *list2)
*** 797,806 ****
   * to in the result.
   */
  List *
! list_intersection(List *list1, List *list2)
  {
  	List	   *result;
! 	ListCell   *cell;
  
  	if (list1 == NIL || list2 == NIL)
  		return NIL;
--- 797,806 ----
   * to in the result.
   */
  List *
! list_intersection(const List *list1, const List *list2)
  {
  	List	   *result;
! 	const ListCell   *cell;
  
  	if (list1 == NIL || list2 == NIL)
  		return NIL;
*************** list_intersection(List *list1, List *lis
*** 809,815 ****
  	Assert(IsPointerList(list2));
  
  	result = NIL;
! 	foreach(cell, list1)
  	{
  		if (list_member(list2, lfirst(cell)))
  			result = lappend(result, lfirst(cell));
--- 809,815 ----
  	Assert(IsPointerList(list2));
  
  	result = NIL;
! 	foreach_const(cell, list1)
  	{
  		if (list_member(list2, lfirst(cell)))
  			result = lappend(result, lfirst(cell));
*************** list_intersection(List *list1, List *lis
*** 829,837 ****
   * membership via equal()
   */
  List *
! list_difference(List *list1, List *list2)
  {
! 	ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsPointerList(list1));
--- 829,837 ----
   * membership via equal()
   */
  List *
! list_difference(const List *list1, const List *list2)
  {
! 	const ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsPointerList(list1));
*************** list_difference(List *list1, List *list2
*** 840,846 ****
  	if (list2 == NIL)
  		return list_copy(list1);
  
! 	foreach(cell, list1)
  	{
  		if (!list_member(list2, lfirst(cell)))
  			result = lappend(result, lfirst(cell));
--- 840,846 ----
  	if (list2 == NIL)
  		return list_copy(list1);
  
! 	foreach_const(cell, list1)
  	{
  		if (!list_member(list2, lfirst(cell)))
  			result = lappend(result, lfirst(cell));
*************** list_difference(List *list1, List *list2
*** 855,863 ****
   * simple pointer equality.
   */
  List *
! list_difference_ptr(List *list1, List *list2)
  {
! 	ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsPointerList(list1));
--- 855,863 ----
   * simple pointer equality.
   */
  List *
! list_difference_ptr(const List *list1, const List *list2)
  {
! 	const ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsPointerList(list1));
*************** list_difference_ptr(List *list1, List *l
*** 866,872 ****
  	if (list2 == NIL)
  		return list_copy(list1);
  
! 	foreach(cell, list1)
  	{
  		if (!list_member_ptr(list2, lfirst(cell)))
  			result = lappend(result, lfirst(cell));
--- 866,872 ----
  	if (list2 == NIL)
  		return list_copy(list1);
  
! 	foreach_const(cell, list1)
  	{
  		if (!list_member_ptr(list2, lfirst(cell)))
  			result = lappend(result, lfirst(cell));
*************** list_difference_ptr(List *list1, List *l
*** 880,888 ****
   * This variant of list_difference() operates upon lists of integers.
   */
  List *
! list_difference_int(List *list1, List *list2)
  {
! 	ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsIntegerList(list1));
--- 880,888 ----
   * This variant of list_difference() operates upon lists of integers.
   */
  List *
! list_difference_int(const List *list1, const List *list2)
  {
! 	const ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsIntegerList(list1));
*************** list_difference_int(List *list1, List *l
*** 891,897 ****
  	if (list2 == NIL)
  		return list_copy(list1);
  
! 	foreach(cell, list1)
  	{
  		if (!list_member_int(list2, lfirst_int(cell)))
  			result = lappend_int(result, lfirst_int(cell));
--- 891,897 ----
  	if (list2 == NIL)
  		return list_copy(list1);
  
! 	foreach_const(cell, list1)
  	{
  		if (!list_member_int(list2, lfirst_int(cell)))
  			result = lappend_int(result, lfirst_int(cell));
*************** list_difference_int(List *list1, List *l
*** 905,913 ****
   * This variant of list_difference() operates upon lists of OIDs.
   */
  List *
! list_difference_oid(List *list1, List *list2)
  {
! 	ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsOidList(list1));
--- 905,913 ----
   * This variant of list_difference() operates upon lists of OIDs.
   */
  List *
! list_difference_oid(const List *list1, const List *list2)
  {
! 	const ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsOidList(list1));
*************** list_difference_oid(List *list1, List *l
*** 916,922 ****
  	if (list2 == NIL)
  		return list_copy(list1);
  
! 	foreach(cell, list1)
  	{
  		if (!list_member_oid(list2, lfirst_oid(cell)))
  			result = lappend_oid(result, lfirst_oid(cell));
--- 916,922 ----
  	if (list2 == NIL)
  		return list_copy(list1);
  
! 	foreach_const(cell, list1)
  	{
  		if (!list_member_oid(list2, lfirst_oid(cell)))
  			result = lappend_oid(result, lfirst_oid(cell));
*************** list_free_deep(List *list)
*** 1131,1137 ****
   * Return a shallow copy of the specified list.
   */
  List *
! list_copy(List *oldlist)
  {
  	List	   *newlist;
  	ListCell   *newlist_prev;
--- 1131,1137 ----
   * Return a shallow copy of the specified list.
   */
  List *
! list_copy(const List *oldlist)
  {
  	List	   *newlist;
  	ListCell   *newlist_prev;
*************** list_copy(List *oldlist)
*** 1174,1180 ****
   * Return a shallow copy of the specified list, without the first N elements.
   */
  List *
! list_copy_tail(List *oldlist, int nskip)
  {
  	List	   *newlist;
  	ListCell   *newlist_prev;
--- 1174,1180 ----
   * Return a shallow copy of the specified list, without the first N elements.
   */
  List *
! list_copy_tail(const List *oldlist, int nskip)
  {
  	List	   *newlist;
  	ListCell   *newlist_prev;
*************** list_head(List *l)
*** 1235,1240 ****
--- 1235,1246 ----
  	return l ? l->head : NULL;
  }
  
+ const ListCell *
+ list_head_const(const List *l)
+ {
+ 	return l ? l->head : NULL;
+ }
+ 
  ListCell *
  list_tail(List *l)
  {
*************** list_tail(List *l)
*** 1242,1248 ****
  }
  
  int
! list_length(List *l)
  {
  	return l ? l->length : 0;
  }
--- 1248,1254 ----
  }
  
  int
! list_length(const List *l)
  {
  	return l ? l->length : 0;
  }
*************** list_length(List *l)
*** 1264,1273 ****
   * list_length() macro in order to avoid the overhead of a function
   * call.
   */
! int			length(List *list);
  
  int
! length(List *list)
  {
  	return list_length(list);
  }
--- 1270,1279 ----
   * list_length() macro in order to avoid the overhead of a function
   * call.
   */
! int			length(const List *list);
  
  int
! length(const List *list)
  {
  	return list_length(list);
  }
diff --git a/src/backend/nodes/nodeFuncs.c b/src/backend/nodes/nodeFuncs.c
new file mode 100644
index 0e57f6c..051bc3c
*** a/src/backend/nodes/nodeFuncs.c
--- b/src/backend/nodes/nodeFuncs.c
*************** static int	leftmostLoc(int loc1, int loc
*** 32,38 ****
   *	  returns the Oid of the type of the expression's result.
   */
  Oid
! exprType(Node *expr)
  {
  	Oid			type;
  
--- 32,38 ----
   *	  returns the Oid of the type of the expression's result.
   */
  Oid
! exprType(const Node *expr)
  {
  	Oid			type;
  
*************** exprType(Node *expr)
*** 241,247 ****
   *	  if it can be determined.	In many cases, it can't and we return -1.
   */
  int32
! exprTypmod(Node *expr)
  {
  	if (!expr)
  		return -1;
--- 241,247 ----
   *	  if it can be determined.	In many cases, it can't and we return -1.
   */
  int32
! exprTypmod(const Node *expr)
  {
  	if (!expr)
  		return -1;
*************** exprTypmod(Node *expr)
*** 481,487 ****
   * length coercion by this routine.
   */
  bool
! exprIsLengthCoercion(Node *expr, int32 *coercedTypmod)
  {
  	if (coercedTypmod != NULL)
  		*coercedTypmod = -1;	/* default result on failure */
--- 481,487 ----
   * length coercion by this routine.
   */
  bool
! exprIsLengthCoercion(const Node *expr, int32 *coercedTypmod)
  {
  	if (coercedTypmod != NULL)
  		*coercedTypmod = -1;	/* default result on failure */
*************** expression_returns_set_walker(Node *node
*** 632,638 ****
   * or vice versa, the two are different.
   */
  Oid
! exprCollation(Node *expr)
  {
  	Oid			coll;
  
--- 632,638 ----
   * or vice versa, the two are different.
   */
  Oid
! exprCollation(const Node *expr)
  {
  	Oid			coll;
  
*************** exprCollation(Node *expr)
*** 822,828 ****
   * Result is InvalidOid if the node type doesn't store this information.
   */
  Oid
! exprInputCollation(Node *expr)
  {
  	Oid			coll;
  
--- 822,828 ----
   * Result is InvalidOid if the node type doesn't store this information.
   */
  Oid
! exprInputCollation(const Node *expr)
  {
  	Oid			coll;
  
*************** exprSetInputCollation(Node *expr, Oid in
*** 1078,1084 ****
   * known and unknown locations in a tree.
   */
  int
! exprLocation(Node *expr)
  {
  	int			loc;
  
--- 1078,1084 ----
   * known and unknown locations in a tree.
   */
  int
! exprLocation(const Node *expr)
  {
  	int			loc;
  
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
new file mode 100644
index f7d39ed..2389fb3
*** a/src/backend/nodes/outfuncs.c
--- b/src/backend/nodes/outfuncs.c
***************
*** 94,100 ****
  
  #define booltostr(x)  ((x) ? "true" : "false")
  
! static void _outNode(StringInfo str, void *obj);
  
  
  /*
--- 94,100 ----
  
  #define booltostr(x)  ((x) ? "true" : "false")
  
! static void _outNode(StringInfo str, const void *obj);
  
  
  /*
*************** static void _outNode(StringInfo str, voi
*** 105,111 ****
   *	  If a null or empty string is given, it is encoded as "<>".
   */
  static void
! _outToken(StringInfo str, char *s)
  {
  	if (s == NULL || *s == '\0')
  	{
--- 105,111 ----
   *	  If a null or empty string is given, it is encoded as "<>".
   */
  static void
! _outToken(StringInfo str, const char *s)
  {
  	if (s == NULL || *s == '\0')
  	{
*************** _outToken(StringInfo str, char *s)
*** 137,145 ****
  }
  
  static void
! _outList(StringInfo str, List *node)
  {
! 	ListCell   *lc;
  
  	appendStringInfoChar(str, '(');
  
--- 137,145 ----
  }
  
  static void
! _outList(StringInfo str, const List *node)
  {
! 	const ListCell   *lc;
  
  	appendStringInfoChar(str, '(');
  
*************** _outList(StringInfo str, List *node)
*** 148,154 ****
  	else if (IsA(node, OidList))
  		appendStringInfoChar(str, 'o');
  
! 	foreach(lc, node)
  	{
  		/*
  		 * For the sake of backward compatibility, we emit a slightly
--- 148,154 ----
  	else if (IsA(node, OidList))
  		appendStringInfoChar(str, 'o');
  
! 	foreach_const(lc, node)
  	{
  		/*
  		 * For the sake of backward compatibility, we emit a slightly
*************** _outList(StringInfo str, List *node)
*** 180,186 ****
   * Note: the output format is "(b int int ...)", similar to an integer List.
   */
  static void
! _outBitmapset(StringInfo str, Bitmapset *bms)
  {
  	Bitmapset  *tmpset;
  	int			x;
--- 180,186 ----
   * Note: the output format is "(b int int ...)", similar to an integer List.
   */
  static void
! _outBitmapset(StringInfo str, const Bitmapset *bms)
  {
  	Bitmapset  *tmpset;
  	int			x;
*************** _outDatum(StringInfo str, Datum value, i
*** 235,241 ****
   */
  
  static void
! _outPlannedStmt(StringInfo str, PlannedStmt *node)
  {
  	WRITE_NODE_TYPE("PLANNEDSTMT");
  
--- 235,241 ----
   */
  
  static void
! _outPlannedStmt(StringInfo str, const PlannedStmt *node)
  {
  	WRITE_NODE_TYPE("PLANNEDSTMT");
  
*************** _outPlannedStmt(StringInfo str, PlannedS
*** 261,267 ****
   * print the basic stuff of all nodes that inherit from Plan
   */
  static void
! _outPlanInfo(StringInfo str, Plan *node)
  {
  	WRITE_FLOAT_FIELD(startup_cost, "%.2f");
  	WRITE_FLOAT_FIELD(total_cost, "%.2f");
--- 261,267 ----
   * print the basic stuff of all nodes that inherit from Plan
   */
  static void
! _outPlanInfo(StringInfo str, const Plan *node)
  {
  	WRITE_FLOAT_FIELD(startup_cost, "%.2f");
  	WRITE_FLOAT_FIELD(total_cost, "%.2f");
*************** _outPlanInfo(StringInfo str, Plan *node)
*** 280,288 ****
   * print the basic stuff of all nodes that inherit from Scan
   */
  static void
! _outScanInfo(StringInfo str, Scan *node)
  {
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_UINT_FIELD(scanrelid);
  }
--- 280,288 ----
   * print the basic stuff of all nodes that inherit from Scan
   */
  static void
! _outScanInfo(StringInfo str, const Scan *node)
  {
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_UINT_FIELD(scanrelid);
  }
*************** _outScanInfo(StringInfo str, Scan *node)
*** 291,299 ****
   * print the basic stuff of all nodes that inherit from Join
   */
  static void
! _outJoinPlanInfo(StringInfo str, Join *node)
  {
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_ENUM_FIELD(jointype, JoinType);
  	WRITE_NODE_FIELD(joinqual);
--- 291,299 ----
   * print the basic stuff of all nodes that inherit from Join
   */
  static void
! _outJoinPlanInfo(StringInfo str, const Join *node)
  {
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_ENUM_FIELD(jointype, JoinType);
  	WRITE_NODE_FIELD(joinqual);
*************** _outJoinPlanInfo(StringInfo str, Join *n
*** 301,329 ****
  
  
  static void
! _outPlan(StringInfo str, Plan *node)
  {
  	WRITE_NODE_TYPE("PLAN");
  
! 	_outPlanInfo(str, (Plan *) node);
  }
  
  static void
! _outResult(StringInfo str, Result *node)
  {
  	WRITE_NODE_TYPE("RESULT");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(resconstantqual);
  }
  
  static void
! _outModifyTable(StringInfo str, ModifyTable *node)
  {
  	WRITE_NODE_TYPE("MODIFYTABLE");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_ENUM_FIELD(operation, CmdType);
  	WRITE_BOOL_FIELD(canSetTag);
--- 301,329 ----
  
  
  static void
! _outPlan(StringInfo str, const Plan *node)
  {
  	WRITE_NODE_TYPE("PLAN");
  
! 	_outPlanInfo(str, (const Plan *) node);
  }
  
  static void
! _outResult(StringInfo str, const Result *node)
  {
  	WRITE_NODE_TYPE("RESULT");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(resconstantqual);
  }
  
  static void
! _outModifyTable(StringInfo str, const ModifyTable *node)
  {
  	WRITE_NODE_TYPE("MODIFYTABLE");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_ENUM_FIELD(operation, CmdType);
  	WRITE_BOOL_FIELD(canSetTag);
*************** _outModifyTable(StringInfo str, ModifyTa
*** 336,358 ****
  }
  
  static void
! _outAppend(StringInfo str, Append *node)
  {
  	WRITE_NODE_TYPE("APPEND");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(appendplans);
  }
  
  static void
! _outMergeAppend(StringInfo str, MergeAppend *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("MERGEAPPEND");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(mergeplans);
  
--- 336,358 ----
  }
  
  static void
! _outAppend(StringInfo str, const Append *node)
  {
  	WRITE_NODE_TYPE("APPEND");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(appendplans);
  }
  
  static void
! _outMergeAppend(StringInfo str, const MergeAppend *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("MERGEAPPEND");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(mergeplans);
  
*************** _outMergeAppend(StringInfo str, MergeApp
*** 376,388 ****
  }
  
  static void
! _outRecursiveUnion(StringInfo str, RecursiveUnion *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("RECURSIVEUNION");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_INT_FIELD(wtParam);
  	WRITE_INT_FIELD(numCols);
--- 376,388 ----
  }
  
  static void
! _outRecursiveUnion(StringInfo str, const RecursiveUnion *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("RECURSIVEUNION");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_INT_FIELD(wtParam);
  	WRITE_INT_FIELD(numCols);
*************** _outRecursiveUnion(StringInfo str, Recur
*** 399,445 ****
  }
  
  static void
! _outBitmapAnd(StringInfo str, BitmapAnd *node)
  {
  	WRITE_NODE_TYPE("BITMAPAND");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(bitmapplans);
  }
  
  static void
! _outBitmapOr(StringInfo str, BitmapOr *node)
  {
  	WRITE_NODE_TYPE("BITMAPOR");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(bitmapplans);
  }
  
  static void
! _outScan(StringInfo str, Scan *node)
  {
  	WRITE_NODE_TYPE("SCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  }
  
  static void
! _outSeqScan(StringInfo str, SeqScan *node)
  {
  	WRITE_NODE_TYPE("SEQSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  }
  
  static void
! _outIndexScan(StringInfo str, IndexScan *node)
  {
  	WRITE_NODE_TYPE("INDEXSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
--- 399,445 ----
  }
  
  static void
! _outBitmapAnd(StringInfo str, const BitmapAnd *node)
  {
  	WRITE_NODE_TYPE("BITMAPAND");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(bitmapplans);
  }
  
  static void
! _outBitmapOr(StringInfo str, const BitmapOr *node)
  {
  	WRITE_NODE_TYPE("BITMAPOR");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(bitmapplans);
  }
  
  static void
! _outScan(StringInfo str, const Scan *node)
  {
  	WRITE_NODE_TYPE("SCAN");
  
! 	_outScanInfo(str, node);
  }
  
  static void
! _outSeqScan(StringInfo str, const SeqScan *node)
  {
  	WRITE_NODE_TYPE("SEQSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  }
  
  static void
! _outIndexScan(StringInfo str, const IndexScan *node)
  {
  	WRITE_NODE_TYPE("INDEXSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
*************** _outIndexScan(StringInfo str, IndexScan
*** 450,460 ****
  }
  
  static void
! _outIndexOnlyScan(StringInfo str, IndexOnlyScan *node)
  {
  	WRITE_NODE_TYPE("INDEXONLYSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
--- 450,460 ----
  }
  
  static void
! _outIndexOnlyScan(StringInfo str, const IndexOnlyScan *node)
  {
  	WRITE_NODE_TYPE("INDEXONLYSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
*************** _outIndexOnlyScan(StringInfo str, IndexO
*** 464,474 ****
  }
  
  static void
! _outBitmapIndexScan(StringInfo str, BitmapIndexScan *node)
  {
  	WRITE_NODE_TYPE("BITMAPINDEXSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
--- 464,474 ----
  }
  
  static void
! _outBitmapIndexScan(StringInfo str, const BitmapIndexScan *node)
  {
  	WRITE_NODE_TYPE("BITMAPINDEXSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
*************** _outBitmapIndexScan(StringInfo str, Bitm
*** 476,516 ****
  }
  
  static void
! _outBitmapHeapScan(StringInfo str, BitmapHeapScan *node)
  {
  	WRITE_NODE_TYPE("BITMAPHEAPSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_NODE_FIELD(bitmapqualorig);
  }
  
  static void
! _outTidScan(StringInfo str, TidScan *node)
  {
  	WRITE_NODE_TYPE("TIDSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_NODE_FIELD(tidquals);
  }
  
  static void
! _outSubqueryScan(StringInfo str, SubqueryScan *node)
  {
  	WRITE_NODE_TYPE("SUBQUERYSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_NODE_FIELD(subplan);
  }
  
  static void
! _outFunctionScan(StringInfo str, FunctionScan *node)
  {
  	WRITE_NODE_TYPE("FUNCTIONSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_NODE_FIELD(funcexpr);
  	WRITE_NODE_FIELD(funccolnames);
--- 476,516 ----
  }
  
  static void
! _outBitmapHeapScan(StringInfo str, const BitmapHeapScan *node)
  {
  	WRITE_NODE_TYPE("BITMAPHEAPSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_NODE_FIELD(bitmapqualorig);
  }
  
  static void
! _outTidScan(StringInfo str, const TidScan *node)
  {
  	WRITE_NODE_TYPE("TIDSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_NODE_FIELD(tidquals);
  }
  
  static void
! _outSubqueryScan(StringInfo str, const SubqueryScan *node)
  {
  	WRITE_NODE_TYPE("SUBQUERYSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_NODE_FIELD(subplan);
  }
  
  static void
! _outFunctionScan(StringInfo str, const FunctionScan *node)
  {
  	WRITE_NODE_TYPE("FUNCTIONSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_NODE_FIELD(funcexpr);
  	WRITE_NODE_FIELD(funccolnames);
*************** _outFunctionScan(StringInfo str, Functio
*** 520,568 ****
  }
  
  static void
! _outValuesScan(StringInfo str, ValuesScan *node)
  {
  	WRITE_NODE_TYPE("VALUESSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_NODE_FIELD(values_lists);
  }
  
  static void
! _outCteScan(StringInfo str, CteScan *node)
  {
  	WRITE_NODE_TYPE("CTESCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_INT_FIELD(ctePlanId);
  	WRITE_INT_FIELD(cteParam);
  }
  
  static void
! _outWorkTableScan(StringInfo str, WorkTableScan *node)
  {
  	WRITE_NODE_TYPE("WORKTABLESCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_INT_FIELD(wtParam);
  }
  
  static void
! _outForeignScan(StringInfo str, ForeignScan *node)
  {
  	WRITE_NODE_TYPE("FOREIGNSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_BOOL_FIELD(fsSystemCol);
  	WRITE_NODE_FIELD(fdwplan);
  }
  
  static void
! _outFdwPlan(StringInfo str, FdwPlan *node)
  {
  	WRITE_NODE_TYPE("FDWPLAN");
  
--- 520,568 ----
  }
  
  static void
! _outValuesScan(StringInfo str, const ValuesScan *node)
  {
  	WRITE_NODE_TYPE("VALUESSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_NODE_FIELD(values_lists);
  }
  
  static void
! _outCteScan(StringInfo str, const CteScan *node)
  {
  	WRITE_NODE_TYPE("CTESCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_INT_FIELD(ctePlanId);
  	WRITE_INT_FIELD(cteParam);
  }
  
  static void
! _outWorkTableScan(StringInfo str, const WorkTableScan *node)
  {
  	WRITE_NODE_TYPE("WORKTABLESCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_INT_FIELD(wtParam);
  }
  
  static void
! _outForeignScan(StringInfo str, const ForeignScan *node)
  {
  	WRITE_NODE_TYPE("FOREIGNSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_BOOL_FIELD(fsSystemCol);
  	WRITE_NODE_FIELD(fdwplan);
  }
  
  static void
! _outFdwPlan(StringInfo str, const FdwPlan *node)
  {
  	WRITE_NODE_TYPE("FDWPLAN");
  
*************** _outFdwPlan(StringInfo str, FdwPlan *nod
*** 572,603 ****
  }
  
  static void
! _outJoin(StringInfo str, Join *node)
  {
  	WRITE_NODE_TYPE("JOIN");
  
! 	_outJoinPlanInfo(str, (Join *) node);
  }
  
  static void
! _outNestLoop(StringInfo str, NestLoop *node)
  {
  	WRITE_NODE_TYPE("NESTLOOP");
  
! 	_outJoinPlanInfo(str, (Join *) node);
  
  	WRITE_NODE_FIELD(nestParams);
  }
  
  static void
! _outMergeJoin(StringInfo str, MergeJoin *node)
  {
  	int			numCols;
  	int			i;
  
  	WRITE_NODE_TYPE("MERGEJOIN");
  
! 	_outJoinPlanInfo(str, (Join *) node);
  
  	WRITE_NODE_FIELD(mergeclauses);
  
--- 572,603 ----
  }
  
  static void
! _outJoin(StringInfo str, const Join *node)
  {
  	WRITE_NODE_TYPE("JOIN");
  
! 	_outJoinPlanInfo(str, (const Join *) node);
  }
  
  static void
! _outNestLoop(StringInfo str, const NestLoop *node)
  {
  	WRITE_NODE_TYPE("NESTLOOP");
  
! 	_outJoinPlanInfo(str, (const Join *) node);
  
  	WRITE_NODE_FIELD(nestParams);
  }
  
  static void
! _outMergeJoin(StringInfo str, const MergeJoin *node)
  {
  	int			numCols;
  	int			i;
  
  	WRITE_NODE_TYPE("MERGEJOIN");
  
! 	_outJoinPlanInfo(str, (const Join *) node);
  
  	WRITE_NODE_FIELD(mergeclauses);
  
*************** _outMergeJoin(StringInfo str, MergeJoin
*** 621,643 ****
  }
  
  static void
! _outHashJoin(StringInfo str, HashJoin *node)
  {
  	WRITE_NODE_TYPE("HASHJOIN");
  
! 	_outJoinPlanInfo(str, (Join *) node);
  
  	WRITE_NODE_FIELD(hashclauses);
  }
  
  static void
! _outAgg(StringInfo str, Agg *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("AGG");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_ENUM_FIELD(aggstrategy, AggStrategy);
  	WRITE_INT_FIELD(numCols);
--- 621,643 ----
  }
  
  static void
! _outHashJoin(StringInfo str, const HashJoin *node)
  {
  	WRITE_NODE_TYPE("HASHJOIN");
  
! 	_outJoinPlanInfo(str, (const Join *) node);
  
  	WRITE_NODE_FIELD(hashclauses);
  }
  
  static void
! _outAgg(StringInfo str, const Agg *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("AGG");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_ENUM_FIELD(aggstrategy, AggStrategy);
  	WRITE_INT_FIELD(numCols);
*************** _outAgg(StringInfo str, Agg *node)
*** 654,666 ****
  }
  
  static void
! _outWindowAgg(StringInfo str, WindowAgg *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("WINDOWAGG");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_UINT_FIELD(winref);
  	WRITE_INT_FIELD(partNumCols);
--- 654,666 ----
  }
  
  static void
! _outWindowAgg(StringInfo str, const WindowAgg *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("WINDOWAGG");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_UINT_FIELD(winref);
  	WRITE_INT_FIELD(partNumCols);
*************** _outWindowAgg(StringInfo str, WindowAgg
*** 689,701 ****
  }
  
  static void
! _outGroup(StringInfo str, Group *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("GROUP");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
--- 689,701 ----
  }
  
  static void
! _outGroup(StringInfo str, const Group *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("GROUP");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
*************** _outGroup(StringInfo str, Group *node)
*** 709,729 ****
  }
  
  static void
! _outMaterial(StringInfo str, Material *node)
  {
  	WRITE_NODE_TYPE("MATERIAL");
  
! 	_outPlanInfo(str, (Plan *) node);
  }
  
  static void
! _outSort(StringInfo str, Sort *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("SORT");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
--- 709,729 ----
  }
  
  static void
! _outMaterial(StringInfo str, const Material *node)
  {
  	WRITE_NODE_TYPE("MATERIAL");
  
! 	_outPlanInfo(str, (const Plan *) node);
  }
  
  static void
! _outSort(StringInfo str, const Sort *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("SORT");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
*************** _outSort(StringInfo str, Sort *node)
*** 745,757 ****
  }
  
  static void
! _outUnique(StringInfo str, Unique *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("UNIQUE");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
--- 745,757 ----
  }
  
  static void
! _outUnique(StringInfo str, const Unique *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("UNIQUE");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
*************** _outUnique(StringInfo str, Unique *node)
*** 765,775 ****
  }
  
  static void
! _outHash(StringInfo str, Hash *node)
  {
  	WRITE_NODE_TYPE("HASH");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_OID_FIELD(skewTable);
  	WRITE_INT_FIELD(skewColumn);
--- 765,775 ----
  }
  
  static void
! _outHash(StringInfo str, const Hash *node)
  {
  	WRITE_NODE_TYPE("HASH");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_OID_FIELD(skewTable);
  	WRITE_INT_FIELD(skewColumn);
*************** _outHash(StringInfo str, Hash *node)
*** 779,791 ****
  }
  
  static void
! _outSetOp(StringInfo str, SetOp *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("SETOP");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_ENUM_FIELD(cmd, SetOpCmd);
  	WRITE_ENUM_FIELD(strategy, SetOpStrategy);
--- 779,791 ----
  }
  
  static void
! _outSetOp(StringInfo str, const SetOp *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("SETOP");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_ENUM_FIELD(cmd, SetOpCmd);
  	WRITE_ENUM_FIELD(strategy, SetOpStrategy);
*************** _outSetOp(StringInfo str, SetOp *node)
*** 805,833 ****
  }
  
  static void
! _outLockRows(StringInfo str, LockRows *node)
  {
  	WRITE_NODE_TYPE("LOCKROWS");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(rowMarks);
  	WRITE_INT_FIELD(epqParam);
  }
  
  static void
! _outLimit(StringInfo str, Limit *node)
  {
  	WRITE_NODE_TYPE("LIMIT");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(limitOffset);
  	WRITE_NODE_FIELD(limitCount);
  }
  
  static void
! _outNestLoopParam(StringInfo str, NestLoopParam *node)
  {
  	WRITE_NODE_TYPE("NESTLOOPPARAM");
  
--- 805,833 ----
  }
  
  static void
! _outLockRows(StringInfo str, const LockRows *node)
  {
  	WRITE_NODE_TYPE("LOCKROWS");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(rowMarks);
  	WRITE_INT_FIELD(epqParam);
  }
  
  static void
! _outLimit(StringInfo str, const Limit *node)
  {
  	WRITE_NODE_TYPE("LIMIT");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(limitOffset);
  	WRITE_NODE_FIELD(limitCount);
  }
  
  static void
! _outNestLoopParam(StringInfo str, const NestLoopParam *node)
  {
  	WRITE_NODE_TYPE("NESTLOOPPARAM");
  
*************** _outNestLoopParam(StringInfo str, NestLo
*** 836,842 ****
  }
  
  static void
! _outPlanRowMark(StringInfo str, PlanRowMark *node)
  {
  	WRITE_NODE_TYPE("PLANROWMARK");
  
--- 836,842 ----
  }
  
  static void
! _outPlanRowMark(StringInfo str, const PlanRowMark *node)
  {
  	WRITE_NODE_TYPE("PLANROWMARK");
  
*************** _outPlanRowMark(StringInfo str, PlanRowM
*** 849,855 ****
  }
  
  static void
! _outPlanInvalItem(StringInfo str, PlanInvalItem *node)
  {
  	WRITE_NODE_TYPE("PLANINVALITEM");
  
--- 849,855 ----
  }
  
  static void
! _outPlanInvalItem(StringInfo str, const PlanInvalItem *node)
  {
  	WRITE_NODE_TYPE("PLANINVALITEM");
  
*************** _outPlanInvalItem(StringInfo str, PlanIn
*** 864,870 ****
   *****************************************************************************/
  
  static void
! _outAlias(StringInfo str, Alias *node)
  {
  	WRITE_NODE_TYPE("ALIAS");
  
--- 864,870 ----
   *****************************************************************************/
  
  static void
! _outAlias(StringInfo str, const Alias *node)
  {
  	WRITE_NODE_TYPE("ALIAS");
  
*************** _outAlias(StringInfo str, Alias *node)
*** 873,879 ****
  }
  
  static void
! _outRangeVar(StringInfo str, RangeVar *node)
  {
  	WRITE_NODE_TYPE("RANGEVAR");
  
--- 873,879 ----
  }
  
  static void
! _outRangeVar(StringInfo str, const RangeVar *node)
  {
  	WRITE_NODE_TYPE("RANGEVAR");
  
*************** _outRangeVar(StringInfo str, RangeVar *n
*** 890,896 ****
  }
  
  static void
! _outIntoClause(StringInfo str, IntoClause *node)
  {
  	WRITE_NODE_TYPE("INTOCLAUSE");
  
--- 890,896 ----
  }
  
  static void
! _outIntoClause(StringInfo str, const IntoClause *node)
  {
  	WRITE_NODE_TYPE("INTOCLAUSE");
  
*************** _outIntoClause(StringInfo str, IntoClaus
*** 902,908 ****
  }
  
  static void
! _outVar(StringInfo str, Var *node)
  {
  	WRITE_NODE_TYPE("VAR");
  
--- 902,908 ----
  }
  
  static void
! _outVar(StringInfo str, const Var *node)
  {
  	WRITE_NODE_TYPE("VAR");
  
*************** _outVar(StringInfo str, Var *node)
*** 918,924 ****
  }
  
  static void
! _outConst(StringInfo str, Const *node)
  {
  	WRITE_NODE_TYPE("CONST");
  
--- 918,924 ----
  }
  
  static void
! _outConst(StringInfo str, const Const *node)
  {
  	WRITE_NODE_TYPE("CONST");
  
*************** _outConst(StringInfo str, Const *node)
*** 938,944 ****
  }
  
  static void
! _outParam(StringInfo str, Param *node)
  {
  	WRITE_NODE_TYPE("PARAM");
  
--- 938,944 ----
  }
  
  static void
! _outParam(StringInfo str, const Param *node)
  {
  	WRITE_NODE_TYPE("PARAM");
  
*************** _outParam(StringInfo str, Param *node)
*** 951,957 ****
  }
  
  static void
! _outAggref(StringInfo str, Aggref *node)
  {
  	WRITE_NODE_TYPE("AGGREF");
  
--- 951,957 ----
  }
  
  static void
! _outAggref(StringInfo str, const Aggref *node)
  {
  	WRITE_NODE_TYPE("AGGREF");
  
*************** _outAggref(StringInfo str, Aggref *node)
*** 968,974 ****
  }
  
  static void
! _outWindowFunc(StringInfo str, WindowFunc *node)
  {
  	WRITE_NODE_TYPE("WINDOWFUNC");
  
--- 968,974 ----
  }
  
  static void
! _outWindowFunc(StringInfo str, const WindowFunc *node)
  {
  	WRITE_NODE_TYPE("WINDOWFUNC");
  
*************** _outWindowFunc(StringInfo str, WindowFun
*** 984,990 ****
  }
  
  static void
! _outArrayRef(StringInfo str, ArrayRef *node)
  {
  	WRITE_NODE_TYPE("ARRAYREF");
  
--- 984,990 ----
  }
  
  static void
! _outArrayRef(StringInfo str, const ArrayRef *node)
  {
  	WRITE_NODE_TYPE("ARRAYREF");
  
*************** _outArrayRef(StringInfo str, ArrayRef *n
*** 999,1005 ****
  }
  
  static void
! _outFuncExpr(StringInfo str, FuncExpr *node)
  {
  	WRITE_NODE_TYPE("FUNCEXPR");
  
--- 999,1005 ----
  }
  
  static void
! _outFuncExpr(StringInfo str, const FuncExpr *node)
  {
  	WRITE_NODE_TYPE("FUNCEXPR");
  
*************** _outFuncExpr(StringInfo str, FuncExpr *n
*** 1014,1020 ****
  }
  
  static void
! _outNamedArgExpr(StringInfo str, NamedArgExpr *node)
  {
  	WRITE_NODE_TYPE("NAMEDARGEXPR");
  
--- 1014,1020 ----
  }
  
  static void
! _outNamedArgExpr(StringInfo str, const NamedArgExpr *node)
  {
  	WRITE_NODE_TYPE("NAMEDARGEXPR");
  
*************** _outNamedArgExpr(StringInfo str, NamedAr
*** 1025,1031 ****
  }
  
  static void
! _outOpExpr(StringInfo str, OpExpr *node)
  {
  	WRITE_NODE_TYPE("OPEXPR");
  
--- 1025,1031 ----
  }
  
  static void
! _outOpExpr(StringInfo str, const OpExpr *node)
  {
  	WRITE_NODE_TYPE("OPEXPR");
  
*************** _outOpExpr(StringInfo str, OpExpr *node)
*** 1040,1046 ****
  }
  
  static void
! _outDistinctExpr(StringInfo str, DistinctExpr *node)
  {
  	WRITE_NODE_TYPE("DISTINCTEXPR");
  
--- 1040,1046 ----
  }
  
  static void
! _outDistinctExpr(StringInfo str, const DistinctExpr *node)
  {
  	WRITE_NODE_TYPE("DISTINCTEXPR");
  
*************** _outDistinctExpr(StringInfo str, Distinc
*** 1055,1061 ****
  }
  
  static void
! _outNullIfExpr(StringInfo str, NullIfExpr *node)
  {
  	WRITE_NODE_TYPE("NULLIFEXPR");
  
--- 1055,1061 ----
  }
  
  static void
! _outNullIfExpr(StringInfo str, const NullIfExpr *node)
  {
  	WRITE_NODE_TYPE("NULLIFEXPR");
  
*************** _outNullIfExpr(StringInfo str, NullIfExp
*** 1070,1076 ****
  }
  
  static void
! _outScalarArrayOpExpr(StringInfo str, ScalarArrayOpExpr *node)
  {
  	WRITE_NODE_TYPE("SCALARARRAYOPEXPR");
  
--- 1070,1076 ----
  }
  
  static void
! _outScalarArrayOpExpr(StringInfo str, const ScalarArrayOpExpr *node)
  {
  	WRITE_NODE_TYPE("SCALARARRAYOPEXPR");
  
*************** _outScalarArrayOpExpr(StringInfo str, Sc
*** 1083,1089 ****
  }
  
  static void
! _outBoolExpr(StringInfo str, BoolExpr *node)
  {
  	char	   *opstr = NULL;
  
--- 1083,1089 ----
  }
  
  static void
! _outBoolExpr(StringInfo str, const BoolExpr *node)
  {
  	char	   *opstr = NULL;
  
*************** _outBoolExpr(StringInfo str, BoolExpr *n
*** 1110,1116 ****
  }
  
  static void
! _outSubLink(StringInfo str, SubLink *node)
  {
  	WRITE_NODE_TYPE("SUBLINK");
  
--- 1110,1116 ----
  }
  
  static void
! _outSubLink(StringInfo str, const SubLink *node)
  {
  	WRITE_NODE_TYPE("SUBLINK");
  
*************** _outSubLink(StringInfo str, SubLink *nod
*** 1122,1128 ****
  }
  
  static void
! _outSubPlan(StringInfo str, SubPlan *node)
  {
  	WRITE_NODE_TYPE("SUBPLAN");
  
--- 1122,1128 ----
  }
  
  static void
! _outSubPlan(StringInfo str, const SubPlan *node)
  {
  	WRITE_NODE_TYPE("SUBPLAN");
  
*************** _outSubPlan(StringInfo str, SubPlan *nod
*** 1144,1150 ****
  }
  
  static void
! _outAlternativeSubPlan(StringInfo str, AlternativeSubPlan *node)
  {
  	WRITE_NODE_TYPE("ALTERNATIVESUBPLAN");
  
--- 1144,1150 ----
  }
  
  static void
! _outAlternativeSubPlan(StringInfo str, const AlternativeSubPlan *node)
  {
  	WRITE_NODE_TYPE("ALTERNATIVESUBPLAN");
  
*************** _outAlternativeSubPlan(StringInfo str, A
*** 1152,1158 ****
  }
  
  static void
! _outFieldSelect(StringInfo str, FieldSelect *node)
  {
  	WRITE_NODE_TYPE("FIELDSELECT");
  
--- 1152,1158 ----
  }
  
  static void
! _outFieldSelect(StringInfo str, const FieldSelect *node)
  {
  	WRITE_NODE_TYPE("FIELDSELECT");
  
*************** _outFieldSelect(StringInfo str, FieldSel
*** 1164,1170 ****
  }
  
  static void
! _outFieldStore(StringInfo str, FieldStore *node)
  {
  	WRITE_NODE_TYPE("FIELDSTORE");
  
--- 1164,1170 ----
  }
  
  static void
! _outFieldStore(StringInfo str, const FieldStore *node)
  {
  	WRITE_NODE_TYPE("FIELDSTORE");
  
*************** _outFieldStore(StringInfo str, FieldStor
*** 1175,1181 ****
  }
  
  static void
! _outRelabelType(StringInfo str, RelabelType *node)
  {
  	WRITE_NODE_TYPE("RELABELTYPE");
  
--- 1175,1181 ----
  }
  
  static void
! _outRelabelType(StringInfo str, const RelabelType *node)
  {
  	WRITE_NODE_TYPE("RELABELTYPE");
  
*************** _outRelabelType(StringInfo str, RelabelT
*** 1188,1194 ****
  }
  
  static void
! _outCoerceViaIO(StringInfo str, CoerceViaIO *node)
  {
  	WRITE_NODE_TYPE("COERCEVIAIO");
  
--- 1188,1194 ----
  }
  
  static void
! _outCoerceViaIO(StringInfo str, const CoerceViaIO *node)
  {
  	WRITE_NODE_TYPE("COERCEVIAIO");
  
*************** _outCoerceViaIO(StringInfo str, CoerceVi
*** 1200,1206 ****
  }
  
  static void
! _outArrayCoerceExpr(StringInfo str, ArrayCoerceExpr *node)
  {
  	WRITE_NODE_TYPE("ARRAYCOERCEEXPR");
  
--- 1200,1206 ----
  }
  
  static void
! _outArrayCoerceExpr(StringInfo str, const ArrayCoerceExpr *node)
  {
  	WRITE_NODE_TYPE("ARRAYCOERCEEXPR");
  
*************** _outArrayCoerceExpr(StringInfo str, Arra
*** 1215,1221 ****
  }
  
  static void
! _outConvertRowtypeExpr(StringInfo str, ConvertRowtypeExpr *node)
  {
  	WRITE_NODE_TYPE("CONVERTROWTYPEEXPR");
  
--- 1215,1221 ----
  }
  
  static void
! _outConvertRowtypeExpr(StringInfo str, const ConvertRowtypeExpr *node)
  {
  	WRITE_NODE_TYPE("CONVERTROWTYPEEXPR");
  
*************** _outConvertRowtypeExpr(StringInfo str, C
*** 1226,1232 ****
  }
  
  static void
! _outCollateExpr(StringInfo str, CollateExpr *node)
  {
  	WRITE_NODE_TYPE("COLLATE");
  
--- 1226,1232 ----
  }
  
  static void
! _outCollateExpr(StringInfo str, const CollateExpr *node)
  {
  	WRITE_NODE_TYPE("COLLATE");
  
*************** _outCollateExpr(StringInfo str, CollateE
*** 1236,1242 ****
  }
  
  static void
! _outCaseExpr(StringInfo str, CaseExpr *node)
  {
  	WRITE_NODE_TYPE("CASE");
  
--- 1236,1242 ----
  }
  
  static void
! _outCaseExpr(StringInfo str, const CaseExpr *node)
  {
  	WRITE_NODE_TYPE("CASE");
  
*************** _outCaseExpr(StringInfo str, CaseExpr *n
*** 1249,1255 ****
  }
  
  static void
! _outCaseWhen(StringInfo str, CaseWhen *node)
  {
  	WRITE_NODE_TYPE("WHEN");
  
--- 1249,1255 ----
  }
  
  static void
! _outCaseWhen(StringInfo str, const CaseWhen *node)
  {
  	WRITE_NODE_TYPE("WHEN");
  
*************** _outCaseWhen(StringInfo str, CaseWhen *n
*** 1259,1265 ****
  }
  
  static void
! _outCaseTestExpr(StringInfo str, CaseTestExpr *node)
  {
  	WRITE_NODE_TYPE("CASETESTEXPR");
  
--- 1259,1265 ----
  }
  
  static void
! _outCaseTestExpr(StringInfo str, const CaseTestExpr *node)
  {
  	WRITE_NODE_TYPE("CASETESTEXPR");
  
*************** _outCaseTestExpr(StringInfo str, CaseTes
*** 1269,1275 ****
  }
  
  static void
! _outArrayExpr(StringInfo str, ArrayExpr *node)
  {
  	WRITE_NODE_TYPE("ARRAY");
  
--- 1269,1275 ----
  }
  
  static void
! _outArrayExpr(StringInfo str, const ArrayExpr *node)
  {
  	WRITE_NODE_TYPE("ARRAY");
  
*************** _outArrayExpr(StringInfo str, ArrayExpr
*** 1282,1288 ****
  }
  
  static void
! _outRowExpr(StringInfo str, RowExpr *node)
  {
  	WRITE_NODE_TYPE("ROW");
  
--- 1282,1288 ----
  }
  
  static void
! _outRowExpr(StringInfo str, const RowExpr *node)
  {
  	WRITE_NODE_TYPE("ROW");
  
*************** _outRowExpr(StringInfo str, RowExpr *nod
*** 1294,1300 ****
  }
  
  static void
! _outRowCompareExpr(StringInfo str, RowCompareExpr *node)
  {
  	WRITE_NODE_TYPE("ROWCOMPARE");
  
--- 1294,1300 ----
  }
  
  static void
! _outRowCompareExpr(StringInfo str, const RowCompareExpr *node)
  {
  	WRITE_NODE_TYPE("ROWCOMPARE");
  
*************** _outRowCompareExpr(StringInfo str, RowCo
*** 1307,1313 ****
  }
  
  static void
! _outCoalesceExpr(StringInfo str, CoalesceExpr *node)
  {
  	WRITE_NODE_TYPE("COALESCE");
  
--- 1307,1313 ----
  }
  
  static void
! _outCoalesceExpr(StringInfo str, const CoalesceExpr *node)
  {
  	WRITE_NODE_TYPE("COALESCE");
  
*************** _outCoalesceExpr(StringInfo str, Coalesc
*** 1318,1324 ****
  }
  
  static void
! _outMinMaxExpr(StringInfo str, MinMaxExpr *node)
  {
  	WRITE_NODE_TYPE("MINMAX");
  
--- 1318,1324 ----
  }
  
  static void
! _outMinMaxExpr(StringInfo str, const MinMaxExpr *node)
  {
  	WRITE_NODE_TYPE("MINMAX");
  
*************** _outMinMaxExpr(StringInfo str, MinMaxExp
*** 1331,1337 ****
  }
  
  static void
! _outXmlExpr(StringInfo str, XmlExpr *node)
  {
  	WRITE_NODE_TYPE("XMLEXPR");
  
--- 1331,1337 ----
  }
  
  static void
! _outXmlExpr(StringInfo str, const XmlExpr *node)
  {
  	WRITE_NODE_TYPE("XMLEXPR");
  
*************** _outXmlExpr(StringInfo str, XmlExpr *nod
*** 1347,1353 ****
  }
  
  static void
! _outNullTest(StringInfo str, NullTest *node)
  {
  	WRITE_NODE_TYPE("NULLTEST");
  
--- 1347,1353 ----
  }
  
  static void
! _outNullTest(StringInfo str, const NullTest *node)
  {
  	WRITE_NODE_TYPE("NULLTEST");
  
*************** _outNullTest(StringInfo str, NullTest *n
*** 1357,1363 ****
  }
  
  static void
! _outBooleanTest(StringInfo str, BooleanTest *node)
  {
  	WRITE_NODE_TYPE("BOOLEANTEST");
  
--- 1357,1363 ----
  }
  
  static void
! _outBooleanTest(StringInfo str, const BooleanTest *node)
  {
  	WRITE_NODE_TYPE("BOOLEANTEST");
  
*************** _outBooleanTest(StringInfo str, BooleanT
*** 1366,1372 ****
  }
  
  static void
! _outCoerceToDomain(StringInfo str, CoerceToDomain *node)
  {
  	WRITE_NODE_TYPE("COERCETODOMAIN");
  
--- 1366,1372 ----
  }
  
  static void
! _outCoerceToDomain(StringInfo str, const CoerceToDomain *node)
  {
  	WRITE_NODE_TYPE("COERCETODOMAIN");
  
*************** _outCoerceToDomain(StringInfo str, Coerc
*** 1379,1385 ****
  }
  
  static void
! _outCoerceToDomainValue(StringInfo str, CoerceToDomainValue *node)
  {
  	WRITE_NODE_TYPE("COERCETODOMAINVALUE");
  
--- 1379,1385 ----
  }
  
  static void
! _outCoerceToDomainValue(StringInfo str, const CoerceToDomainValue *node)
  {
  	WRITE_NODE_TYPE("COERCETODOMAINVALUE");
  
*************** _outCoerceToDomainValue(StringInfo str,
*** 1390,1396 ****
  }
  
  static void
! _outSetToDefault(StringInfo str, SetToDefault *node)
  {
  	WRITE_NODE_TYPE("SETTODEFAULT");
  
--- 1390,1396 ----
  }
  
  static void
! _outSetToDefault(StringInfo str, const SetToDefault *node)
  {
  	WRITE_NODE_TYPE("SETTODEFAULT");
  
*************** _outSetToDefault(StringInfo str, SetToDe
*** 1401,1407 ****
  }
  
  static void
! _outCurrentOfExpr(StringInfo str, CurrentOfExpr *node)
  {
  	WRITE_NODE_TYPE("CURRENTOFEXPR");
  
--- 1401,1407 ----
  }
  
  static void
! _outCurrentOfExpr(StringInfo str, const CurrentOfExpr *node)
  {
  	WRITE_NODE_TYPE("CURRENTOFEXPR");
  
*************** _outCurrentOfExpr(StringInfo str, Curren
*** 1411,1417 ****
  }
  
  static void
! _outTargetEntry(StringInfo str, TargetEntry *node)
  {
  	WRITE_NODE_TYPE("TARGETENTRY");
  
--- 1411,1417 ----
  }
  
  static void
! _outTargetEntry(StringInfo str, const TargetEntry *node)
  {
  	WRITE_NODE_TYPE("TARGETENTRY");
  
*************** _outTargetEntry(StringInfo str, TargetEn
*** 1425,1431 ****
  }
  
  static void
! _outRangeTblRef(StringInfo str, RangeTblRef *node)
  {
  	WRITE_NODE_TYPE("RANGETBLREF");
  
--- 1425,1431 ----
  }
  
  static void
! _outRangeTblRef(StringInfo str, const RangeTblRef *node)
  {
  	WRITE_NODE_TYPE("RANGETBLREF");
  
*************** _outRangeTblRef(StringInfo str, RangeTbl
*** 1433,1439 ****
  }
  
  static void
! _outJoinExpr(StringInfo str, JoinExpr *node)
  {
  	WRITE_NODE_TYPE("JOINEXPR");
  
--- 1433,1439 ----
  }
  
  static void
! _outJoinExpr(StringInfo str, const JoinExpr *node)
  {
  	WRITE_NODE_TYPE("JOINEXPR");
  
*************** _outJoinExpr(StringInfo str, JoinExpr *n
*** 1448,1454 ****
  }
  
  static void
! _outFromExpr(StringInfo str, FromExpr *node)
  {
  	WRITE_NODE_TYPE("FROMEXPR");
  
--- 1448,1454 ----
  }
  
  static void
! _outFromExpr(StringInfo str, const FromExpr *node)
  {
  	WRITE_NODE_TYPE("FROMEXPR");
  
*************** _outFromExpr(StringInfo str, FromExpr *n
*** 1469,1475 ****
   * We can print the parent's relids for identification purposes, though.
   */
  static void
! _outPathInfo(StringInfo str, Path *node)
  {
  	WRITE_ENUM_FIELD(pathtype, NodeTag);
  	appendStringInfo(str, " :parent_relids ");
--- 1469,1475 ----
   * We can print the parent's relids for identification purposes, though.
   */
  static void
! _outPathInfo(StringInfo str, const Path *node)
  {
  	WRITE_ENUM_FIELD(pathtype, NodeTag);
  	appendStringInfo(str, " :parent_relids ");
*************** _outPathInfo(StringInfo str, Path *node)
*** 1483,1491 ****
   * print the basic stuff of all nodes that inherit from JoinPath
   */
  static void
! _outJoinPathInfo(StringInfo str, JoinPath *node)
  {
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_ENUM_FIELD(jointype, JoinType);
  	WRITE_NODE_FIELD(outerjoinpath);
--- 1483,1491 ----
   * print the basic stuff of all nodes that inherit from JoinPath
   */
  static void
! _outJoinPathInfo(StringInfo str, const JoinPath *node)
  {
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_ENUM_FIELD(jointype, JoinType);
  	WRITE_NODE_FIELD(outerjoinpath);
*************** _outJoinPathInfo(StringInfo str, JoinPat
*** 1494,1512 ****
  }
  
  static void
! _outPath(StringInfo str, Path *node)
  {
  	WRITE_NODE_TYPE("PATH");
  
! 	_outPathInfo(str, (Path *) node);
  }
  
  static void
! _outIndexPath(StringInfo str, IndexPath *node)
  {
  	WRITE_NODE_TYPE("INDEXPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(indexinfo);
  	WRITE_NODE_FIELD(indexclauses);
--- 1494,1512 ----
  }
  
  static void
! _outPath(StringInfo str, const Path *node)
  {
  	WRITE_NODE_TYPE("PATH");
  
! 	_outPathInfo(str, (const Path *) node);
  }
  
  static void
! _outIndexPath(StringInfo str, const IndexPath *node)
  {
  	WRITE_NODE_TYPE("INDEXPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(indexinfo);
  	WRITE_NODE_FIELD(indexclauses);
*************** _outIndexPath(StringInfo str, IndexPath
*** 1520,1530 ****
  }
  
  static void
! _outBitmapHeapPath(StringInfo str, BitmapHeapPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPHEAPPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(bitmapqual);
  	WRITE_BOOL_FIELD(isjoininner);
--- 1520,1530 ----
  }
  
  static void
! _outBitmapHeapPath(StringInfo str, const BitmapHeapPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPHEAPPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(bitmapqual);
  	WRITE_BOOL_FIELD(isjoininner);
*************** _outBitmapHeapPath(StringInfo str, Bitma
*** 1532,1538 ****
  }
  
  static void
! _outBitmapAndPath(StringInfo str, BitmapAndPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPANDPATH");
  
--- 1532,1538 ----
  }
  
  static void
! _outBitmapAndPath(StringInfo str, const BitmapAndPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPANDPATH");
  
*************** _outBitmapAndPath(StringInfo str, Bitmap
*** 1543,1580 ****
  }
  
  static void
! _outBitmapOrPath(StringInfo str, BitmapOrPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPORPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(bitmapquals);
  	WRITE_FLOAT_FIELD(bitmapselectivity, "%.4f");
  }
  
  static void
! _outTidPath(StringInfo str, TidPath *node)
  {
  	WRITE_NODE_TYPE("TIDPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(tidquals);
  }
  
  static void
! _outForeignPath(StringInfo str, ForeignPath *node)
  {
  	WRITE_NODE_TYPE("FOREIGNPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(fdwplan);
  }
  
  static void
! _outAppendPath(StringInfo str, AppendPath *node)
  {
  	WRITE_NODE_TYPE("APPENDPATH");
  
--- 1543,1580 ----
  }
  
  static void
! _outBitmapOrPath(StringInfo str, const BitmapOrPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPORPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(bitmapquals);
  	WRITE_FLOAT_FIELD(bitmapselectivity, "%.4f");
  }
  
  static void
! _outTidPath(StringInfo str, const TidPath *node)
  {
  	WRITE_NODE_TYPE("TIDPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(tidquals);
  }
  
  static void
! _outForeignPath(StringInfo str, const ForeignPath *node)
  {
  	WRITE_NODE_TYPE("FOREIGNPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(fdwplan);
  }
  
  static void
! _outAppendPath(StringInfo str, const AppendPath *node)
  {
  	WRITE_NODE_TYPE("APPENDPATH");
  
*************** _outAppendPath(StringInfo str, AppendPat
*** 1584,1625 ****
  }
  
  static void
! _outMergeAppendPath(StringInfo str, MergeAppendPath *node)
  {
  	WRITE_NODE_TYPE("MERGEAPPENDPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(subpaths);
  	WRITE_FLOAT_FIELD(limit_tuples, "%.0f");
  }
  
  static void
! _outResultPath(StringInfo str, ResultPath *node)
  {
  	WRITE_NODE_TYPE("RESULTPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(quals);
  }
  
  static void
! _outMaterialPath(StringInfo str, MaterialPath *node)
  {
  	WRITE_NODE_TYPE("MATERIALPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(subpath);
  }
  
  static void
! _outUniquePath(StringInfo str, UniquePath *node)
  {
  	WRITE_NODE_TYPE("UNIQUEPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(subpath);
  	WRITE_ENUM_FIELD(umethod, UniquePathMethod);
--- 1584,1625 ----
  }
  
  static void
! _outMergeAppendPath(StringInfo str, const MergeAppendPath *node)
  {
  	WRITE_NODE_TYPE("MERGEAPPENDPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(subpaths);
  	WRITE_FLOAT_FIELD(limit_tuples, "%.0f");
  }
  
  static void
! _outResultPath(StringInfo str, const ResultPath *node)
  {
  	WRITE_NODE_TYPE("RESULTPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(quals);
  }
  
  static void
! _outMaterialPath(StringInfo str, const MaterialPath *node)
  {
  	WRITE_NODE_TYPE("MATERIALPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(subpath);
  }
  
  static void
! _outUniquePath(StringInfo str, const UniquePath *node)
  {
  	WRITE_NODE_TYPE("UNIQUEPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(subpath);
  	WRITE_ENUM_FIELD(umethod, UniquePathMethod);
*************** _outUniquePath(StringInfo str, UniquePat
*** 1629,1647 ****
  }
  
  static void
! _outNestPath(StringInfo str, NestPath *node)
  {
  	WRITE_NODE_TYPE("NESTPATH");
  
! 	_outJoinPathInfo(str, (JoinPath *) node);
  }
  
  static void
! _outMergePath(StringInfo str, MergePath *node)
  {
  	WRITE_NODE_TYPE("MERGEPATH");
  
! 	_outJoinPathInfo(str, (JoinPath *) node);
  
  	WRITE_NODE_FIELD(path_mergeclauses);
  	WRITE_NODE_FIELD(outersortkeys);
--- 1629,1647 ----
  }
  
  static void
! _outNestPath(StringInfo str, const NestPath *node)
  {
  	WRITE_NODE_TYPE("NESTPATH");
  
! 	_outJoinPathInfo(str, (const JoinPath *) node);
  }
  
  static void
! _outMergePath(StringInfo str, const MergePath *node)
  {
  	WRITE_NODE_TYPE("MERGEPATH");
  
! 	_outJoinPathInfo(str, (const JoinPath *) node);
  
  	WRITE_NODE_FIELD(path_mergeclauses);
  	WRITE_NODE_FIELD(outersortkeys);
*************** _outMergePath(StringInfo str, MergePath
*** 1650,1667 ****
  }
  
  static void
! _outHashPath(StringInfo str, HashPath *node)
  {
  	WRITE_NODE_TYPE("HASHPATH");
  
! 	_outJoinPathInfo(str, (JoinPath *) node);
  
  	WRITE_NODE_FIELD(path_hashclauses);
  	WRITE_INT_FIELD(num_batches);
  }
  
  static void
! _outPlannerGlobal(StringInfo str, PlannerGlobal *node)
  {
  	WRITE_NODE_TYPE("PLANNERGLOBAL");
  
--- 1650,1667 ----
  }
  
  static void
! _outHashPath(StringInfo str, const HashPath *node)
  {
  	WRITE_NODE_TYPE("HASHPATH");
  
! 	_outJoinPathInfo(str, (const JoinPath *) node);
  
  	WRITE_NODE_FIELD(path_hashclauses);
  	WRITE_INT_FIELD(num_batches);
  }
  
  static void
! _outPlannerGlobal(StringInfo str, const PlannerGlobal *node)
  {
  	WRITE_NODE_TYPE("PLANNERGLOBAL");
  
*************** _outPlannerGlobal(StringInfo str, Planne
*** 1680,1686 ****
  }
  
  static void
! _outPlannerInfo(StringInfo str, PlannerInfo *node)
  {
  	WRITE_NODE_TYPE("PLANNERINFO");
  
--- 1680,1686 ----
  }
  
  static void
! _outPlannerInfo(StringInfo str, const PlannerInfo *node)
  {
  	WRITE_NODE_TYPE("PLANNERINFO");
  
*************** _outPlannerInfo(StringInfo str, PlannerI
*** 1721,1727 ****
  }
  
  static void
! _outRelOptInfo(StringInfo str, RelOptInfo *node)
  {
  	WRITE_NODE_TYPE("RELOPTINFO");
  
--- 1721,1727 ----
  }
  
  static void
! _outRelOptInfo(StringInfo str, const RelOptInfo *node)
  {
  	WRITE_NODE_TYPE("RELOPTINFO");
  
*************** _outRelOptInfo(StringInfo str, RelOptInf
*** 1754,1760 ****
  }
  
  static void
! _outIndexOptInfo(StringInfo str, IndexOptInfo *node)
  {
  	WRITE_NODE_TYPE("INDEXOPTINFO");
  
--- 1754,1760 ----
  }
  
  static void
! _outIndexOptInfo(StringInfo str, const IndexOptInfo *node)
  {
  	WRITE_NODE_TYPE("INDEXOPTINFO");
  
*************** _outIndexOptInfo(StringInfo str, IndexOp
*** 1775,1781 ****
  }
  
  static void
! _outEquivalenceClass(StringInfo str, EquivalenceClass *node)
  {
  	/*
  	 * To simplify reading, we just chase up to the topmost merged EC and
--- 1775,1781 ----
  }
  
  static void
! _outEquivalenceClass(StringInfo str, const EquivalenceClass *node)
  {
  	/*
  	 * To simplify reading, we just chase up to the topmost merged EC and
*************** _outEquivalenceClass(StringInfo str, Equ
*** 1800,1806 ****
  }
  
  static void
! _outEquivalenceMember(StringInfo str, EquivalenceMember *node)
  {
  	WRITE_NODE_TYPE("EQUIVALENCEMEMBER");
  
--- 1800,1806 ----
  }
  
  static void
! _outEquivalenceMember(StringInfo str, const EquivalenceMember *node)
  {
  	WRITE_NODE_TYPE("EQUIVALENCEMEMBER");
  
*************** _outEquivalenceMember(StringInfo str, Eq
*** 1812,1818 ****
  }
  
  static void
! _outPathKey(StringInfo str, PathKey *node)
  {
  	WRITE_NODE_TYPE("PATHKEY");
  
--- 1812,1818 ----
  }
  
  static void
! _outPathKey(StringInfo str, const PathKey *node)
  {
  	WRITE_NODE_TYPE("PATHKEY");
  
*************** _outPathKey(StringInfo str, PathKey *nod
*** 1823,1829 ****
  }
  
  static void
! _outRestrictInfo(StringInfo str, RestrictInfo *node)
  {
  	WRITE_NODE_TYPE("RESTRICTINFO");
  
--- 1823,1829 ----
  }
  
  static void
! _outRestrictInfo(StringInfo str, const RestrictInfo *node)
  {
  	WRITE_NODE_TYPE("RESTRICTINFO");
  
*************** _outRestrictInfo(StringInfo str, Restric
*** 1852,1858 ****
  }
  
  static void
! _outInnerIndexscanInfo(StringInfo str, InnerIndexscanInfo *node)
  {
  	WRITE_NODE_TYPE("INNERINDEXSCANINFO");
  	WRITE_BITMAPSET_FIELD(other_relids);
--- 1852,1858 ----
  }
  
  static void
! _outInnerIndexscanInfo(StringInfo str, const InnerIndexscanInfo *node)
  {
  	WRITE_NODE_TYPE("INNERINDEXSCANINFO");
  	WRITE_BITMAPSET_FIELD(other_relids);
*************** _outInnerIndexscanInfo(StringInfo str, I
*** 1862,1868 ****
  }
  
  static void
! _outPlaceHolderVar(StringInfo str, PlaceHolderVar *node)
  {
  	WRITE_NODE_TYPE("PLACEHOLDERVAR");
  
--- 1862,1868 ----
  }
  
  static void
! _outPlaceHolderVar(StringInfo str, const PlaceHolderVar *node)
  {
  	WRITE_NODE_TYPE("PLACEHOLDERVAR");
  
*************** _outPlaceHolderVar(StringInfo str, Place
*** 1873,1879 ****
  }
  
  static void
! _outSpecialJoinInfo(StringInfo str, SpecialJoinInfo *node)
  {
  	WRITE_NODE_TYPE("SPECIALJOININFO");
  
--- 1873,1879 ----
  }
  
  static void
! _outSpecialJoinInfo(StringInfo str, const SpecialJoinInfo *node)
  {
  	WRITE_NODE_TYPE("SPECIALJOININFO");
  
*************** _outSpecialJoinInfo(StringInfo str, Spec
*** 1888,1894 ****
  }
  
  static void
! _outAppendRelInfo(StringInfo str, AppendRelInfo *node)
  {
  	WRITE_NODE_TYPE("APPENDRELINFO");
  
--- 1888,1894 ----
  }
  
  static void
! _outAppendRelInfo(StringInfo str, const AppendRelInfo *node)
  {
  	WRITE_NODE_TYPE("APPENDRELINFO");
  
*************** _outAppendRelInfo(StringInfo str, Append
*** 1901,1907 ****
  }
  
  static void
! _outPlaceHolderInfo(StringInfo str, PlaceHolderInfo *node)
  {
  	WRITE_NODE_TYPE("PLACEHOLDERINFO");
  
--- 1901,1907 ----
  }
  
  static void
! _outPlaceHolderInfo(StringInfo str, const PlaceHolderInfo *node)
  {
  	WRITE_NODE_TYPE("PLACEHOLDERINFO");
  
*************** _outPlaceHolderInfo(StringInfo str, Plac
*** 1914,1920 ****
  }
  
  static void
! _outMinMaxAggInfo(StringInfo str, MinMaxAggInfo *node)
  {
  	WRITE_NODE_TYPE("MINMAXAGGINFO");
  
--- 1914,1920 ----
  }
  
  static void
! _outMinMaxAggInfo(StringInfo str, const MinMaxAggInfo *node)
  {
  	WRITE_NODE_TYPE("MINMAXAGGINFO");
  
*************** _outMinMaxAggInfo(StringInfo str, MinMax
*** 1928,1934 ****
  }
  
  static void
! _outPlannerParamItem(StringInfo str, PlannerParamItem *node)
  {
  	WRITE_NODE_TYPE("PLANNERPARAMITEM");
  
--- 1928,1934 ----
  }
  
  static void
! _outPlannerParamItem(StringInfo str, const PlannerParamItem *node)
  {
  	WRITE_NODE_TYPE("PLANNERPARAMITEM");
  
*************** _outPlannerParamItem(StringInfo str, Pla
*** 1943,1949 ****
   *****************************************************************************/
  
  static void
! _outCreateStmt(StringInfo str, CreateStmt *node)
  {
  	WRITE_NODE_TYPE("CREATESTMT");
  
--- 1943,1949 ----
   *****************************************************************************/
  
  static void
! _outCreateStmt(StringInfo str, const CreateStmt *node)
  {
  	WRITE_NODE_TYPE("CREATESTMT");
  
*************** _outCreateStmt(StringInfo str, CreateStm
*** 1959,1965 ****
  }
  
  static void
! _outCreateForeignTableStmt(StringInfo str, CreateForeignTableStmt *node)
  {
  	WRITE_NODE_TYPE("CREATEFOREIGNTABLESTMT");
  
--- 1959,1965 ----
  }
  
  static void
! _outCreateForeignTableStmt(StringInfo str, const CreateForeignTableStmt *node)
  {
  	WRITE_NODE_TYPE("CREATEFOREIGNTABLESTMT");
  
*************** _outCreateForeignTableStmt(StringInfo st
*** 1970,1976 ****
  }
  
  static void
! _outIndexStmt(StringInfo str, IndexStmt *node)
  {
  	WRITE_NODE_TYPE("INDEXSTMT");
  
--- 1970,1976 ----
  }
  
  static void
! _outIndexStmt(StringInfo str, const IndexStmt *node)
  {
  	WRITE_NODE_TYPE("INDEXSTMT");
  
*************** _outIndexStmt(StringInfo str, IndexStmt
*** 1993,1999 ****
  }
  
  static void
! _outNotifyStmt(StringInfo str, NotifyStmt *node)
  {
  	WRITE_NODE_TYPE("NOTIFY");
  
--- 1993,1999 ----
  }
  
  static void
! _outNotifyStmt(StringInfo str, const NotifyStmt *node)
  {
  	WRITE_NODE_TYPE("NOTIFY");
  
*************** _outNotifyStmt(StringInfo str, NotifyStm
*** 2002,2008 ****
  }
  
  static void
! _outDeclareCursorStmt(StringInfo str, DeclareCursorStmt *node)
  {
  	WRITE_NODE_TYPE("DECLARECURSOR");
  
--- 2002,2008 ----
  }
  
  static void
! _outDeclareCursorStmt(StringInfo str, const DeclareCursorStmt *node)
  {
  	WRITE_NODE_TYPE("DECLARECURSOR");
  
*************** _outDeclareCursorStmt(StringInfo str, De
*** 2012,2018 ****
  }
  
  static void
! _outSelectStmt(StringInfo str, SelectStmt *node)
  {
  	WRITE_NODE_TYPE("SELECT");
  
--- 2012,2018 ----
  }
  
  static void
! _outSelectStmt(StringInfo str, const SelectStmt *node)
  {
  	WRITE_NODE_TYPE("SELECT");
  
*************** _outSelectStmt(StringInfo str, SelectStm
*** 2037,2043 ****
  }
  
  static void
! _outFuncCall(StringInfo str, FuncCall *node)
  {
  	WRITE_NODE_TYPE("FUNCCALL");
  
--- 2037,2043 ----
  }
  
  static void
! _outFuncCall(StringInfo str, const FuncCall *node)
  {
  	WRITE_NODE_TYPE("FUNCCALL");
  
*************** _outFuncCall(StringInfo str, FuncCall *n
*** 2052,2058 ****
  }
  
  static void
! _outDefElem(StringInfo str, DefElem *node)
  {
  	WRITE_NODE_TYPE("DEFELEM");
  
--- 2052,2058 ----
  }
  
  static void
! _outDefElem(StringInfo str, const DefElem *node)
  {
  	WRITE_NODE_TYPE("DEFELEM");
  
*************** _outDefElem(StringInfo str, DefElem *nod
*** 2063,2069 ****
  }
  
  static void
! _outInhRelation(StringInfo str, InhRelation *node)
  {
  	WRITE_NODE_TYPE("INHRELATION");
  
--- 2063,2069 ----
  }
  
  static void
! _outInhRelation(StringInfo str, const InhRelation *node)
  {
  	WRITE_NODE_TYPE("INHRELATION");
  
*************** _outInhRelation(StringInfo str, InhRelat
*** 2072,2078 ****
  }
  
  static void
! _outLockingClause(StringInfo str, LockingClause *node)
  {
  	WRITE_NODE_TYPE("LOCKINGCLAUSE");
  
--- 2072,2078 ----
  }
  
  static void
! _outLockingClause(StringInfo str, const LockingClause *node)
  {
  	WRITE_NODE_TYPE("LOCKINGCLAUSE");
  
*************** _outLockingClause(StringInfo str, Lockin
*** 2082,2088 ****
  }
  
  static void
! _outXmlSerialize(StringInfo str, XmlSerialize *node)
  {
  	WRITE_NODE_TYPE("XMLSERIALIZE");
  
--- 2082,2088 ----
  }
  
  static void
! _outXmlSerialize(StringInfo str, const XmlSerialize *node)
  {
  	WRITE_NODE_TYPE("XMLSERIALIZE");
  
*************** _outXmlSerialize(StringInfo str, XmlSeri
*** 2093,2099 ****
  }
  
  static void
! _outColumnDef(StringInfo str, ColumnDef *node)
  {
  	WRITE_NODE_TYPE("COLUMNDEF");
  
--- 2093,2099 ----
  }
  
  static void
! _outColumnDef(StringInfo str, const ColumnDef *node)
  {
  	WRITE_NODE_TYPE("COLUMNDEF");
  
*************** _outColumnDef(StringInfo str, ColumnDef
*** 2113,2119 ****
  }
  
  static void
! _outTypeName(StringInfo str, TypeName *node)
  {
  	WRITE_NODE_TYPE("TYPENAME");
  
--- 2113,2119 ----
  }
  
  static void
! _outTypeName(StringInfo str, const TypeName *node)
  {
  	WRITE_NODE_TYPE("TYPENAME");
  
*************** _outTypeName(StringInfo str, TypeName *n
*** 2128,2134 ****
  }
  
  static void
! _outTypeCast(StringInfo str, TypeCast *node)
  {
  	WRITE_NODE_TYPE("TYPECAST");
  
--- 2128,2134 ----
  }
  
  static void
! _outTypeCast(StringInfo str, const TypeCast *node)
  {
  	WRITE_NODE_TYPE("TYPECAST");
  
*************** _outTypeCast(StringInfo str, TypeCast *n
*** 2138,2144 ****
  }
  
  static void
! _outCollateClause(StringInfo str, CollateClause *node)
  {
  	WRITE_NODE_TYPE("COLLATECLAUSE");
  
--- 2138,2144 ----
  }
  
  static void
! _outCollateClause(StringInfo str, const CollateClause *node)
  {
  	WRITE_NODE_TYPE("COLLATECLAUSE");
  
*************** _outCollateClause(StringInfo str, Collat
*** 2148,2154 ****
  }
  
  static void
! _outIndexElem(StringInfo str, IndexElem *node)
  {
  	WRITE_NODE_TYPE("INDEXELEM");
  
--- 2148,2154 ----
  }
  
  static void
! _outIndexElem(StringInfo str, const IndexElem *node)
  {
  	WRITE_NODE_TYPE("INDEXELEM");
  
*************** _outIndexElem(StringInfo str, IndexElem
*** 2162,2168 ****
  }
  
  static void
! _outQuery(StringInfo str, Query *node)
  {
  	WRITE_NODE_TYPE("QUERY");
  
--- 2162,2168 ----
  }
  
  static void
! _outQuery(StringInfo str, const Query *node)
  {
  	WRITE_NODE_TYPE("QUERY");
  
*************** _outQuery(StringInfo str, Query *node)
*** 2222,2228 ****
  }
  
  static void
! _outSortGroupClause(StringInfo str, SortGroupClause *node)
  {
  	WRITE_NODE_TYPE("SORTGROUPCLAUSE");
  
--- 2222,2228 ----
  }
  
  static void
! _outSortGroupClause(StringInfo str, const SortGroupClause *node)
  {
  	WRITE_NODE_TYPE("SORTGROUPCLAUSE");
  
*************** _outSortGroupClause(StringInfo str, Sort
*** 2234,2240 ****
  }
  
  static void
! _outWindowClause(StringInfo str, WindowClause *node)
  {
  	WRITE_NODE_TYPE("WINDOWCLAUSE");
  
--- 2234,2240 ----
  }
  
  static void
! _outWindowClause(StringInfo str, const WindowClause *node)
  {
  	WRITE_NODE_TYPE("WINDOWCLAUSE");
  
*************** _outWindowClause(StringInfo str, WindowC
*** 2250,2256 ****
  }
  
  static void
! _outRowMarkClause(StringInfo str, RowMarkClause *node)
  {
  	WRITE_NODE_TYPE("ROWMARKCLAUSE");
  
--- 2250,2256 ----
  }
  
  static void
! _outRowMarkClause(StringInfo str, const RowMarkClause *node)
  {
  	WRITE_NODE_TYPE("ROWMARKCLAUSE");
  
*************** _outRowMarkClause(StringInfo str, RowMar
*** 2261,2267 ****
  }
  
  static void
! _outWithClause(StringInfo str, WithClause *node)
  {
  	WRITE_NODE_TYPE("WITHCLAUSE");
  
--- 2261,2267 ----
  }
  
  static void
! _outWithClause(StringInfo str, const WithClause *node)
  {
  	WRITE_NODE_TYPE("WITHCLAUSE");
  
*************** _outWithClause(StringInfo str, WithClaus
*** 2271,2277 ****
  }
  
  static void
! _outCommonTableExpr(StringInfo str, CommonTableExpr *node)
  {
  	WRITE_NODE_TYPE("COMMONTABLEEXPR");
  
--- 2271,2277 ----
  }
  
  static void
! _outCommonTableExpr(StringInfo str, const CommonTableExpr *node)
  {
  	WRITE_NODE_TYPE("COMMONTABLEEXPR");
  
*************** _outCommonTableExpr(StringInfo str, Comm
*** 2288,2294 ****
  }
  
  static void
! _outSetOperationStmt(StringInfo str, SetOperationStmt *node)
  {
  	WRITE_NODE_TYPE("SETOPERATIONSTMT");
  
--- 2288,2294 ----
  }
  
  static void
! _outSetOperationStmt(StringInfo str, const SetOperationStmt *node)
  {
  	WRITE_NODE_TYPE("SETOPERATIONSTMT");
  
*************** _outSetOperationStmt(StringInfo str, Set
*** 2303,2309 ****
  }
  
  static void
! _outRangeTblEntry(StringInfo str, RangeTblEntry *node)
  {
  	WRITE_NODE_TYPE("RTE");
  
--- 2303,2309 ----
  }
  
  static void
! _outRangeTblEntry(StringInfo str, const RangeTblEntry *node)
  {
  	WRITE_NODE_TYPE("RTE");
  
*************** _outRangeTblEntry(StringInfo str, RangeT
*** 2357,2363 ****
  }
  
  static void
! _outAExpr(StringInfo str, A_Expr *node)
  {
  	WRITE_NODE_TYPE("AEXPR");
  
--- 2357,2363 ----
  }
  
  static void
! _outAExpr(StringInfo str, const A_Expr *node)
  {
  	WRITE_NODE_TYPE("AEXPR");
  
*************** _outAExpr(StringInfo str, A_Expr *node)
*** 2413,2419 ****
  }
  
  static void
! _outValue(StringInfo str, Value *value)
  {
  	switch (value->type)
  	{
--- 2413,2419 ----
  }
  
  static void
! _outValue(StringInfo str, const Value *value)
  {
  	switch (value->type)
  	{
*************** _outValue(StringInfo str, Value *value)
*** 2448,2454 ****
  }
  
  static void
! _outColumnRef(StringInfo str, ColumnRef *node)
  {
  	WRITE_NODE_TYPE("COLUMNREF");
  
--- 2448,2454 ----
  }
  
  static void
! _outColumnRef(StringInfo str, const ColumnRef *node)
  {
  	WRITE_NODE_TYPE("COLUMNREF");
  
*************** _outColumnRef(StringInfo str, ColumnRef
*** 2457,2463 ****
  }
  
  static void
! _outParamRef(StringInfo str, ParamRef *node)
  {
  	WRITE_NODE_TYPE("PARAMREF");
  
--- 2457,2463 ----
  }
  
  static void
! _outParamRef(StringInfo str, const ParamRef *node)
  {
  	WRITE_NODE_TYPE("PARAMREF");
  
*************** _outParamRef(StringInfo str, ParamRef *n
*** 2466,2472 ****
  }
  
  static void
! _outAConst(StringInfo str, A_Const *node)
  {
  	WRITE_NODE_TYPE("A_CONST");
  
--- 2466,2472 ----
  }
  
  static void
! _outAConst(StringInfo str, const A_Const *node)
  {
  	WRITE_NODE_TYPE("A_CONST");
  
*************** _outAConst(StringInfo str, A_Const *node
*** 2476,2488 ****
  }
  
  static void
! _outA_Star(StringInfo str, A_Star *node)
  {
  	WRITE_NODE_TYPE("A_STAR");
  }
  
  static void
! _outA_Indices(StringInfo str, A_Indices *node)
  {
  	WRITE_NODE_TYPE("A_INDICES");
  
--- 2476,2488 ----
  }
  
  static void
! _outA_Star(StringInfo str, const A_Star *node)
  {
  	WRITE_NODE_TYPE("A_STAR");
  }
  
  static void
! _outA_Indices(StringInfo str, const A_Indices *node)
  {
  	WRITE_NODE_TYPE("A_INDICES");
  
*************** _outA_Indices(StringInfo str, A_Indices
*** 2491,2497 ****
  }
  
  static void
! _outA_Indirection(StringInfo str, A_Indirection *node)
  {
  	WRITE_NODE_TYPE("A_INDIRECTION");
  
--- 2491,2497 ----
  }
  
  static void
! _outA_Indirection(StringInfo str, const A_Indirection *node)
  {
  	WRITE_NODE_TYPE("A_INDIRECTION");
  
*************** _outA_Indirection(StringInfo str, A_Indi
*** 2500,2506 ****
  }
  
  static void
! _outA_ArrayExpr(StringInfo str, A_ArrayExpr *node)
  {
  	WRITE_NODE_TYPE("A_ARRAYEXPR");
  
--- 2500,2506 ----
  }
  
  static void
! _outA_ArrayExpr(StringInfo str, const A_ArrayExpr *node)
  {
  	WRITE_NODE_TYPE("A_ARRAYEXPR");
  
*************** _outA_ArrayExpr(StringInfo str, A_ArrayE
*** 2509,2515 ****
  }
  
  static void
! _outResTarget(StringInfo str, ResTarget *node)
  {
  	WRITE_NODE_TYPE("RESTARGET");
  
--- 2509,2515 ----
  }
  
  static void
! _outResTarget(StringInfo str, const ResTarget *node)
  {
  	WRITE_NODE_TYPE("RESTARGET");
  
*************** _outResTarget(StringInfo str, ResTarget
*** 2520,2526 ****
  }
  
  static void
! _outSortBy(StringInfo str, SortBy *node)
  {
  	WRITE_NODE_TYPE("SORTBY");
  
--- 2520,2526 ----
  }
  
  static void
! _outSortBy(StringInfo str, const SortBy *node)
  {
  	WRITE_NODE_TYPE("SORTBY");
  
*************** _outSortBy(StringInfo str, SortBy *node)
*** 2532,2538 ****
  }
  
  static void
! _outWindowDef(StringInfo str, WindowDef *node)
  {
  	WRITE_NODE_TYPE("WINDOWDEF");
  
--- 2532,2538 ----
  }
  
  static void
! _outWindowDef(StringInfo str, const WindowDef *node)
  {
  	WRITE_NODE_TYPE("WINDOWDEF");
  
*************** _outWindowDef(StringInfo str, WindowDef
*** 2547,2553 ****
  }
  
  static void
! _outRangeSubselect(StringInfo str, RangeSubselect *node)
  {
  	WRITE_NODE_TYPE("RANGESUBSELECT");
  
--- 2547,2553 ----
  }
  
  static void
! _outRangeSubselect(StringInfo str, const RangeSubselect *node)
  {
  	WRITE_NODE_TYPE("RANGESUBSELECT");
  
*************** _outRangeSubselect(StringInfo str, Range
*** 2556,2562 ****
  }
  
  static void
! _outRangeFunction(StringInfo str, RangeFunction *node)
  {
  	WRITE_NODE_TYPE("RANGEFUNCTION");
  
--- 2556,2562 ----
  }
  
  static void
! _outRangeFunction(StringInfo str, const RangeFunction *node)
  {
  	WRITE_NODE_TYPE("RANGEFUNCTION");
  
*************** _outRangeFunction(StringInfo str, RangeF
*** 2566,2572 ****
  }
  
  static void
! _outConstraint(StringInfo str, Constraint *node)
  {
  	WRITE_NODE_TYPE("CONSTRAINT");
  
--- 2566,2572 ----
  }
  
  static void
! _outConstraint(StringInfo str, const Constraint *node)
  {
  	WRITE_NODE_TYPE("CONSTRAINT");
  
*************** _outConstraint(StringInfo str, Constrain
*** 2667,2673 ****
   *	  converts a Node into ascii string and append it to 'str'
   */
  static void
! _outNode(StringInfo str, void *obj)
  {
  	if (obj == NULL)
  		appendStringInfo(str, "<>");
--- 2667,2673 ----
   *	  converts a Node into ascii string and append it to 'str'
   */
  static void
! _outNode(StringInfo str, const void *obj)
  {
  	if (obj == NULL)
  		appendStringInfo(str, "<>");
*************** _outNode(StringInfo str, void *obj)
*** 3167,3173 ****
   *	   returns the ascii representation of the Node as a palloc'd string
   */
  char *
! nodeToString(void *obj)
  {
  	StringInfoData str;
  
--- 3167,3173 ----
   *	   returns the ascii representation of the Node as a palloc'd string
   */
  char *
! nodeToString(const void *obj)
  {
  	StringInfoData str;
  
diff --git a/src/backend/nodes/print.c b/src/backend/nodes/print.c
new file mode 100644
index 5fe4fd5..e4191a3
*** a/src/backend/nodes/print.c
--- b/src/backend/nodes/print.c
***************
*** 31,37 ****
   *	  print contents of Node to stdout
   */
  void
! print(void *obj)
  {
  	char	   *s;
  	char	   *f;
--- 31,37 ----
   *	  print contents of Node to stdout
   */
  void
! print(const void *obj)
  {
  	char	   *s;
  	char	   *f;
*************** print(void *obj)
*** 49,55 ****
   *	  pretty-print contents of Node to stdout
   */
  void
! pprint(void *obj)
  {
  	char	   *s;
  	char	   *f;
--- 49,55 ----
   *	  pretty-print contents of Node to stdout
   */
  void
! pprint(const void *obj)
  {
  	char	   *s;
  	char	   *f;
*************** pprint(void *obj)
*** 67,73 ****
   *	  send pretty-printed contents of Node to postmaster log
   */
  void
! elog_node_display(int lev, const char *title, void *obj, bool pretty)
  {
  	char	   *s;
  	char	   *f;
--- 67,73 ----
   *	  send pretty-printed contents of Node to postmaster log
   */
  void
! elog_node_display(int lev, const char *title, const void *obj, bool pretty)
  {
  	char	   *s;
  	char	   *f;
*************** pretty_format_node_dump(const char *dump
*** 249,262 ****
   *	  print contents of range table
   */
  void
! print_rt(List *rtable)
  {
! 	ListCell   *l;
  	int			i = 1;
  
  	printf("resno\trefname  \trelid\tinFromCl\n");
  	printf("-----\t---------\t-----\t--------\n");
! 	foreach(l, rtable)
  	{
  		RangeTblEntry *rte = lfirst(l);
  
--- 249,262 ----
   *	  print contents of range table
   */
  void
! print_rt(const List *rtable)
  {
! 	const ListCell   *l;
  	int			i = 1;
  
  	printf("resno\trefname  \trelid\tinFromCl\n");
  	printf("-----\t---------\t-----\t--------\n");
! 	foreach_const(l, rtable)
  	{
  		RangeTblEntry *rte = lfirst(l);
  
*************** print_rt(List *rtable)
*** 304,310 ****
   *	  print an expression
   */
  void
! print_expr(Node *expr, List *rtable)
  {
  	if (expr == NULL)
  	{
--- 304,310 ----
   *	  print an expression
   */
  void
! print_expr(const Node *expr, const List *rtable)
  {
  	if (expr == NULL)
  	{
*************** print_expr(Node *expr, List *rtable)
*** 410,421 ****
   *	  pathkeys list of PathKeys
   */
  void
! print_pathkeys(List *pathkeys, List *rtable)
  {
! 	ListCell   *i;
  
  	printf("(");
! 	foreach(i, pathkeys)
  	{
  		PathKey    *pathkey = (PathKey *) lfirst(i);
  		EquivalenceClass *eclass;
--- 410,421 ----
   *	  pathkeys list of PathKeys
   */
  void
! print_pathkeys(const List *pathkeys, const List *rtable)
  {
! 	const ListCell   *i;
  
  	printf("(");
! 	foreach_const(i, pathkeys)
  	{
  		PathKey    *pathkey = (PathKey *) lfirst(i);
  		EquivalenceClass *eclass;
*************** print_pathkeys(List *pathkeys, List *rta
*** 450,461 ****
   *	  print targetlist in a more legible way.
   */
  void
! print_tl(List *tlist, List *rtable)
  {
! 	ListCell   *tl;
  
  	printf("(\n");
! 	foreach(tl, tlist)
  	{
  		TargetEntry *tle = (TargetEntry *) lfirst(tl);
  
--- 450,461 ----
   *	  print targetlist in a more legible way.
   */
  void
! print_tl(const List *tlist, const List *rtable)
  {
! 	const ListCell   *tl;
  
  	printf("(\n");
! 	foreach_const(tl, tlist)
  	{
  		TargetEntry *tle = (TargetEntry *) lfirst(tl);
  
diff --git a/src/include/nodes/nodeFuncs.h b/src/include/nodes/nodeFuncs.h
new file mode 100644
index 591f2a9..4980dd8
*** a/src/include/nodes/nodeFuncs.h
--- b/src/include/nodes/nodeFuncs.h
***************
*** 26,42 ****
  #define QTW_DONT_COPY_QUERY			0x20		/* do not copy top Query */
  
  
! extern Oid	exprType(Node *expr);
! extern int32 exprTypmod(Node *expr);
! extern bool exprIsLengthCoercion(Node *expr, int32 *coercedTypmod);
  extern bool expression_returns_set(Node *clause);
  
! extern Oid	exprCollation(Node *expr);
! extern Oid	exprInputCollation(Node *expr);
  extern void exprSetCollation(Node *expr, Oid collation);
  extern void exprSetInputCollation(Node *expr, Oid inputcollation);
  
! extern int	exprLocation(Node *expr);
  
  extern bool expression_tree_walker(Node *node, bool (*walker) (),
  											   void *context);
--- 26,42 ----
  #define QTW_DONT_COPY_QUERY			0x20		/* do not copy top Query */
  
  
! extern Oid	exprType(const Node *expr);
! extern int32 exprTypmod(const Node *expr);
! extern bool exprIsLengthCoercion(const Node *expr, int32 *coercedTypmod);
  extern bool expression_returns_set(Node *clause);
  
! extern Oid	exprCollation(const Node *expr);
! extern Oid	exprInputCollation(const Node *expr);
  extern void exprSetCollation(Node *expr, Oid collation);
  extern void exprSetInputCollation(Node *expr, Oid inputcollation);
  
! extern int	exprLocation(const Node *expr);
  
  extern bool expression_tree_walker(Node *node, bool (*walker) (),
  											   void *context);
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
new file mode 100644
index 824d8b5..898caf8
*** a/src/include/nodes/nodes.h
--- b/src/include/nodes/nodes.h
*************** extern PGDLLIMPORT Node *newNodeMacroHol
*** 495,501 ****
  /*
   * nodes/{outfuncs.c,print.c}
   */
! extern char *nodeToString(void *obj);
  
  /*
   * nodes/{readfuncs.c,read.c}
--- 495,501 ----
  /*
   * nodes/{outfuncs.c,print.c}
   */
! extern char *nodeToString(const void *obj);
  
  /*
   * nodes/{readfuncs.c,read.c}
*************** extern void *stringToNode(char *str);
*** 505,516 ****
  /*
   * nodes/copyfuncs.c
   */
! extern void *copyObject(void *obj);
  
  /*
   * nodes/equalfuncs.c
   */
! extern bool equal(void *a, void *b);
  
  
  /*
--- 505,516 ----
  /*
   * nodes/copyfuncs.c
   */
! extern void *copyObject(const void *obj);
  
  /*
   * nodes/equalfuncs.c
   */
! extern bool equal(const void *a, const void *b);
  
  
  /*
diff --git a/src/include/nodes/pg_list.h b/src/include/nodes/pg_list.h
new file mode 100644
index 38b94aa..dd4639f
*** a/src/include/nodes/pg_list.h
--- b/src/include/nodes/pg_list.h
*************** list_head(List *l)
*** 82,87 ****
--- 82,93 ----
  	return l ? l->head : NULL;
  }
  
+ static inline const ListCell *
+ list_head_const(const List *l)
+ {
+ 	return l ? l->head : NULL;
+ }
+ 
  static inline ListCell *
  list_tail(List *l)
  {
*************** list_tail(List *l)
*** 89,103 ****
  }
  
  static inline int
! list_length(List *l)
  {
  	return l ? l->length : 0;
  }
  #else
  
  extern ListCell *list_head(List *l);
  extern ListCell *list_tail(List *l);
! extern int	list_length(List *l);
  #endif   /* USE_INLINE */
  
  /*
--- 95,110 ----
  }
  
  static inline int
! list_length(const List *l)
  {
  	return l ? l->length : 0;
  }
  #else
  
  extern ListCell *list_head(List *l);
+ extern ListCell *list_head_const(const List *l);
  extern ListCell *list_tail(List *l);
! extern int	list_length(const List *l);
  #endif   /* USE_INLINE */
  
  /*
*************** extern int	list_length(List *l);
*** 162,167 ****
--- 169,181 ----
  	for ((cell) = list_head(l); (cell) != NULL; (cell) = lnext(cell))
  
  /*
+  * foreach -
+  *	  const version of above
+  */
+ #define foreach_const(cell, l)	\
+ 	for ((cell) = list_head_const(l); (cell) != NULL; (cell) = lnext(cell))
+ 
+ /*
   * for_each_cell -
   *	  a convenience macro which loops through a list starting from a
   *	  specified cell
*************** extern int	list_length(List *l);
*** 183,188 ****
--- 197,211 ----
  		 (cell1) = lnext(cell1), (cell2) = lnext(cell2))
  
  /*
+  * forboth_const
+  *	  a const version of forboth
+  */
+ #define forboth_const(cell1, list1, cell2, list2)							\
+ 	for ((cell1) = list_head_const(list1), (cell2) = list_head_const(list2);	\
+ 		 (cell1) != NULL && (cell2) != NULL;						\
+ 		 (cell1) = lnext(cell1), (cell2) = lnext(cell2))
+ 
+ /*
   * forthree -
   *	  the same for three lists
   */
*************** extern List *lcons_oid(Oid datum, List *
*** 206,219 ****
  extern List *list_concat(List *list1, List *list2);
  extern List *list_truncate(List *list, int new_size);
  
! extern void *list_nth(List *list, int n);
! extern int	list_nth_int(List *list, int n);
! extern Oid	list_nth_oid(List *list, int n);
  
! extern bool list_member(List *list, void *datum);
! extern bool list_member_ptr(List *list, void *datum);
! extern bool list_member_int(List *list, int datum);
! extern bool list_member_oid(List *list, Oid datum);
  
  extern List *list_delete(List *list, void *datum);
  extern List *list_delete_ptr(List *list, void *datum);
--- 229,242 ----
  extern List *list_concat(List *list1, List *list2);
  extern List *list_truncate(List *list, int new_size);
  
! extern void *list_nth(const List *list, int n);
! extern int	list_nth_int(const List *list, int n);
! extern Oid	list_nth_oid(const List *list, int n);
  
! extern bool list_member(const List *list, const void *datum);
! extern bool list_member_ptr(const List *list, const void *datum);
! extern bool list_member_int(const List *list, int datum);
! extern bool list_member_oid(const List *list, Oid datum);
  
  extern List *list_delete(List *list, void *datum);
  extern List *list_delete_ptr(List *list, void *datum);
*************** extern List *list_delete_oid(List *list,
*** 222,240 ****
  extern List *list_delete_first(List *list);
  extern List *list_delete_cell(List *list, ListCell *cell, ListCell *prev);
  
! extern List *list_union(List *list1, List *list2);
! extern List *list_union_ptr(List *list1, List *list2);
! extern List *list_union_int(List *list1, List *list2);
! extern List *list_union_oid(List *list1, List *list2);
  
! extern List *list_intersection(List *list1, List *list2);
  
  /* currently, there's no need for list_intersection_int etc */
  
! extern List *list_difference(List *list1, List *list2);
! extern List *list_difference_ptr(List *list1, List *list2);
! extern List *list_difference_int(List *list1, List *list2);
! extern List *list_difference_oid(List *list1, List *list2);
  
  extern List *list_append_unique(List *list, void *datum);
  extern List *list_append_unique_ptr(List *list, void *datum);
--- 245,263 ----
  extern List *list_delete_first(List *list);
  extern List *list_delete_cell(List *list, ListCell *cell, ListCell *prev);
  
! extern List *list_union(const List *list1, const List *list2);
! extern List *list_union_ptr(const List *list1, const List *list2);
! extern List *list_union_int(const List *list1, const List *list2);
! extern List *list_union_oid(const List *list1, const List *list2);
  
! extern List *list_intersection(const List *list1, const List *list2);
  
  /* currently, there's no need for list_intersection_int etc */
  
! extern List *list_difference(const List *list1, const List *list2);
! extern List *list_difference_ptr(const List *list1, const List *list2);
! extern List *list_difference_int(const List *list1, const List *list2);
! extern List *list_difference_oid(const List *list1, const List *list2);
  
  extern List *list_append_unique(List *list, void *datum);
  extern List *list_append_unique_ptr(List *list, void *datum);
*************** extern List *list_concat_unique_oid(List
*** 249,256 ****
  extern void list_free(List *list);
  extern void list_free_deep(List *list);
  
! extern List *list_copy(List *list);
! extern List *list_copy_tail(List *list, int nskip);
  
  /*
   * To ease migration to the new list API, a set of compatibility
--- 272,279 ----
  extern void list_free(List *list);
  extern void list_free_deep(List *list);
  
! extern List *list_copy(const List *list);
! extern List *list_copy_tail(const List *list, int nskip);
  
  /*
   * To ease migration to the new list API, a set of compatibility
diff --git a/src/include/nodes/print.h b/src/include/nodes/print.h
new file mode 100644
index 8bac7b0..f4e0ff3
*** a/src/include/nodes/print.h
--- b/src/include/nodes/print.h
***************
*** 19,34 ****
  
  #define nodeDisplay(x)		pprint(x)
  
! extern void print(void *obj);
! extern void pprint(void *obj);
  extern void elog_node_display(int lev, const char *title,
! 				  void *obj, bool pretty);
  extern char *format_node_dump(const char *dump);
  extern char *pretty_format_node_dump(const char *dump);
! extern void print_rt(List *rtable);
! extern void print_expr(Node *expr, List *rtable);
! extern void print_pathkeys(List *pathkeys, List *rtable);
! extern void print_tl(List *tlist, List *rtable);
  extern void print_slot(TupleTableSlot *slot);
  
  #endif   /* PRINT_H */
--- 19,34 ----
  
  #define nodeDisplay(x)		pprint(x)
  
! extern void print(const void *obj);
! extern void pprint(const void *obj);
  extern void elog_node_display(int lev, const char *title,
! 				  const void *obj, bool pretty);
  extern char *format_node_dump(const char *dump);
  extern char *pretty_format_node_dump(const char *dump);
! extern void print_rt(const List *rtable);
! extern void print_expr(const Node *expr, const List *rtable);
! extern void print_pathkeys(const List *pathkeys, const List *rtable);
! extern void print_tl(const List *tlist, const List *rtable);
  extern void print_slot(TupleTableSlot *slot);
  
  #endif   /* PRINT_H */
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Thomas Munro (#1)
Re: const correctness

Thomas Munro <munro@ip9.org> writes:

I am a long time user and fan of PostgreSQL and have built various
projects large and small on every major release since 6.5. Recently
I decided to try doing something more with the source than just
compiling it, and spent some time 'constifying' some parts of the code
as an exercise (this is an item I saw on the wiki to-do list, and I
figured it might provide me with an educational traversal of the
source tree).

There was some discussion of this just a couple days ago in connection
with a patch Peter offered ... did you see that?
http://archives.postgresql.org/pgsql-hackers/2011-11/msg00314.php

Perhaps there should be a few more 'XXX_const' accessor function
variants, for example list_nth_const,

This is exactly what was bothering Robert and me about Peter's patch.
If you go down this road you soon start needing duplicate functions
for no other reason than that one takes/returns "const" and one doesn't.
That might be acceptable on a very small scale, but any serious attempt
to const-ify the PG code is going to require it on a very large scale.
The maintenance costs of duplicate code are significant (not even
considering whether there's a performance hit), and it just doesn't seem
likely to be repaid in easier or safer development. Offhand I cannot
remember the last bug in PG which would have been prevented by better
const-ification.

So I'm starting to feel that this idea is a dead end, and we should take
it off the TODO list.

[1] For functions built on top of expression_tree_walker (like
expression_returns_set), it seems that it and therefore they can be
modified to work entirely on pointers to const Node without any
complaints from GCC at least, but only because the walker function
pointer is of type bool (*)() (that is, pointer to a function with
unspecified arguments, thereby side-stepping all static type
checking). But I guess it would only be honest to change the
signature of expression_tree_walker to take const Node * if the type
of the walker function pointer were changed to bool (*)(const Node *,
void *), and the walker mechanism were declared in the comments not to
permit any mutation at all (rather than the weaker restriction that
routines can modify nodes in-place but not add/delete/replace nodes).

Yeah, that was an alternative I considered when designing the tree
walker infrastructure. However, if we force walker functions to be
declared just like that, we lose rather than gain type safety. In the
typical usage, there's a startup function that sets up a context
structure and calls the walker function directly. As things stand,
that call is type-checked: you pass the wrong kind of context object,
you'll get a bleat. Changing the walkers to use void * would remove
that check, while adding a need for explicit casting of the argument
inside the walkers, and gain nothing of value.

As for the question of whether we should insist that walkers never
modify the tree ... yeah, we could, but there are enough instances
of nominal walkers that do modify the tree to make me not enthused
about it. We would have to change each one of those walkers to
instead create a new copy of the tree, with attendant memory consumption
and palloc overhead. It would almost certainly be a noticeable
performance hit, and the benefit seems debatable at best.

There would, I think, be both performance and safety benefits from
getting certain entire modules to not scribble on their input trees;
especially the planner. But that is a high-level consideration and
I'm not sure that const-decoration would really do much to help us
achieve it.

regards, tom lane

#3Peter Geoghegan
peter@2ndquadrant.com
In reply to: Tom Lane (#2)
Re: const correctness

On 9 November 2011 15:24, Tom Lane <tgl@sss.pgh.pa.us> wrote:.

If you go down this road you soon start needing duplicate functions
for no other reason than that one takes/returns "const" and one doesn't.

Why would you have to do that?

To my mind, the fact that const "spreads" is a feature, not a deficiency.

--
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services

#4Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Tom Lane (#2)
Re: const correctness

Tom Lane <tgl@sss.pgh.pa.us> wrote:

Perhaps there should be a few more 'XXX_const' accessor function
variants, for example list_nth_const,

This is exactly what was bothering Robert and me about Peter's
patch.If you go down this road you soon start needing duplicate
functions for no other reason than that one takes/returns "const"
and one doesn't.

What about existing functions which are not intended to modify their
inputs, don't actually do so, and can be marked to indicate that
just by adding "const" to the current declarations? Aside from any
possible value in code optimization by the compiler, I find it helps
me understand unfamiliar code more quickly, by making the contract
of the API more explicit in the declaration. Perhaps it's worth
going after the low-hanging fruit?

-Kevin

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Geoghegan (#3)
Re: const correctness

Peter Geoghegan <peter@2ndquadrant.com> writes:

On 9 November 2011 15:24, Tom Lane <tgl@sss.pgh.pa.us> wrote:.

If you go down this road you soon start needing duplicate functions
for no other reason than that one takes/returns "const" and one doesn't.

Why would you have to do that?

list_nth is an example. Now admittedly you can hack it, in the same
spirit as the C library functions that are declared to take const
pointers and return non-const pointers to the very same data; but that
hardly satisfies anyone's idea of const cleanliness. In particular
it doesn't fix what Peter E. was on about, which was getting rid of
cast-away-const warnings, since such a function will have to do that
internally.

regards, tom lane

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kevin Grittner (#4)
Re: const correctness

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:

Tom Lane <tgl@sss.pgh.pa.us> wrote:

This is exactly what was bothering Robert and me about Peter's
patch.If you go down this road you soon start needing duplicate
functions for no other reason than that one takes/returns "const"
and one doesn't.

What about existing functions which are not intended to modify their
inputs, don't actually do so, and can be marked to indicate that
just by adding "const" to the current declarations? Aside from any
possible value in code optimization by the compiler, I find it helps
me understand unfamiliar code more quickly, by making the contract
of the API more explicit in the declaration. Perhaps it's worth
going after the low-hanging fruit?

I have no objection to const-ifying anything that can be done with one
or two localized changes. The difficulty comes in when you try to make
core infrastructure like expression_tree_walker do it. (And of course
the problem then is that there are not so many functions that don't use
any of that core infrastructure, so if you try to const-ify them you end
up having to cast away const internally; which does not seem like a net
advance to me.)

regards, tom lane

#7Robert Haas
robertmhaas@gmail.com
In reply to: Kevin Grittner (#4)
Re: const correctness

On Wed, Nov 9, 2011 at 10:45 AM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:

Tom Lane <tgl@sss.pgh.pa.us> wrote:

 Perhaps there should be a few more 'XXX_const' accessor function
variants, for example list_nth_const,

This is exactly what was bothering Robert and me about Peter's
patch.If you go down this road you soon start needing duplicate
functions for no other reason than that one takes/returns "const"
and one doesn't.

What about existing functions which are not intended to modify their
inputs, don't actually do so, and can be marked to indicate that
just by adding "const" to the current declarations?  Aside from any
possible value in code optimization by the compiler, I find it helps
me understand unfamiliar code more quickly, by making the contract
of the API more explicit in the declaration.  Perhaps it's worth
going after the low-hanging fruit?

My feeling is that there's no harm (and possibly some benefit) in
const-ifying functions that do very simple things. But as soon as you
get to functions where the const-ness starts growing all over the
system like kudzu, it's time to run away screaming. Moreover, I don't
really want to see us spend a lot of time figuring out exactly what we
can or can't const-ify. I feel as virtuous as the next guy when I
mark something const, but my experience over the years is that it
rapidly turns a huge amount of work. That by itself is not enough
reason not to do it; many worthwhile things are hard. The kicker is
that it's a lot of work for an unbelievably tiny benefit, sometimes a
negative benefit.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#8Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Robert Haas (#7)
Re: const correctness

Robert Haas <robertmhaas@gmail.com> wrote:

My feeling is that there's no harm (and possibly some benefit) in
const-ifying functions that do very simple things. But as soon as
you get to functions where the const-ness starts growing all over
the system like kudzu, it's time to run away screaming.

The patch attached to Thomas's original post is an example of what I
consider low-hanging fruit worth going after. It applies cleanly,
causes no new warnings, and adds no new objects -- it just clarifies
the API. (It was in checking for new warnings that I found the one
I mentioned in the other post.)

Moreover, I don't really want to see us spend a lot of time
figuring out exactly what we can or can't const-ify.

Well, nobody is asking you to do so. Thomas said that he was
looking for something to do which would lead him through the code so
he could learn it.

I feel as virtuous as the next guy when I mark something const,
but my experience over the years is that it rapidly turns a huge
amount of work. That by itself is not enough reason not to do it;
many worthwhile things are hard.

If Thomas wants to do this as an exercise in learning PostgreSQL
code, it seems like a win/win to me. We get minor clarifications of
our APIs and another person with some understanding of the code
base.

The kicker is that it's a lot of work for an unbelievably tiny
benefit, sometimes a negative benefit.

Assuming duplicate declarations with and without const are off the
table, where do you see the negative?

-Kevin

#9Robert Haas
robertmhaas@gmail.com
In reply to: Kevin Grittner (#8)
Re: const correctness

On Wed, Nov 9, 2011 at 11:28 AM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:

The kicker is that it's a lot of work for an unbelievably tiny
benefit, sometimes a negative benefit.

Assuming duplicate declarations with and without const are off the
table, where do you see the negative?

If it doesn't uglify the code, there aren't any negatives. I'm just
saying we may not be able to get very far before we run up against
that issue. For example, in the OP, Thomas wrote:

7. I made a list_head_const function, which can be used used to get a
pointer to the head cell when you have a pointer to const List; I
needed that so I could make foreach_const and forboth_const; they
were needed to be able to make list_member, _equalList and various
other list-visiting functions work with const List objects.

So that's already duplicating list_head, foreach, and forboth.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#10Greg Jaskiewicz
gj@pointblue.com.pl
In reply to: Peter Geoghegan (#3)
Re: const correctness

On 9 Nov 2011, at 15:33, Peter Geoghegan wrote:

On 9 November 2011 15:24, Tom Lane <tgl@sss.pgh.pa.us> wrote:.

If you go down this road you soon start needing duplicate functions
for no other reason than that one takes/returns "const" and one doesn't.

Why would you have to do that?

To my mind, the fact that const "spreads" is a feature, not a deficiency.

+1.

I would go as far as compiling most of my stuff using C++ compiler, because it is much more strict about const-correctness. (but then I have rule about making source files small).
C compilers (and standard) allows you to do silly things like :

char *foo = "barbar";
foo[1] = '4';

Not an option in C++ and if you use const correctness.
I had few bugs like that in the past, where pointer was passed around (in C code), and one of the pointers was pointing to const string - but since compiler was fine with it... You know what happened.
And that was on an embedded platform which made it even harder to trace down.

The point is, const correctness is deeply unappreciated.
Added bonus is the fact that compiler can make extra optimisations based on the const keyword. Kind of like read-only transactions in the database.

Probably the most extreme and tedious way of introducing full const correctness in PostgreSQL would be to rename all files to .cpp, and let c++ compiler tell you what you need to fix.

#11Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Robert Haas (#9)
1 attachment(s)
Re: const correctness

Robert Haas <robertmhaas@gmail.com> wrote:

If it doesn't uglify the code, there aren't any negatives. I'm
just saying we may not be able to get very far before we run up
against that issue. For example, in the OP, Thomas wrote:

7. I made a list_head_const function, which can be used used to
get a pointer to the head cell when you have a pointer to
const List; I needed that so I could make foreach_const and
forboth_const; they were needed to be able to make
list_member, _equalList and various other list-visiting
functions work with const List objects.

So that's already duplicating list_head, foreach, and forboth.

OK, I failed to pick up on that properly. With that stripped out,
you get the attached patch, which does nothing but add "const" to
661 lines. It still applies cleanly, builds with no warnings, and
passes regression tests.

It is a bit disappointing that without creating two flavors of the
list_head function and the foreach and forboth macros, there are a
number of functions which aren't intended to modify their inputs
which can't be declared with const parameters; but unless there is
some demonstrable performance benefit from those changes, I agree
that the argument for having the two flavors is thin.

-Kevin

Attachments:

constify-1a.patchtext/plain; name=constify-1a.patchDownload
*** a/src/backend/nodes/copyfuncs.c
--- b/src/backend/nodes/copyfuncs.c
***************
*** 72,78 ****
   * _copyPlannedStmt
   */
  static PlannedStmt *
! _copyPlannedStmt(PlannedStmt *from)
  {
  	PlannedStmt *newnode = makeNode(PlannedStmt);
  
--- 72,78 ----
   * _copyPlannedStmt
   */
  static PlannedStmt *
! _copyPlannedStmt(const PlannedStmt *from)
  {
  	PlannedStmt *newnode = makeNode(PlannedStmt);
  
***************
*** 103,109 **** _copyPlannedStmt(PlannedStmt *from)
   *		all the copy functions for classes which inherit from Plan.
   */
  static void
! CopyPlanFields(Plan *from, Plan *newnode)
  {
  	COPY_SCALAR_FIELD(startup_cost);
  	COPY_SCALAR_FIELD(total_cost);
--- 103,109 ----
   *		all the copy functions for classes which inherit from Plan.
   */
  static void
! CopyPlanFields(const Plan *from, Plan *newnode)
  {
  	COPY_SCALAR_FIELD(startup_cost);
  	COPY_SCALAR_FIELD(total_cost);
***************
*** 122,128 **** CopyPlanFields(Plan *from, Plan *newnode)
   * _copyPlan
   */
  static Plan *
! _copyPlan(Plan *from)
  {
  	Plan	   *newnode = makeNode(Plan);
  
--- 122,128 ----
   * _copyPlan
   */
  static Plan *
! _copyPlan(const Plan *from)
  {
  	Plan	   *newnode = makeNode(Plan);
  
***************
*** 139,145 **** _copyPlan(Plan *from)
   * _copyResult
   */
  static Result *
! _copyResult(Result *from)
  {
  	Result	   *newnode = makeNode(Result);
  
--- 139,145 ----
   * _copyResult
   */
  static Result *
! _copyResult(const Result *from)
  {
  	Result	   *newnode = makeNode(Result);
  
***************
*** 160,166 **** _copyResult(Result *from)
   * _copyModifyTable
   */
  static ModifyTable *
! _copyModifyTable(ModifyTable *from)
  {
  	ModifyTable *newnode = makeNode(ModifyTable);
  
--- 160,166 ----
   * _copyModifyTable
   */
  static ModifyTable *
! _copyModifyTable(const ModifyTable *from)
  {
  	ModifyTable *newnode = makeNode(ModifyTable);
  
***************
*** 188,194 **** _copyModifyTable(ModifyTable *from)
   * _copyAppend
   */
  static Append *
! _copyAppend(Append *from)
  {
  	Append	   *newnode = makeNode(Append);
  
--- 188,194 ----
   * _copyAppend
   */
  static Append *
! _copyAppend(const Append *from)
  {
  	Append	   *newnode = makeNode(Append);
  
***************
*** 209,215 **** _copyAppend(Append *from)
   * _copyMergeAppend
   */
  static MergeAppend *
! _copyMergeAppend(MergeAppend *from)
  {
  	MergeAppend *newnode = makeNode(MergeAppend);
  
--- 209,215 ----
   * _copyMergeAppend
   */
  static MergeAppend *
! _copyMergeAppend(const MergeAppend *from)
  {
  	MergeAppend *newnode = makeNode(MergeAppend);
  
***************
*** 235,241 **** _copyMergeAppend(MergeAppend *from)
   * _copyRecursiveUnion
   */
  static RecursiveUnion *
! _copyRecursiveUnion(RecursiveUnion *from)
  {
  	RecursiveUnion *newnode = makeNode(RecursiveUnion);
  
--- 235,241 ----
   * _copyRecursiveUnion
   */
  static RecursiveUnion *
! _copyRecursiveUnion(const RecursiveUnion *from)
  {
  	RecursiveUnion *newnode = makeNode(RecursiveUnion);
  
***************
*** 263,269 **** _copyRecursiveUnion(RecursiveUnion *from)
   * _copyBitmapAnd
   */
  static BitmapAnd *
! _copyBitmapAnd(BitmapAnd *from)
  {
  	BitmapAnd  *newnode = makeNode(BitmapAnd);
  
--- 263,269 ----
   * _copyBitmapAnd
   */
  static BitmapAnd *
! _copyBitmapAnd(const BitmapAnd *from)
  {
  	BitmapAnd  *newnode = makeNode(BitmapAnd);
  
***************
*** 284,290 **** _copyBitmapAnd(BitmapAnd *from)
   * _copyBitmapOr
   */
  static BitmapOr *
! _copyBitmapOr(BitmapOr *from)
  {
  	BitmapOr   *newnode = makeNode(BitmapOr);
  
--- 284,290 ----
   * _copyBitmapOr
   */
  static BitmapOr *
! _copyBitmapOr(const BitmapOr *from)
  {
  	BitmapOr   *newnode = makeNode(BitmapOr);
  
***************
*** 309,315 **** _copyBitmapOr(BitmapOr *from)
   *		all the copy functions for classes which inherit from Scan.
   */
  static void
! CopyScanFields(Scan *from, Scan *newnode)
  {
  	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
--- 309,315 ----
   *		all the copy functions for classes which inherit from Scan.
   */
  static void
! CopyScanFields(const Scan *from, Scan *newnode)
  {
  	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
***************
*** 320,326 **** CopyScanFields(Scan *from, Scan *newnode)
   * _copyScan
   */
  static Scan *
! _copyScan(Scan *from)
  {
  	Scan	   *newnode = makeNode(Scan);
  
--- 320,326 ----
   * _copyScan
   */
  static Scan *
! _copyScan(const Scan *from)
  {
  	Scan	   *newnode = makeNode(Scan);
  
***************
*** 336,342 **** _copyScan(Scan *from)
   * _copySeqScan
   */
  static SeqScan *
! _copySeqScan(SeqScan *from)
  {
  	SeqScan    *newnode = makeNode(SeqScan);
  
--- 336,342 ----
   * _copySeqScan
   */
  static SeqScan *
! _copySeqScan(const SeqScan *from)
  {
  	SeqScan    *newnode = makeNode(SeqScan);
  
***************
*** 352,358 **** _copySeqScan(SeqScan *from)
   * _copyIndexScan
   */
  static IndexScan *
! _copyIndexScan(IndexScan *from)
  {
  	IndexScan  *newnode = makeNode(IndexScan);
  
--- 352,358 ----
   * _copyIndexScan
   */
  static IndexScan *
! _copyIndexScan(const IndexScan *from)
  {
  	IndexScan  *newnode = makeNode(IndexScan);
  
***************
*** 378,384 **** _copyIndexScan(IndexScan *from)
   * _copyIndexOnlyScan
   */
  static IndexOnlyScan *
! _copyIndexOnlyScan(IndexOnlyScan *from)
  {
  	IndexOnlyScan  *newnode = makeNode(IndexOnlyScan);
  
--- 378,384 ----
   * _copyIndexOnlyScan
   */
  static IndexOnlyScan *
! _copyIndexOnlyScan(const IndexOnlyScan *from)
  {
  	IndexOnlyScan  *newnode = makeNode(IndexOnlyScan);
  
***************
*** 403,409 **** _copyIndexOnlyScan(IndexOnlyScan *from)
   * _copyBitmapIndexScan
   */
  static BitmapIndexScan *
! _copyBitmapIndexScan(BitmapIndexScan *from)
  {
  	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
  
--- 403,409 ----
   * _copyBitmapIndexScan
   */
  static BitmapIndexScan *
! _copyBitmapIndexScan(const BitmapIndexScan *from)
  {
  	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
  
***************
*** 426,432 **** _copyBitmapIndexScan(BitmapIndexScan *from)
   * _copyBitmapHeapScan
   */
  static BitmapHeapScan *
! _copyBitmapHeapScan(BitmapHeapScan *from)
  {
  	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
  
--- 426,432 ----
   * _copyBitmapHeapScan
   */
  static BitmapHeapScan *
! _copyBitmapHeapScan(const BitmapHeapScan *from)
  {
  	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
  
***************
*** 447,453 **** _copyBitmapHeapScan(BitmapHeapScan *from)
   * _copyTidScan
   */
  static TidScan *
! _copyTidScan(TidScan *from)
  {
  	TidScan    *newnode = makeNode(TidScan);
  
--- 447,453 ----
   * _copyTidScan
   */
  static TidScan *
! _copyTidScan(const TidScan *from)
  {
  	TidScan    *newnode = makeNode(TidScan);
  
***************
*** 468,474 **** _copyTidScan(TidScan *from)
   * _copySubqueryScan
   */
  static SubqueryScan *
! _copySubqueryScan(SubqueryScan *from)
  {
  	SubqueryScan *newnode = makeNode(SubqueryScan);
  
--- 468,474 ----
   * _copySubqueryScan
   */
  static SubqueryScan *
! _copySubqueryScan(const SubqueryScan *from)
  {
  	SubqueryScan *newnode = makeNode(SubqueryScan);
  
***************
*** 489,495 **** _copySubqueryScan(SubqueryScan *from)
   * _copyFunctionScan
   */
  static FunctionScan *
! _copyFunctionScan(FunctionScan *from)
  {
  	FunctionScan *newnode = makeNode(FunctionScan);
  
--- 489,495 ----
   * _copyFunctionScan
   */
  static FunctionScan *
! _copyFunctionScan(const FunctionScan *from)
  {
  	FunctionScan *newnode = makeNode(FunctionScan);
  
***************
*** 514,520 **** _copyFunctionScan(FunctionScan *from)
   * _copyValuesScan
   */
  static ValuesScan *
! _copyValuesScan(ValuesScan *from)
  {
  	ValuesScan *newnode = makeNode(ValuesScan);
  
--- 514,520 ----
   * _copyValuesScan
   */
  static ValuesScan *
! _copyValuesScan(const ValuesScan *from)
  {
  	ValuesScan *newnode = makeNode(ValuesScan);
  
***************
*** 535,541 **** _copyValuesScan(ValuesScan *from)
   * _copyCteScan
   */
  static CteScan *
! _copyCteScan(CteScan *from)
  {
  	CteScan    *newnode = makeNode(CteScan);
  
--- 535,541 ----
   * _copyCteScan
   */
  static CteScan *
! _copyCteScan(const CteScan *from)
  {
  	CteScan    *newnode = makeNode(CteScan);
  
***************
*** 557,563 **** _copyCteScan(CteScan *from)
   * _copyWorkTableScan
   */
  static WorkTableScan *
! _copyWorkTableScan(WorkTableScan *from)
  {
  	WorkTableScan *newnode = makeNode(WorkTableScan);
  
--- 557,563 ----
   * _copyWorkTableScan
   */
  static WorkTableScan *
! _copyWorkTableScan(const WorkTableScan *from)
  {
  	WorkTableScan *newnode = makeNode(WorkTableScan);
  
***************
*** 578,584 **** _copyWorkTableScan(WorkTableScan *from)
   * _copyForeignScan
   */
  static ForeignScan *
! _copyForeignScan(ForeignScan *from)
  {
  	ForeignScan *newnode = makeNode(ForeignScan);
  
--- 578,584 ----
   * _copyForeignScan
   */
  static ForeignScan *
! _copyForeignScan(const ForeignScan *from)
  {
  	ForeignScan *newnode = makeNode(ForeignScan);
  
***************
*** 600,606 **** _copyForeignScan(ForeignScan *from)
   * _copyFdwPlan
   */
  static FdwPlan *
! _copyFdwPlan(FdwPlan *from)
  {
  	FdwPlan    *newnode = makeNode(FdwPlan);
  
--- 600,606 ----
   * _copyFdwPlan
   */
  static FdwPlan *
! _copyFdwPlan(const FdwPlan *from)
  {
  	FdwPlan    *newnode = makeNode(FdwPlan);
  
***************
*** 618,624 **** _copyFdwPlan(FdwPlan *from)
   *		all the copy functions for classes which inherit from Join.
   */
  static void
! CopyJoinFields(Join *from, Join *newnode)
  {
  	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
--- 618,624 ----
   *		all the copy functions for classes which inherit from Join.
   */
  static void
! CopyJoinFields(const Join *from, Join *newnode)
  {
  	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
***************
*** 631,637 **** CopyJoinFields(Join *from, Join *newnode)
   * _copyJoin
   */
  static Join *
! _copyJoin(Join *from)
  {
  	Join	   *newnode = makeNode(Join);
  
--- 631,637 ----
   * _copyJoin
   */
  static Join *
! _copyJoin(const Join *from)
  {
  	Join	   *newnode = makeNode(Join);
  
***************
*** 648,654 **** _copyJoin(Join *from)
   * _copyNestLoop
   */
  static NestLoop *
! _copyNestLoop(NestLoop *from)
  {
  	NestLoop   *newnode = makeNode(NestLoop);
  
--- 648,654 ----
   * _copyNestLoop
   */
  static NestLoop *
! _copyNestLoop(const NestLoop *from)
  {
  	NestLoop   *newnode = makeNode(NestLoop);
  
***************
*** 670,676 **** _copyNestLoop(NestLoop *from)
   * _copyMergeJoin
   */
  static MergeJoin *
! _copyMergeJoin(MergeJoin *from)
  {
  	MergeJoin  *newnode = makeNode(MergeJoin);
  	int			numCols;
--- 670,676 ----
   * _copyMergeJoin
   */
  static MergeJoin *
! _copyMergeJoin(const MergeJoin *from)
  {
  	MergeJoin  *newnode = makeNode(MergeJoin);
  	int			numCols;
***************
*** 697,703 **** _copyMergeJoin(MergeJoin *from)
   * _copyHashJoin
   */
  static HashJoin *
! _copyHashJoin(HashJoin *from)
  {
  	HashJoin   *newnode = makeNode(HashJoin);
  
--- 697,703 ----
   * _copyHashJoin
   */
  static HashJoin *
! _copyHashJoin(const HashJoin *from)
  {
  	HashJoin   *newnode = makeNode(HashJoin);
  
***************
*** 719,725 **** _copyHashJoin(HashJoin *from)
   * _copyMaterial
   */
  static Material *
! _copyMaterial(Material *from)
  {
  	Material   *newnode = makeNode(Material);
  
--- 719,725 ----
   * _copyMaterial
   */
  static Material *
! _copyMaterial(const Material *from)
  {
  	Material   *newnode = makeNode(Material);
  
***************
*** 736,742 **** _copyMaterial(Material *from)
   * _copySort
   */
  static Sort *
! _copySort(Sort *from)
  {
  	Sort	   *newnode = makeNode(Sort);
  
--- 736,742 ----
   * _copySort
   */
  static Sort *
! _copySort(const Sort *from)
  {
  	Sort	   *newnode = makeNode(Sort);
  
***************
*** 759,765 **** _copySort(Sort *from)
   * _copyGroup
   */
  static Group *
! _copyGroup(Group *from)
  {
  	Group	   *newnode = makeNode(Group);
  
--- 759,765 ----
   * _copyGroup
   */
  static Group *
! _copyGroup(const Group *from)
  {
  	Group	   *newnode = makeNode(Group);
  
***************
*** 776,782 **** _copyGroup(Group *from)
   * _copyAgg
   */
  static Agg *
! _copyAgg(Agg *from)
  {
  	Agg		   *newnode = makeNode(Agg);
  
--- 776,782 ----
   * _copyAgg
   */
  static Agg *
! _copyAgg(const Agg *from)
  {
  	Agg		   *newnode = makeNode(Agg);
  
***************
*** 798,804 **** _copyAgg(Agg *from)
   * _copyWindowAgg
   */
  static WindowAgg *
! _copyWindowAgg(WindowAgg *from)
  {
  	WindowAgg  *newnode = makeNode(WindowAgg);
  
--- 798,804 ----
   * _copyWindowAgg
   */
  static WindowAgg *
! _copyWindowAgg(const WindowAgg *from)
  {
  	WindowAgg  *newnode = makeNode(WindowAgg);
  
***************
*** 828,834 **** _copyWindowAgg(WindowAgg *from)
   * _copyUnique
   */
  static Unique *
! _copyUnique(Unique *from)
  {
  	Unique	   *newnode = makeNode(Unique);
  
--- 828,834 ----
   * _copyUnique
   */
  static Unique *
! _copyUnique(const Unique *from)
  {
  	Unique	   *newnode = makeNode(Unique);
  
***************
*** 851,857 **** _copyUnique(Unique *from)
   * _copyHash
   */
  static Hash *
! _copyHash(Hash *from)
  {
  	Hash	   *newnode = makeNode(Hash);
  
--- 851,857 ----
   * _copyHash
   */
  static Hash *
! _copyHash(const Hash *from)
  {
  	Hash	   *newnode = makeNode(Hash);
  
***************
*** 876,882 **** _copyHash(Hash *from)
   * _copySetOp
   */
  static SetOp *
! _copySetOp(SetOp *from)
  {
  	SetOp	   *newnode = makeNode(SetOp);
  
--- 876,882 ----
   * _copySetOp
   */
  static SetOp *
! _copySetOp(const SetOp *from)
  {
  	SetOp	   *newnode = makeNode(SetOp);
  
***************
*** 904,910 **** _copySetOp(SetOp *from)
   * _copyLockRows
   */
  static LockRows *
! _copyLockRows(LockRows *from)
  {
  	LockRows   *newnode = makeNode(LockRows);
  
--- 904,910 ----
   * _copyLockRows
   */
  static LockRows *
! _copyLockRows(const LockRows *from)
  {
  	LockRows   *newnode = makeNode(LockRows);
  
***************
*** 926,932 **** _copyLockRows(LockRows *from)
   * _copyLimit
   */
  static Limit *
! _copyLimit(Limit *from)
  {
  	Limit	   *newnode = makeNode(Limit);
  
--- 926,932 ----
   * _copyLimit
   */
  static Limit *
! _copyLimit(const Limit *from)
  {
  	Limit	   *newnode = makeNode(Limit);
  
***************
*** 948,954 **** _copyLimit(Limit *from)
   * _copyNestLoopParam
   */
  static NestLoopParam *
! _copyNestLoopParam(NestLoopParam *from)
  {
  	NestLoopParam *newnode = makeNode(NestLoopParam);
  
--- 948,954 ----
   * _copyNestLoopParam
   */
  static NestLoopParam *
! _copyNestLoopParam(const NestLoopParam *from)
  {
  	NestLoopParam *newnode = makeNode(NestLoopParam);
  
***************
*** 962,968 **** _copyNestLoopParam(NestLoopParam *from)
   * _copyPlanRowMark
   */
  static PlanRowMark *
! _copyPlanRowMark(PlanRowMark *from)
  {
  	PlanRowMark *newnode = makeNode(PlanRowMark);
  
--- 962,968 ----
   * _copyPlanRowMark
   */
  static PlanRowMark *
! _copyPlanRowMark(const PlanRowMark *from)
  {
  	PlanRowMark *newnode = makeNode(PlanRowMark);
  
***************
*** 980,986 **** _copyPlanRowMark(PlanRowMark *from)
   * _copyPlanInvalItem
   */
  static PlanInvalItem *
! _copyPlanInvalItem(PlanInvalItem *from)
  {
  	PlanInvalItem *newnode = makeNode(PlanInvalItem);
  
--- 980,986 ----
   * _copyPlanInvalItem
   */
  static PlanInvalItem *
! _copyPlanInvalItem(const PlanInvalItem *from)
  {
  	PlanInvalItem *newnode = makeNode(PlanInvalItem);
  
***************
*** 999,1005 **** _copyPlanInvalItem(PlanInvalItem *from)
   * _copyAlias
   */
  static Alias *
! _copyAlias(Alias *from)
  {
  	Alias	   *newnode = makeNode(Alias);
  
--- 999,1005 ----
   * _copyAlias
   */
  static Alias *
! _copyAlias(const Alias *from)
  {
  	Alias	   *newnode = makeNode(Alias);
  
***************
*** 1013,1019 **** _copyAlias(Alias *from)
   * _copyRangeVar
   */
  static RangeVar *
! _copyRangeVar(RangeVar *from)
  {
  	RangeVar   *newnode = makeNode(RangeVar);
  
--- 1013,1019 ----
   * _copyRangeVar
   */
  static RangeVar *
! _copyRangeVar(const RangeVar *from)
  {
  	RangeVar   *newnode = makeNode(RangeVar);
  
***************
*** 1032,1038 **** _copyRangeVar(RangeVar *from)
   * _copyIntoClause
   */
  static IntoClause *
! _copyIntoClause(IntoClause *from)
  {
  	IntoClause *newnode = makeNode(IntoClause);
  
--- 1032,1038 ----
   * _copyIntoClause
   */
  static IntoClause *
! _copyIntoClause(const IntoClause *from)
  {
  	IntoClause *newnode = makeNode(IntoClause);
  
***************
*** 1056,1062 **** _copyIntoClause(IntoClause *from)
   * _copyVar
   */
  static Var *
! _copyVar(Var *from)
  {
  	Var		   *newnode = makeNode(Var);
  
--- 1056,1062 ----
   * _copyVar
   */
  static Var *
! _copyVar(const Var *from)
  {
  	Var		   *newnode = makeNode(Var);
  
***************
*** 1077,1083 **** _copyVar(Var *from)
   * _copyConst
   */
  static Const *
! _copyConst(Const *from)
  {
  	Const	   *newnode = makeNode(Const);
  
--- 1077,1083 ----
   * _copyConst
   */
  static Const *
! _copyConst(const Const *from)
  {
  	Const	   *newnode = makeNode(Const);
  
***************
*** 1115,1121 **** _copyConst(Const *from)
   * _copyParam
   */
  static Param *
! _copyParam(Param *from)
  {
  	Param	   *newnode = makeNode(Param);
  
--- 1115,1121 ----
   * _copyParam
   */
  static Param *
! _copyParam(const Param *from)
  {
  	Param	   *newnode = makeNode(Param);
  
***************
*** 1133,1139 **** _copyParam(Param *from)
   * _copyAggref
   */
  static Aggref *
! _copyAggref(Aggref *from)
  {
  	Aggref	   *newnode = makeNode(Aggref);
  
--- 1133,1139 ----
   * _copyAggref
   */
  static Aggref *
! _copyAggref(const Aggref *from)
  {
  	Aggref	   *newnode = makeNode(Aggref);
  
***************
*** 1155,1161 **** _copyAggref(Aggref *from)
   * _copyWindowFunc
   */
  static WindowFunc *
! _copyWindowFunc(WindowFunc *from)
  {
  	WindowFunc *newnode = makeNode(WindowFunc);
  
--- 1155,1161 ----
   * _copyWindowFunc
   */
  static WindowFunc *
! _copyWindowFunc(const WindowFunc *from)
  {
  	WindowFunc *newnode = makeNode(WindowFunc);
  
***************
*** 1176,1182 **** _copyWindowFunc(WindowFunc *from)
   * _copyArrayRef
   */
  static ArrayRef *
! _copyArrayRef(ArrayRef *from)
  {
  	ArrayRef   *newnode = makeNode(ArrayRef);
  
--- 1176,1182 ----
   * _copyArrayRef
   */
  static ArrayRef *
! _copyArrayRef(const ArrayRef *from)
  {
  	ArrayRef   *newnode = makeNode(ArrayRef);
  
***************
*** 1196,1202 **** _copyArrayRef(ArrayRef *from)
   * _copyFuncExpr
   */
  static FuncExpr *
! _copyFuncExpr(FuncExpr *from)
  {
  	FuncExpr   *newnode = makeNode(FuncExpr);
  
--- 1196,1202 ----
   * _copyFuncExpr
   */
  static FuncExpr *
! _copyFuncExpr(const FuncExpr *from)
  {
  	FuncExpr   *newnode = makeNode(FuncExpr);
  
***************
*** 1216,1222 **** _copyFuncExpr(FuncExpr *from)
   * _copyNamedArgExpr *
   */
  static NamedArgExpr *
! _copyNamedArgExpr(NamedArgExpr *from)
  {
  	NamedArgExpr *newnode = makeNode(NamedArgExpr);
  
--- 1216,1222 ----
   * _copyNamedArgExpr *
   */
  static NamedArgExpr *
! _copyNamedArgExpr(const NamedArgExpr *from)
  {
  	NamedArgExpr *newnode = makeNode(NamedArgExpr);
  
***************
*** 1232,1238 **** _copyNamedArgExpr(NamedArgExpr *from)
   * _copyOpExpr
   */
  static OpExpr *
! _copyOpExpr(OpExpr *from)
  {
  	OpExpr	   *newnode = makeNode(OpExpr);
  
--- 1232,1238 ----
   * _copyOpExpr
   */
  static OpExpr *
! _copyOpExpr(const OpExpr *from)
  {
  	OpExpr	   *newnode = makeNode(OpExpr);
  
***************
*** 1252,1258 **** _copyOpExpr(OpExpr *from)
   * _copyDistinctExpr (same as OpExpr)
   */
  static DistinctExpr *
! _copyDistinctExpr(DistinctExpr *from)
  {
  	DistinctExpr *newnode = makeNode(DistinctExpr);
  
--- 1252,1258 ----
   * _copyDistinctExpr (same as OpExpr)
   */
  static DistinctExpr *
! _copyDistinctExpr(const DistinctExpr *from)
  {
  	DistinctExpr *newnode = makeNode(DistinctExpr);
  
***************
*** 1272,1278 **** _copyDistinctExpr(DistinctExpr *from)
   * _copyNullIfExpr (same as OpExpr)
   */
  static NullIfExpr *
! _copyNullIfExpr(NullIfExpr *from)
  {
  	NullIfExpr *newnode = makeNode(NullIfExpr);
  
--- 1272,1278 ----
   * _copyNullIfExpr (same as OpExpr)
   */
  static NullIfExpr *
! _copyNullIfExpr(const NullIfExpr *from)
  {
  	NullIfExpr *newnode = makeNode(NullIfExpr);
  
***************
*** 1292,1298 **** _copyNullIfExpr(NullIfExpr *from)
   * _copyScalarArrayOpExpr
   */
  static ScalarArrayOpExpr *
! _copyScalarArrayOpExpr(ScalarArrayOpExpr *from)
  {
  	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
  
--- 1292,1298 ----
   * _copyScalarArrayOpExpr
   */
  static ScalarArrayOpExpr *
! _copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
  {
  	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
  
***************
*** 1310,1316 **** _copyScalarArrayOpExpr(ScalarArrayOpExpr *from)
   * _copyBoolExpr
   */
  static BoolExpr *
! _copyBoolExpr(BoolExpr *from)
  {
  	BoolExpr   *newnode = makeNode(BoolExpr);
  
--- 1310,1316 ----
   * _copyBoolExpr
   */
  static BoolExpr *
! _copyBoolExpr(const BoolExpr *from)
  {
  	BoolExpr   *newnode = makeNode(BoolExpr);
  
***************
*** 1325,1331 **** _copyBoolExpr(BoolExpr *from)
   * _copySubLink
   */
  static SubLink *
! _copySubLink(SubLink *from)
  {
  	SubLink    *newnode = makeNode(SubLink);
  
--- 1325,1331 ----
   * _copySubLink
   */
  static SubLink *
! _copySubLink(const SubLink *from)
  {
  	SubLink    *newnode = makeNode(SubLink);
  
***************
*** 1342,1348 **** _copySubLink(SubLink *from)
   * _copySubPlan
   */
  static SubPlan *
! _copySubPlan(SubPlan *from)
  {
  	SubPlan    *newnode = makeNode(SubPlan);
  
--- 1342,1348 ----
   * _copySubPlan
   */
  static SubPlan *
! _copySubPlan(const SubPlan *from)
  {
  	SubPlan    *newnode = makeNode(SubPlan);
  
***************
*** 1369,1375 **** _copySubPlan(SubPlan *from)
   * _copyAlternativeSubPlan
   */
  static AlternativeSubPlan *
! _copyAlternativeSubPlan(AlternativeSubPlan *from)
  {
  	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
  
--- 1369,1375 ----
   * _copyAlternativeSubPlan
   */
  static AlternativeSubPlan *
! _copyAlternativeSubPlan(const AlternativeSubPlan *from)
  {
  	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
  
***************
*** 1382,1388 **** _copyAlternativeSubPlan(AlternativeSubPlan *from)
   * _copyFieldSelect
   */
  static FieldSelect *
! _copyFieldSelect(FieldSelect *from)
  {
  	FieldSelect *newnode = makeNode(FieldSelect);
  
--- 1382,1388 ----
   * _copyFieldSelect
   */
  static FieldSelect *
! _copyFieldSelect(const FieldSelect *from)
  {
  	FieldSelect *newnode = makeNode(FieldSelect);
  
***************
*** 1399,1405 **** _copyFieldSelect(FieldSelect *from)
   * _copyFieldStore
   */
  static FieldStore *
! _copyFieldStore(FieldStore *from)
  {
  	FieldStore *newnode = makeNode(FieldStore);
  
--- 1399,1405 ----
   * _copyFieldStore
   */
  static FieldStore *
! _copyFieldStore(const FieldStore *from)
  {
  	FieldStore *newnode = makeNode(FieldStore);
  
***************
*** 1415,1421 **** _copyFieldStore(FieldStore *from)
   * _copyRelabelType
   */
  static RelabelType *
! _copyRelabelType(RelabelType *from)
  {
  	RelabelType *newnode = makeNode(RelabelType);
  
--- 1415,1421 ----
   * _copyRelabelType
   */
  static RelabelType *
! _copyRelabelType(const RelabelType *from)
  {
  	RelabelType *newnode = makeNode(RelabelType);
  
***************
*** 1433,1439 **** _copyRelabelType(RelabelType *from)
   * _copyCoerceViaIO
   */
  static CoerceViaIO *
! _copyCoerceViaIO(CoerceViaIO *from)
  {
  	CoerceViaIO *newnode = makeNode(CoerceViaIO);
  
--- 1433,1439 ----
   * _copyCoerceViaIO
   */
  static CoerceViaIO *
! _copyCoerceViaIO(const CoerceViaIO *from)
  {
  	CoerceViaIO *newnode = makeNode(CoerceViaIO);
  
***************
*** 1450,1456 **** _copyCoerceViaIO(CoerceViaIO *from)
   * _copyArrayCoerceExpr
   */
  static ArrayCoerceExpr *
! _copyArrayCoerceExpr(ArrayCoerceExpr *from)
  {
  	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
  
--- 1450,1456 ----
   * _copyArrayCoerceExpr
   */
  static ArrayCoerceExpr *
! _copyArrayCoerceExpr(const ArrayCoerceExpr *from)
  {
  	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
  
***************
*** 1470,1476 **** _copyArrayCoerceExpr(ArrayCoerceExpr *from)
   * _copyConvertRowtypeExpr
   */
  static ConvertRowtypeExpr *
! _copyConvertRowtypeExpr(ConvertRowtypeExpr *from)
  {
  	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
  
--- 1470,1476 ----
   * _copyConvertRowtypeExpr
   */
  static ConvertRowtypeExpr *
! _copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
  {
  	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
  
***************
*** 1486,1492 **** _copyConvertRowtypeExpr(ConvertRowtypeExpr *from)
   * _copyCollateExpr
   */
  static CollateExpr *
! _copyCollateExpr(CollateExpr *from)
  {
  	CollateExpr *newnode = makeNode(CollateExpr);
  
--- 1486,1492 ----
   * _copyCollateExpr
   */
  static CollateExpr *
! _copyCollateExpr(const CollateExpr *from)
  {
  	CollateExpr *newnode = makeNode(CollateExpr);
  
***************
*** 1501,1507 **** _copyCollateExpr(CollateExpr *from)
   * _copyCaseExpr
   */
  static CaseExpr *
! _copyCaseExpr(CaseExpr *from)
  {
  	CaseExpr   *newnode = makeNode(CaseExpr);
  
--- 1501,1507 ----
   * _copyCaseExpr
   */
  static CaseExpr *
! _copyCaseExpr(const CaseExpr *from)
  {
  	CaseExpr   *newnode = makeNode(CaseExpr);
  
***************
*** 1519,1525 **** _copyCaseExpr(CaseExpr *from)
   * _copyCaseWhen
   */
  static CaseWhen *
! _copyCaseWhen(CaseWhen *from)
  {
  	CaseWhen   *newnode = makeNode(CaseWhen);
  
--- 1519,1525 ----
   * _copyCaseWhen
   */
  static CaseWhen *
! _copyCaseWhen(const CaseWhen *from)
  {
  	CaseWhen   *newnode = makeNode(CaseWhen);
  
***************
*** 1534,1540 **** _copyCaseWhen(CaseWhen *from)
   * _copyCaseTestExpr
   */
  static CaseTestExpr *
! _copyCaseTestExpr(CaseTestExpr *from)
  {
  	CaseTestExpr *newnode = makeNode(CaseTestExpr);
  
--- 1534,1540 ----
   * _copyCaseTestExpr
   */
  static CaseTestExpr *
! _copyCaseTestExpr(const CaseTestExpr *from)
  {
  	CaseTestExpr *newnode = makeNode(CaseTestExpr);
  
***************
*** 1549,1555 **** _copyCaseTestExpr(CaseTestExpr *from)
   * _copyArrayExpr
   */
  static ArrayExpr *
! _copyArrayExpr(ArrayExpr *from)
  {
  	ArrayExpr  *newnode = makeNode(ArrayExpr);
  
--- 1549,1555 ----
   * _copyArrayExpr
   */
  static ArrayExpr *
! _copyArrayExpr(const ArrayExpr *from)
  {
  	ArrayExpr  *newnode = makeNode(ArrayExpr);
  
***************
*** 1567,1573 **** _copyArrayExpr(ArrayExpr *from)
   * _copyRowExpr
   */
  static RowExpr *
! _copyRowExpr(RowExpr *from)
  {
  	RowExpr    *newnode = makeNode(RowExpr);
  
--- 1567,1573 ----
   * _copyRowExpr
   */
  static RowExpr *
! _copyRowExpr(const RowExpr *from)
  {
  	RowExpr    *newnode = makeNode(RowExpr);
  
***************
*** 1584,1590 **** _copyRowExpr(RowExpr *from)
   * _copyRowCompareExpr
   */
  static RowCompareExpr *
! _copyRowCompareExpr(RowCompareExpr *from)
  {
  	RowCompareExpr *newnode = makeNode(RowCompareExpr);
  
--- 1584,1590 ----
   * _copyRowCompareExpr
   */
  static RowCompareExpr *
! _copyRowCompareExpr(const RowCompareExpr *from)
  {
  	RowCompareExpr *newnode = makeNode(RowCompareExpr);
  
***************
*** 1602,1608 **** _copyRowCompareExpr(RowCompareExpr *from)
   * _copyCoalesceExpr
   */
  static CoalesceExpr *
! _copyCoalesceExpr(CoalesceExpr *from)
  {
  	CoalesceExpr *newnode = makeNode(CoalesceExpr);
  
--- 1602,1608 ----
   * _copyCoalesceExpr
   */
  static CoalesceExpr *
! _copyCoalesceExpr(const CoalesceExpr *from)
  {
  	CoalesceExpr *newnode = makeNode(CoalesceExpr);
  
***************
*** 1618,1624 **** _copyCoalesceExpr(CoalesceExpr *from)
   * _copyMinMaxExpr
   */
  static MinMaxExpr *
! _copyMinMaxExpr(MinMaxExpr *from)
  {
  	MinMaxExpr *newnode = makeNode(MinMaxExpr);
  
--- 1618,1624 ----
   * _copyMinMaxExpr
   */
  static MinMaxExpr *
! _copyMinMaxExpr(const MinMaxExpr *from)
  {
  	MinMaxExpr *newnode = makeNode(MinMaxExpr);
  
***************
*** 1636,1642 **** _copyMinMaxExpr(MinMaxExpr *from)
   * _copyXmlExpr
   */
  static XmlExpr *
! _copyXmlExpr(XmlExpr *from)
  {
  	XmlExpr    *newnode = makeNode(XmlExpr);
  
--- 1636,1642 ----
   * _copyXmlExpr
   */
  static XmlExpr *
! _copyXmlExpr(const XmlExpr *from)
  {
  	XmlExpr    *newnode = makeNode(XmlExpr);
  
***************
*** 1657,1663 **** _copyXmlExpr(XmlExpr *from)
   * _copyNullTest
   */
  static NullTest *
! _copyNullTest(NullTest *from)
  {
  	NullTest   *newnode = makeNode(NullTest);
  
--- 1657,1663 ----
   * _copyNullTest
   */
  static NullTest *
! _copyNullTest(const NullTest *from)
  {
  	NullTest   *newnode = makeNode(NullTest);
  
***************
*** 1672,1678 **** _copyNullTest(NullTest *from)
   * _copyBooleanTest
   */
  static BooleanTest *
! _copyBooleanTest(BooleanTest *from)
  {
  	BooleanTest *newnode = makeNode(BooleanTest);
  
--- 1672,1678 ----
   * _copyBooleanTest
   */
  static BooleanTest *
! _copyBooleanTest(const BooleanTest *from)
  {
  	BooleanTest *newnode = makeNode(BooleanTest);
  
***************
*** 1686,1692 **** _copyBooleanTest(BooleanTest *from)
   * _copyCoerceToDomain
   */
  static CoerceToDomain *
! _copyCoerceToDomain(CoerceToDomain *from)
  {
  	CoerceToDomain *newnode = makeNode(CoerceToDomain);
  
--- 1686,1692 ----
   * _copyCoerceToDomain
   */
  static CoerceToDomain *
! _copyCoerceToDomain(const CoerceToDomain *from)
  {
  	CoerceToDomain *newnode = makeNode(CoerceToDomain);
  
***************
*** 1704,1710 **** _copyCoerceToDomain(CoerceToDomain *from)
   * _copyCoerceToDomainValue
   */
  static CoerceToDomainValue *
! _copyCoerceToDomainValue(CoerceToDomainValue *from)
  {
  	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
  
--- 1704,1710 ----
   * _copyCoerceToDomainValue
   */
  static CoerceToDomainValue *
! _copyCoerceToDomainValue(const CoerceToDomainValue *from)
  {
  	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
  
***************
*** 1720,1726 **** _copyCoerceToDomainValue(CoerceToDomainValue *from)
   * _copySetToDefault
   */
  static SetToDefault *
! _copySetToDefault(SetToDefault *from)
  {
  	SetToDefault *newnode = makeNode(SetToDefault);
  
--- 1720,1726 ----
   * _copySetToDefault
   */
  static SetToDefault *
! _copySetToDefault(const SetToDefault *from)
  {
  	SetToDefault *newnode = makeNode(SetToDefault);
  
***************
*** 1736,1742 **** _copySetToDefault(SetToDefault *from)
   * _copyCurrentOfExpr
   */
  static CurrentOfExpr *
! _copyCurrentOfExpr(CurrentOfExpr *from)
  {
  	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
  
--- 1736,1742 ----
   * _copyCurrentOfExpr
   */
  static CurrentOfExpr *
! _copyCurrentOfExpr(const CurrentOfExpr *from)
  {
  	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
  
***************
*** 1751,1757 **** _copyCurrentOfExpr(CurrentOfExpr *from)
   * _copyTargetEntry
   */
  static TargetEntry *
! _copyTargetEntry(TargetEntry *from)
  {
  	TargetEntry *newnode = makeNode(TargetEntry);
  
--- 1751,1757 ----
   * _copyTargetEntry
   */
  static TargetEntry *
! _copyTargetEntry(const TargetEntry *from)
  {
  	TargetEntry *newnode = makeNode(TargetEntry);
  
***************
*** 1770,1776 **** _copyTargetEntry(TargetEntry *from)
   * _copyRangeTblRef
   */
  static RangeTblRef *
! _copyRangeTblRef(RangeTblRef *from)
  {
  	RangeTblRef *newnode = makeNode(RangeTblRef);
  
--- 1770,1776 ----
   * _copyRangeTblRef
   */
  static RangeTblRef *
! _copyRangeTblRef(const RangeTblRef *from)
  {
  	RangeTblRef *newnode = makeNode(RangeTblRef);
  
***************
*** 1783,1789 **** _copyRangeTblRef(RangeTblRef *from)
   * _copyJoinExpr
   */
  static JoinExpr *
! _copyJoinExpr(JoinExpr *from)
  {
  	JoinExpr   *newnode = makeNode(JoinExpr);
  
--- 1783,1789 ----
   * _copyJoinExpr
   */
  static JoinExpr *
! _copyJoinExpr(const JoinExpr *from)
  {
  	JoinExpr   *newnode = makeNode(JoinExpr);
  
***************
*** 1803,1809 **** _copyJoinExpr(JoinExpr *from)
   * _copyFromExpr
   */
  static FromExpr *
! _copyFromExpr(FromExpr *from)
  {
  	FromExpr   *newnode = makeNode(FromExpr);
  
--- 1803,1809 ----
   * _copyFromExpr
   */
  static FromExpr *
! _copyFromExpr(const FromExpr *from)
  {
  	FromExpr   *newnode = makeNode(FromExpr);
  
***************
*** 1825,1831 **** _copyFromExpr(FromExpr *from)
   * _copyPathKey
   */
  static PathKey *
! _copyPathKey(PathKey *from)
  {
  	PathKey    *newnode = makeNode(PathKey);
  
--- 1825,1831 ----
   * _copyPathKey
   */
  static PathKey *
! _copyPathKey(const PathKey *from)
  {
  	PathKey    *newnode = makeNode(PathKey);
  
***************
*** 1842,1848 **** _copyPathKey(PathKey *from)
   * _copyRestrictInfo
   */
  static RestrictInfo *
! _copyRestrictInfo(RestrictInfo *from)
  {
  	RestrictInfo *newnode = makeNode(RestrictInfo);
  
--- 1842,1848 ----
   * _copyRestrictInfo
   */
  static RestrictInfo *
! _copyRestrictInfo(const RestrictInfo *from)
  {
  	RestrictInfo *newnode = makeNode(RestrictInfo);
  
***************
*** 1882,1888 **** _copyRestrictInfo(RestrictInfo *from)
   * _copyPlaceHolderVar
   */
  static PlaceHolderVar *
! _copyPlaceHolderVar(PlaceHolderVar *from)
  {
  	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
  
--- 1882,1888 ----
   * _copyPlaceHolderVar
   */
  static PlaceHolderVar *
! _copyPlaceHolderVar(const PlaceHolderVar *from)
  {
  	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
  
***************
*** 1898,1904 **** _copyPlaceHolderVar(PlaceHolderVar *from)
   * _copySpecialJoinInfo
   */
  static SpecialJoinInfo *
! _copySpecialJoinInfo(SpecialJoinInfo *from)
  {
  	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
  
--- 1898,1904 ----
   * _copySpecialJoinInfo
   */
  static SpecialJoinInfo *
! _copySpecialJoinInfo(const SpecialJoinInfo *from)
  {
  	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
  
***************
*** 1918,1924 **** _copySpecialJoinInfo(SpecialJoinInfo *from)
   * _copyAppendRelInfo
   */
  static AppendRelInfo *
! _copyAppendRelInfo(AppendRelInfo *from)
  {
  	AppendRelInfo *newnode = makeNode(AppendRelInfo);
  
--- 1918,1924 ----
   * _copyAppendRelInfo
   */
  static AppendRelInfo *
! _copyAppendRelInfo(const AppendRelInfo *from)
  {
  	AppendRelInfo *newnode = makeNode(AppendRelInfo);
  
***************
*** 1936,1942 **** _copyAppendRelInfo(AppendRelInfo *from)
   * _copyPlaceHolderInfo
   */
  static PlaceHolderInfo *
! _copyPlaceHolderInfo(PlaceHolderInfo *from)
  {
  	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
  
--- 1936,1942 ----
   * _copyPlaceHolderInfo
   */
  static PlaceHolderInfo *
! _copyPlaceHolderInfo(const PlaceHolderInfo *from)
  {
  	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
  
***************
*** 1956,1962 **** _copyPlaceHolderInfo(PlaceHolderInfo *from)
   */
  
  static RangeTblEntry *
! _copyRangeTblEntry(RangeTblEntry *from)
  {
  	RangeTblEntry *newnode = makeNode(RangeTblEntry);
  
--- 1956,1962 ----
   */
  
  static RangeTblEntry *
! _copyRangeTblEntry(const RangeTblEntry *from)
  {
  	RangeTblEntry *newnode = makeNode(RangeTblEntry);
  
***************
*** 1991,1997 **** _copyRangeTblEntry(RangeTblEntry *from)
  }
  
  static SortGroupClause *
! _copySortGroupClause(SortGroupClause *from)
  {
  	SortGroupClause *newnode = makeNode(SortGroupClause);
  
--- 1991,1997 ----
  }
  
  static SortGroupClause *
! _copySortGroupClause(const SortGroupClause *from)
  {
  	SortGroupClause *newnode = makeNode(SortGroupClause);
  
***************
*** 2005,2011 **** _copySortGroupClause(SortGroupClause *from)
  }
  
  static WindowClause *
! _copyWindowClause(WindowClause *from)
  {
  	WindowClause *newnode = makeNode(WindowClause);
  
--- 2005,2011 ----
  }
  
  static WindowClause *
! _copyWindowClause(const WindowClause *from)
  {
  	WindowClause *newnode = makeNode(WindowClause);
  
***************
*** 2023,2029 **** _copyWindowClause(WindowClause *from)
  }
  
  static RowMarkClause *
! _copyRowMarkClause(RowMarkClause *from)
  {
  	RowMarkClause *newnode = makeNode(RowMarkClause);
  
--- 2023,2029 ----
  }
  
  static RowMarkClause *
! _copyRowMarkClause(const RowMarkClause *from)
  {
  	RowMarkClause *newnode = makeNode(RowMarkClause);
  
***************
*** 2036,2042 **** _copyRowMarkClause(RowMarkClause *from)
  }
  
  static WithClause *
! _copyWithClause(WithClause *from)
  {
  	WithClause *newnode = makeNode(WithClause);
  
--- 2036,2042 ----
  }
  
  static WithClause *
! _copyWithClause(const WithClause *from)
  {
  	WithClause *newnode = makeNode(WithClause);
  
***************
*** 2048,2054 **** _copyWithClause(WithClause *from)
  }
  
  static CommonTableExpr *
! _copyCommonTableExpr(CommonTableExpr *from)
  {
  	CommonTableExpr *newnode = makeNode(CommonTableExpr);
  
--- 2048,2054 ----
  }
  
  static CommonTableExpr *
! _copyCommonTableExpr(const CommonTableExpr *from)
  {
  	CommonTableExpr *newnode = makeNode(CommonTableExpr);
  
***************
*** 2067,2073 **** _copyCommonTableExpr(CommonTableExpr *from)
  }
  
  static A_Expr *
! _copyAExpr(A_Expr *from)
  {
  	A_Expr	   *newnode = makeNode(A_Expr);
  
--- 2067,2073 ----
  }
  
  static A_Expr *
! _copyAExpr(const A_Expr *from)
  {
  	A_Expr	   *newnode = makeNode(A_Expr);
  
***************
*** 2081,2087 **** _copyAExpr(A_Expr *from)
  }
  
  static ColumnRef *
! _copyColumnRef(ColumnRef *from)
  {
  	ColumnRef  *newnode = makeNode(ColumnRef);
  
--- 2081,2087 ----
  }
  
  static ColumnRef *
! _copyColumnRef(const ColumnRef *from)
  {
  	ColumnRef  *newnode = makeNode(ColumnRef);
  
***************
*** 2092,2098 **** _copyColumnRef(ColumnRef *from)
  }
  
  static ParamRef *
! _copyParamRef(ParamRef *from)
  {
  	ParamRef   *newnode = makeNode(ParamRef);
  
--- 2092,2098 ----
  }
  
  static ParamRef *
! _copyParamRef(const ParamRef *from)
  {
  	ParamRef   *newnode = makeNode(ParamRef);
  
***************
*** 2103,2109 **** _copyParamRef(ParamRef *from)
  }
  
  static A_Const *
! _copyAConst(A_Const *from)
  {
  	A_Const    *newnode = makeNode(A_Const);
  
--- 2103,2109 ----
  }
  
  static A_Const *
! _copyAConst(const A_Const *from)
  {
  	A_Const    *newnode = makeNode(A_Const);
  
***************
*** 2134,2140 **** _copyAConst(A_Const *from)
  }
  
  static FuncCall *
! _copyFuncCall(FuncCall *from)
  {
  	FuncCall   *newnode = makeNode(FuncCall);
  
--- 2134,2140 ----
  }
  
  static FuncCall *
! _copyFuncCall(const FuncCall *from)
  {
  	FuncCall   *newnode = makeNode(FuncCall);
  
***************
*** 2151,2157 **** _copyFuncCall(FuncCall *from)
  }
  
  static A_Star *
! _copyAStar(A_Star *from)
  {
  	A_Star	   *newnode = makeNode(A_Star);
  
--- 2151,2157 ----
  }
  
  static A_Star *
! _copyAStar(const A_Star *from)
  {
  	A_Star	   *newnode = makeNode(A_Star);
  
***************
*** 2159,2165 **** _copyAStar(A_Star *from)
  }
  
  static A_Indices *
! _copyAIndices(A_Indices *from)
  {
  	A_Indices  *newnode = makeNode(A_Indices);
  
--- 2159,2165 ----
  }
  
  static A_Indices *
! _copyAIndices(const A_Indices *from)
  {
  	A_Indices  *newnode = makeNode(A_Indices);
  
***************
*** 2170,2176 **** _copyAIndices(A_Indices *from)
  }
  
  static A_Indirection *
! _copyA_Indirection(A_Indirection *from)
  {
  	A_Indirection *newnode = makeNode(A_Indirection);
  
--- 2170,2176 ----
  }
  
  static A_Indirection *
! _copyA_Indirection(const A_Indirection *from)
  {
  	A_Indirection *newnode = makeNode(A_Indirection);
  
***************
*** 2181,2187 **** _copyA_Indirection(A_Indirection *from)
  }
  
  static A_ArrayExpr *
! _copyA_ArrayExpr(A_ArrayExpr *from)
  {
  	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
  
--- 2181,2187 ----
  }
  
  static A_ArrayExpr *
! _copyA_ArrayExpr(const A_ArrayExpr *from)
  {
  	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
  
***************
*** 2192,2198 **** _copyA_ArrayExpr(A_ArrayExpr *from)
  }
  
  static ResTarget *
! _copyResTarget(ResTarget *from)
  {
  	ResTarget  *newnode = makeNode(ResTarget);
  
--- 2192,2198 ----
  }
  
  static ResTarget *
! _copyResTarget(const ResTarget *from)
  {
  	ResTarget  *newnode = makeNode(ResTarget);
  
***************
*** 2205,2211 **** _copyResTarget(ResTarget *from)
  }
  
  static TypeName *
! _copyTypeName(TypeName *from)
  {
  	TypeName   *newnode = makeNode(TypeName);
  
--- 2205,2211 ----
  }
  
  static TypeName *
! _copyTypeName(const TypeName *from)
  {
  	TypeName   *newnode = makeNode(TypeName);
  
***************
*** 2222,2228 **** _copyTypeName(TypeName *from)
  }
  
  static SortBy *
! _copySortBy(SortBy *from)
  {
  	SortBy	   *newnode = makeNode(SortBy);
  
--- 2222,2228 ----
  }
  
  static SortBy *
! _copySortBy(const SortBy *from)
  {
  	SortBy	   *newnode = makeNode(SortBy);
  
***************
*** 2236,2242 **** _copySortBy(SortBy *from)
  }
  
  static WindowDef *
! _copyWindowDef(WindowDef *from)
  {
  	WindowDef  *newnode = makeNode(WindowDef);
  
--- 2236,2242 ----
  }
  
  static WindowDef *
! _copyWindowDef(const WindowDef *from)
  {
  	WindowDef  *newnode = makeNode(WindowDef);
  
***************
*** 2253,2259 **** _copyWindowDef(WindowDef *from)
  }
  
  static RangeSubselect *
! _copyRangeSubselect(RangeSubselect *from)
  {
  	RangeSubselect *newnode = makeNode(RangeSubselect);
  
--- 2253,2259 ----
  }
  
  static RangeSubselect *
! _copyRangeSubselect(const RangeSubselect *from)
  {
  	RangeSubselect *newnode = makeNode(RangeSubselect);
  
***************
*** 2264,2270 **** _copyRangeSubselect(RangeSubselect *from)
  }
  
  static RangeFunction *
! _copyRangeFunction(RangeFunction *from)
  {
  	RangeFunction *newnode = makeNode(RangeFunction);
  
--- 2264,2270 ----
  }
  
  static RangeFunction *
! _copyRangeFunction(const RangeFunction *from)
  {
  	RangeFunction *newnode = makeNode(RangeFunction);
  
***************
*** 2276,2282 **** _copyRangeFunction(RangeFunction *from)
  }
  
  static TypeCast *
! _copyTypeCast(TypeCast *from)
  {
  	TypeCast   *newnode = makeNode(TypeCast);
  
--- 2276,2282 ----
  }
  
  static TypeCast *
! _copyTypeCast(const TypeCast *from)
  {
  	TypeCast   *newnode = makeNode(TypeCast);
  
***************
*** 2288,2294 **** _copyTypeCast(TypeCast *from)
  }
  
  static CollateClause *
! _copyCollateClause(CollateClause *from)
  {
  	CollateClause *newnode = makeNode(CollateClause);
  
--- 2288,2294 ----
  }
  
  static CollateClause *
! _copyCollateClause(const CollateClause *from)
  {
  	CollateClause *newnode = makeNode(CollateClause);
  
***************
*** 2300,2306 **** _copyCollateClause(CollateClause *from)
  }
  
  static IndexElem *
! _copyIndexElem(IndexElem *from)
  {
  	IndexElem  *newnode = makeNode(IndexElem);
  
--- 2300,2306 ----
  }
  
  static IndexElem *
! _copyIndexElem(const IndexElem *from)
  {
  	IndexElem  *newnode = makeNode(IndexElem);
  
***************
*** 2316,2322 **** _copyIndexElem(IndexElem *from)
  }
  
  static ColumnDef *
! _copyColumnDef(ColumnDef *from)
  {
  	ColumnDef  *newnode = makeNode(ColumnDef);
  
--- 2316,2322 ----
  }
  
  static ColumnDef *
! _copyColumnDef(const ColumnDef *from)
  {
  	ColumnDef  *newnode = makeNode(ColumnDef);
  
***************
*** 2338,2344 **** _copyColumnDef(ColumnDef *from)
  }
  
  static Constraint *
! _copyConstraint(Constraint *from)
  {
  	Constraint *newnode = makeNode(Constraint);
  
--- 2338,2344 ----
  }
  
  static Constraint *
! _copyConstraint(const Constraint *from)
  {
  	Constraint *newnode = makeNode(Constraint);
  
***************
*** 2369,2375 **** _copyConstraint(Constraint *from)
  }
  
  static DefElem *
! _copyDefElem(DefElem *from)
  {
  	DefElem    *newnode = makeNode(DefElem);
  
--- 2369,2375 ----
  }
  
  static DefElem *
! _copyDefElem(const DefElem *from)
  {
  	DefElem    *newnode = makeNode(DefElem);
  
***************
*** 2382,2388 **** _copyDefElem(DefElem *from)
  }
  
  static LockingClause *
! _copyLockingClause(LockingClause *from)
  {
  	LockingClause *newnode = makeNode(LockingClause);
  
--- 2382,2388 ----
  }
  
  static LockingClause *
! _copyLockingClause(const LockingClause *from)
  {
  	LockingClause *newnode = makeNode(LockingClause);
  
***************
*** 2394,2400 **** _copyLockingClause(LockingClause *from)
  }
  
  static XmlSerialize *
! _copyXmlSerialize(XmlSerialize *from)
  {
  	XmlSerialize *newnode = makeNode(XmlSerialize);
  
--- 2394,2400 ----
  }
  
  static XmlSerialize *
! _copyXmlSerialize(const XmlSerialize *from)
  {
  	XmlSerialize *newnode = makeNode(XmlSerialize);
  
***************
*** 2407,2413 **** _copyXmlSerialize(XmlSerialize *from)
  }
  
  static Query *
! _copyQuery(Query *from)
  {
  	Query	   *newnode = makeNode(Query);
  
--- 2407,2413 ----
  }
  
  static Query *
! _copyQuery(const Query *from)
  {
  	Query	   *newnode = makeNode(Query);
  
***************
*** 2444,2450 **** _copyQuery(Query *from)
  }
  
  static InsertStmt *
! _copyInsertStmt(InsertStmt *from)
  {
  	InsertStmt *newnode = makeNode(InsertStmt);
  
--- 2444,2450 ----
  }
  
  static InsertStmt *
! _copyInsertStmt(const InsertStmt *from)
  {
  	InsertStmt *newnode = makeNode(InsertStmt);
  
***************
*** 2458,2464 **** _copyInsertStmt(InsertStmt *from)
  }
  
  static DeleteStmt *
! _copyDeleteStmt(DeleteStmt *from)
  {
  	DeleteStmt *newnode = makeNode(DeleteStmt);
  
--- 2458,2464 ----
  }
  
  static DeleteStmt *
! _copyDeleteStmt(const DeleteStmt *from)
  {
  	DeleteStmt *newnode = makeNode(DeleteStmt);
  
***************
*** 2472,2478 **** _copyDeleteStmt(DeleteStmt *from)
  }
  
  static UpdateStmt *
! _copyUpdateStmt(UpdateStmt *from)
  {
  	UpdateStmt *newnode = makeNode(UpdateStmt);
  
--- 2472,2478 ----
  }
  
  static UpdateStmt *
! _copyUpdateStmt(const UpdateStmt *from)
  {
  	UpdateStmt *newnode = makeNode(UpdateStmt);
  
***************
*** 2487,2493 **** _copyUpdateStmt(UpdateStmt *from)
  }
  
  static SelectStmt *
! _copySelectStmt(SelectStmt *from)
  {
  	SelectStmt *newnode = makeNode(SelectStmt);
  
--- 2487,2493 ----
  }
  
  static SelectStmt *
! _copySelectStmt(const SelectStmt *from)
  {
  	SelectStmt *newnode = makeNode(SelectStmt);
  
***************
*** 2514,2520 **** _copySelectStmt(SelectStmt *from)
  }
  
  static SetOperationStmt *
! _copySetOperationStmt(SetOperationStmt *from)
  {
  	SetOperationStmt *newnode = makeNode(SetOperationStmt);
  
--- 2514,2520 ----
  }
  
  static SetOperationStmt *
! _copySetOperationStmt(const SetOperationStmt *from)
  {
  	SetOperationStmt *newnode = makeNode(SetOperationStmt);
  
***************
*** 2531,2537 **** _copySetOperationStmt(SetOperationStmt *from)
  }
  
  static AlterTableStmt *
! _copyAlterTableStmt(AlterTableStmt *from)
  {
  	AlterTableStmt *newnode = makeNode(AlterTableStmt);
  
--- 2531,2537 ----
  }
  
  static AlterTableStmt *
! _copyAlterTableStmt(const AlterTableStmt *from)
  {
  	AlterTableStmt *newnode = makeNode(AlterTableStmt);
  
***************
*** 2543,2549 **** _copyAlterTableStmt(AlterTableStmt *from)
  }
  
  static AlterTableCmd *
! _copyAlterTableCmd(AlterTableCmd *from)
  {
  	AlterTableCmd *newnode = makeNode(AlterTableCmd);
  
--- 2543,2549 ----
  }
  
  static AlterTableCmd *
! _copyAlterTableCmd(const AlterTableCmd *from)
  {
  	AlterTableCmd *newnode = makeNode(AlterTableCmd);
  
***************
*** 2557,2563 **** _copyAlterTableCmd(AlterTableCmd *from)
  }
  
  static AlterDomainStmt *
! _copyAlterDomainStmt(AlterDomainStmt *from)
  {
  	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
  
--- 2557,2563 ----
  }
  
  static AlterDomainStmt *
! _copyAlterDomainStmt(const AlterDomainStmt *from)
  {
  	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
  
***************
*** 2571,2577 **** _copyAlterDomainStmt(AlterDomainStmt *from)
  }
  
  static GrantStmt *
! _copyGrantStmt(GrantStmt *from)
  {
  	GrantStmt  *newnode = makeNode(GrantStmt);
  
--- 2571,2577 ----
  }
  
  static GrantStmt *
! _copyGrantStmt(const GrantStmt *from)
  {
  	GrantStmt  *newnode = makeNode(GrantStmt);
  
***************
*** 2588,2594 **** _copyGrantStmt(GrantStmt *from)
  }
  
  static PrivGrantee *
! _copyPrivGrantee(PrivGrantee *from)
  {
  	PrivGrantee *newnode = makeNode(PrivGrantee);
  
--- 2588,2594 ----
  }
  
  static PrivGrantee *
! _copyPrivGrantee(const PrivGrantee *from)
  {
  	PrivGrantee *newnode = makeNode(PrivGrantee);
  
***************
*** 2598,2604 **** _copyPrivGrantee(PrivGrantee *from)
  }
  
  static FuncWithArgs *
! _copyFuncWithArgs(FuncWithArgs *from)
  {
  	FuncWithArgs *newnode = makeNode(FuncWithArgs);
  
--- 2598,2604 ----
  }
  
  static FuncWithArgs *
! _copyFuncWithArgs(const FuncWithArgs *from)
  {
  	FuncWithArgs *newnode = makeNode(FuncWithArgs);
  
***************
*** 2609,2615 **** _copyFuncWithArgs(FuncWithArgs *from)
  }
  
  static AccessPriv *
! _copyAccessPriv(AccessPriv *from)
  {
  	AccessPriv *newnode = makeNode(AccessPriv);
  
--- 2609,2615 ----
  }
  
  static AccessPriv *
! _copyAccessPriv(const AccessPriv *from)
  {
  	AccessPriv *newnode = makeNode(AccessPriv);
  
***************
*** 2620,2626 **** _copyAccessPriv(AccessPriv *from)
  }
  
  static GrantRoleStmt *
! _copyGrantRoleStmt(GrantRoleStmt *from)
  {
  	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
  
--- 2620,2626 ----
  }
  
  static GrantRoleStmt *
! _copyGrantRoleStmt(const GrantRoleStmt *from)
  {
  	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
  
***************
*** 2635,2641 **** _copyGrantRoleStmt(GrantRoleStmt *from)
  }
  
  static AlterDefaultPrivilegesStmt *
! _copyAlterDefaultPrivilegesStmt(AlterDefaultPrivilegesStmt *from)
  {
  	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
  
--- 2635,2641 ----
  }
  
  static AlterDefaultPrivilegesStmt *
! _copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
  {
  	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
  
***************
*** 2646,2652 **** _copyAlterDefaultPrivilegesStmt(AlterDefaultPrivilegesStmt *from)
  }
  
  static DeclareCursorStmt *
! _copyDeclareCursorStmt(DeclareCursorStmt *from)
  {
  	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
  
--- 2646,2652 ----
  }
  
  static DeclareCursorStmt *
! _copyDeclareCursorStmt(const DeclareCursorStmt *from)
  {
  	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
  
***************
*** 2658,2664 **** _copyDeclareCursorStmt(DeclareCursorStmt *from)
  }
  
  static ClosePortalStmt *
! _copyClosePortalStmt(ClosePortalStmt *from)
  {
  	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
  
--- 2658,2664 ----
  }
  
  static ClosePortalStmt *
! _copyClosePortalStmt(const ClosePortalStmt *from)
  {
  	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
  
***************
*** 2668,2674 **** _copyClosePortalStmt(ClosePortalStmt *from)
  }
  
  static ClusterStmt *
! _copyClusterStmt(ClusterStmt *from)
  {
  	ClusterStmt *newnode = makeNode(ClusterStmt);
  
--- 2668,2674 ----
  }
  
  static ClusterStmt *
! _copyClusterStmt(const ClusterStmt *from)
  {
  	ClusterStmt *newnode = makeNode(ClusterStmt);
  
***************
*** 2680,2686 **** _copyClusterStmt(ClusterStmt *from)
  }
  
  static CopyStmt *
! _copyCopyStmt(CopyStmt *from)
  {
  	CopyStmt   *newnode = makeNode(CopyStmt);
  
--- 2680,2686 ----
  }
  
  static CopyStmt *
! _copyCopyStmt(const CopyStmt *from)
  {
  	CopyStmt   *newnode = makeNode(CopyStmt);
  
***************
*** 2701,2707 **** _copyCopyStmt(CopyStmt *from)
   *		copy functions for classes which inherit from CreateStmt.
   */
  static void
! CopyCreateStmtFields(CreateStmt *from, CreateStmt *newnode)
  {
  	COPY_NODE_FIELD(relation);
  	COPY_NODE_FIELD(tableElts);
--- 2701,2707 ----
   *		copy functions for classes which inherit from CreateStmt.
   */
  static void
! CopyCreateStmtFields(const CreateStmt *from, CreateStmt *newnode)
  {
  	COPY_NODE_FIELD(relation);
  	COPY_NODE_FIELD(tableElts);
***************
*** 2715,2721 **** CopyCreateStmtFields(CreateStmt *from, CreateStmt *newnode)
  }
  
  static CreateStmt *
! _copyCreateStmt(CreateStmt *from)
  {
  	CreateStmt *newnode = makeNode(CreateStmt);
  
--- 2715,2721 ----
  }
  
  static CreateStmt *
! _copyCreateStmt(const CreateStmt *from)
  {
  	CreateStmt *newnode = makeNode(CreateStmt);
  
***************
*** 2725,2731 **** _copyCreateStmt(CreateStmt *from)
  }
  
  static InhRelation *
! _copyInhRelation(InhRelation *from)
  {
  	InhRelation *newnode = makeNode(InhRelation);
  
--- 2725,2731 ----
  }
  
  static InhRelation *
! _copyInhRelation(const InhRelation *from)
  {
  	InhRelation *newnode = makeNode(InhRelation);
  
***************
*** 2736,2742 **** _copyInhRelation(InhRelation *from)
  }
  
  static DefineStmt *
! _copyDefineStmt(DefineStmt *from)
  {
  	DefineStmt *newnode = makeNode(DefineStmt);
  
--- 2736,2742 ----
  }
  
  static DefineStmt *
! _copyDefineStmt(const DefineStmt *from)
  {
  	DefineStmt *newnode = makeNode(DefineStmt);
  
***************
*** 2750,2756 **** _copyDefineStmt(DefineStmt *from)
  }
  
  static DropStmt *
! _copyDropStmt(DropStmt *from)
  {
  	DropStmt   *newnode = makeNode(DropStmt);
  
--- 2750,2756 ----
  }
  
  static DropStmt *
! _copyDropStmt(const DropStmt *from)
  {
  	DropStmt   *newnode = makeNode(DropStmt);
  
***************
*** 2763,2769 **** _copyDropStmt(DropStmt *from)
  }
  
  static TruncateStmt *
! _copyTruncateStmt(TruncateStmt *from)
  {
  	TruncateStmt *newnode = makeNode(TruncateStmt);
  
--- 2763,2769 ----
  }
  
  static TruncateStmt *
! _copyTruncateStmt(const TruncateStmt *from)
  {
  	TruncateStmt *newnode = makeNode(TruncateStmt);
  
***************
*** 2775,2781 **** _copyTruncateStmt(TruncateStmt *from)
  }
  
  static CommentStmt *
! _copyCommentStmt(CommentStmt *from)
  {
  	CommentStmt *newnode = makeNode(CommentStmt);
  
--- 2775,2781 ----
  }
  
  static CommentStmt *
! _copyCommentStmt(const CommentStmt *from)
  {
  	CommentStmt *newnode = makeNode(CommentStmt);
  
***************
*** 2788,2794 **** _copyCommentStmt(CommentStmt *from)
  }
  
  static SecLabelStmt *
! _copySecLabelStmt(SecLabelStmt *from)
  {
  	SecLabelStmt *newnode = makeNode(SecLabelStmt);
  
--- 2788,2794 ----
  }
  
  static SecLabelStmt *
! _copySecLabelStmt(const SecLabelStmt *from)
  {
  	SecLabelStmt *newnode = makeNode(SecLabelStmt);
  
***************
*** 2802,2808 **** _copySecLabelStmt(SecLabelStmt *from)
  }
  
  static FetchStmt *
! _copyFetchStmt(FetchStmt *from)
  {
  	FetchStmt  *newnode = makeNode(FetchStmt);
  
--- 2802,2808 ----
  }
  
  static FetchStmt *
! _copyFetchStmt(const FetchStmt *from)
  {
  	FetchStmt  *newnode = makeNode(FetchStmt);
  
***************
*** 2815,2821 **** _copyFetchStmt(FetchStmt *from)
  }
  
  static IndexStmt *
! _copyIndexStmt(IndexStmt *from)
  {
  	IndexStmt  *newnode = makeNode(IndexStmt);
  
--- 2815,2821 ----
  }
  
  static IndexStmt *
! _copyIndexStmt(const IndexStmt *from)
  {
  	IndexStmt  *newnode = makeNode(IndexStmt);
  
***************
*** 2840,2846 **** _copyIndexStmt(IndexStmt *from)
  }
  
  static CreateFunctionStmt *
! _copyCreateFunctionStmt(CreateFunctionStmt *from)
  {
  	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
  
--- 2840,2846 ----
  }
  
  static CreateFunctionStmt *
! _copyCreateFunctionStmt(const CreateFunctionStmt *from)
  {
  	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
  
***************
*** 2855,2861 **** _copyCreateFunctionStmt(CreateFunctionStmt *from)
  }
  
  static FunctionParameter *
! _copyFunctionParameter(FunctionParameter *from)
  {
  	FunctionParameter *newnode = makeNode(FunctionParameter);
  
--- 2855,2861 ----
  }
  
  static FunctionParameter *
! _copyFunctionParameter(const FunctionParameter *from)
  {
  	FunctionParameter *newnode = makeNode(FunctionParameter);
  
***************
*** 2868,2874 **** _copyFunctionParameter(FunctionParameter *from)
  }
  
  static AlterFunctionStmt *
! _copyAlterFunctionStmt(AlterFunctionStmt *from)
  {
  	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
  
--- 2868,2874 ----
  }
  
  static AlterFunctionStmt *
! _copyAlterFunctionStmt(const AlterFunctionStmt *from)
  {
  	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
  
***************
*** 2879,2885 **** _copyAlterFunctionStmt(AlterFunctionStmt *from)
  }
  
  static RemoveFuncStmt *
! _copyRemoveFuncStmt(RemoveFuncStmt *from)
  {
  	RemoveFuncStmt *newnode = makeNode(RemoveFuncStmt);
  
--- 2879,2885 ----
  }
  
  static RemoveFuncStmt *
! _copyRemoveFuncStmt(const RemoveFuncStmt *from)
  {
  	RemoveFuncStmt *newnode = makeNode(RemoveFuncStmt);
  
***************
*** 2893,2899 **** _copyRemoveFuncStmt(RemoveFuncStmt *from)
  }
  
  static DoStmt *
! _copyDoStmt(DoStmt *from)
  {
  	DoStmt	   *newnode = makeNode(DoStmt);
  
--- 2893,2899 ----
  }
  
  static DoStmt *
! _copyDoStmt(const DoStmt *from)
  {
  	DoStmt	   *newnode = makeNode(DoStmt);
  
***************
*** 2903,2909 **** _copyDoStmt(DoStmt *from)
  }
  
  static RemoveOpClassStmt *
! _copyRemoveOpClassStmt(RemoveOpClassStmt *from)
  {
  	RemoveOpClassStmt *newnode = makeNode(RemoveOpClassStmt);
  
--- 2903,2909 ----
  }
  
  static RemoveOpClassStmt *
! _copyRemoveOpClassStmt(const RemoveOpClassStmt *from)
  {
  	RemoveOpClassStmt *newnode = makeNode(RemoveOpClassStmt);
  
***************
*** 2916,2922 **** _copyRemoveOpClassStmt(RemoveOpClassStmt *from)
  }
  
  static RemoveOpFamilyStmt *
! _copyRemoveOpFamilyStmt(RemoveOpFamilyStmt *from)
  {
  	RemoveOpFamilyStmt *newnode = makeNode(RemoveOpFamilyStmt);
  
--- 2916,2922 ----
  }
  
  static RemoveOpFamilyStmt *
! _copyRemoveOpFamilyStmt(const RemoveOpFamilyStmt *from)
  {
  	RemoveOpFamilyStmt *newnode = makeNode(RemoveOpFamilyStmt);
  
***************
*** 2929,2935 **** _copyRemoveOpFamilyStmt(RemoveOpFamilyStmt *from)
  }
  
  static RenameStmt *
! _copyRenameStmt(RenameStmt *from)
  {
  	RenameStmt *newnode = makeNode(RenameStmt);
  
--- 2929,2935 ----
  }
  
  static RenameStmt *
! _copyRenameStmt(const RenameStmt *from)
  {
  	RenameStmt *newnode = makeNode(RenameStmt);
  
***************
*** 2945,2951 **** _copyRenameStmt(RenameStmt *from)
  }
  
  static AlterObjectSchemaStmt *
! _copyAlterObjectSchemaStmt(AlterObjectSchemaStmt *from)
  {
  	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
  
--- 2945,2951 ----
  }
  
  static AlterObjectSchemaStmt *
! _copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
  {
  	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
  
***************
*** 2960,2966 **** _copyAlterObjectSchemaStmt(AlterObjectSchemaStmt *from)
  }
  
  static AlterOwnerStmt *
! _copyAlterOwnerStmt(AlterOwnerStmt *from)
  {
  	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
  
--- 2960,2966 ----
  }
  
  static AlterOwnerStmt *
! _copyAlterOwnerStmt(const AlterOwnerStmt *from)
  {
  	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
  
***************
*** 2975,2981 **** _copyAlterOwnerStmt(AlterOwnerStmt *from)
  }
  
  static RuleStmt *
! _copyRuleStmt(RuleStmt *from)
  {
  	RuleStmt   *newnode = makeNode(RuleStmt);
  
--- 2975,2981 ----
  }
  
  static RuleStmt *
! _copyRuleStmt(const RuleStmt *from)
  {
  	RuleStmt   *newnode = makeNode(RuleStmt);
  
***************
*** 2991,2997 **** _copyRuleStmt(RuleStmt *from)
  }
  
  static NotifyStmt *
! _copyNotifyStmt(NotifyStmt *from)
  {
  	NotifyStmt *newnode = makeNode(NotifyStmt);
  
--- 2991,2997 ----
  }
  
  static NotifyStmt *
! _copyNotifyStmt(const NotifyStmt *from)
  {
  	NotifyStmt *newnode = makeNode(NotifyStmt);
  
***************
*** 3002,3008 **** _copyNotifyStmt(NotifyStmt *from)
  }
  
  static ListenStmt *
! _copyListenStmt(ListenStmt *from)
  {
  	ListenStmt *newnode = makeNode(ListenStmt);
  
--- 3002,3008 ----
  }
  
  static ListenStmt *
! _copyListenStmt(const ListenStmt *from)
  {
  	ListenStmt *newnode = makeNode(ListenStmt);
  
***************
*** 3012,3018 **** _copyListenStmt(ListenStmt *from)
  }
  
  static UnlistenStmt *
! _copyUnlistenStmt(UnlistenStmt *from)
  {
  	UnlistenStmt *newnode = makeNode(UnlistenStmt);
  
--- 3012,3018 ----
  }
  
  static UnlistenStmt *
! _copyUnlistenStmt(const UnlistenStmt *from)
  {
  	UnlistenStmt *newnode = makeNode(UnlistenStmt);
  
***************
*** 3022,3028 **** _copyUnlistenStmt(UnlistenStmt *from)
  }
  
  static TransactionStmt *
! _copyTransactionStmt(TransactionStmt *from)
  {
  	TransactionStmt *newnode = makeNode(TransactionStmt);
  
--- 3022,3028 ----
  }
  
  static TransactionStmt *
! _copyTransactionStmt(const TransactionStmt *from)
  {
  	TransactionStmt *newnode = makeNode(TransactionStmt);
  
***************
*** 3034,3040 **** _copyTransactionStmt(TransactionStmt *from)
  }
  
  static CompositeTypeStmt *
! _copyCompositeTypeStmt(CompositeTypeStmt *from)
  {
  	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
  
--- 3034,3040 ----
  }
  
  static CompositeTypeStmt *
! _copyCompositeTypeStmt(const CompositeTypeStmt *from)
  {
  	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
  
***************
*** 3045,3051 **** _copyCompositeTypeStmt(CompositeTypeStmt *from)
  }
  
  static CreateEnumStmt *
! _copyCreateEnumStmt(CreateEnumStmt *from)
  {
  	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
  
--- 3045,3051 ----
  }
  
  static CreateEnumStmt *
! _copyCreateEnumStmt(const CreateEnumStmt *from)
  {
  	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
  
***************
*** 3056,3062 **** _copyCreateEnumStmt(CreateEnumStmt *from)
  }
  
  static CreateRangeStmt *
! _copyCreateRangeStmt(CreateRangeStmt *from)
  {
  	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
  
--- 3056,3062 ----
  }
  
  static CreateRangeStmt *
! _copyCreateRangeStmt(const CreateRangeStmt *from)
  {
  	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
  
***************
*** 3067,3073 **** _copyCreateRangeStmt(CreateRangeStmt *from)
  }
  
  static AlterEnumStmt *
! _copyAlterEnumStmt(AlterEnumStmt *from)
  {
  	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
  
--- 3067,3073 ----
  }
  
  static AlterEnumStmt *
! _copyAlterEnumStmt(const AlterEnumStmt *from)
  {
  	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
  
***************
*** 3080,3086 **** _copyAlterEnumStmt(AlterEnumStmt *from)
  }
  
  static ViewStmt *
! _copyViewStmt(ViewStmt *from)
  {
  	ViewStmt   *newnode = makeNode(ViewStmt);
  
--- 3080,3086 ----
  }
  
  static ViewStmt *
! _copyViewStmt(const ViewStmt *from)
  {
  	ViewStmt   *newnode = makeNode(ViewStmt);
  
***************
*** 3093,3099 **** _copyViewStmt(ViewStmt *from)
  }
  
  static LoadStmt *
! _copyLoadStmt(LoadStmt *from)
  {
  	LoadStmt   *newnode = makeNode(LoadStmt);
  
--- 3093,3099 ----
  }
  
  static LoadStmt *
! _copyLoadStmt(const LoadStmt *from)
  {
  	LoadStmt   *newnode = makeNode(LoadStmt);
  
***************
*** 3103,3109 **** _copyLoadStmt(LoadStmt *from)
  }
  
  static CreateDomainStmt *
! _copyCreateDomainStmt(CreateDomainStmt *from)
  {
  	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
  
--- 3103,3109 ----
  }
  
  static CreateDomainStmt *
! _copyCreateDomainStmt(const CreateDomainStmt *from)
  {
  	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
  
***************
*** 3116,3122 **** _copyCreateDomainStmt(CreateDomainStmt *from)
  }
  
  static CreateOpClassStmt *
! _copyCreateOpClassStmt(CreateOpClassStmt *from)
  {
  	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
  
--- 3116,3122 ----
  }
  
  static CreateOpClassStmt *
! _copyCreateOpClassStmt(const CreateOpClassStmt *from)
  {
  	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
  
***************
*** 3131,3137 **** _copyCreateOpClassStmt(CreateOpClassStmt *from)
  }
  
  static CreateOpClassItem *
! _copyCreateOpClassItem(CreateOpClassItem *from)
  {
  	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
  
--- 3131,3137 ----
  }
  
  static CreateOpClassItem *
! _copyCreateOpClassItem(const CreateOpClassItem *from)
  {
  	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
  
***************
*** 3147,3153 **** _copyCreateOpClassItem(CreateOpClassItem *from)
  }
  
  static CreateOpFamilyStmt *
! _copyCreateOpFamilyStmt(CreateOpFamilyStmt *from)
  {
  	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
  
--- 3147,3153 ----
  }
  
  static CreateOpFamilyStmt *
! _copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
  {
  	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
  
***************
*** 3158,3164 **** _copyCreateOpFamilyStmt(CreateOpFamilyStmt *from)
  }
  
  static AlterOpFamilyStmt *
! _copyAlterOpFamilyStmt(AlterOpFamilyStmt *from)
  {
  	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
  
--- 3158,3164 ----
  }
  
  static AlterOpFamilyStmt *
! _copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
  {
  	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
  
***************
*** 3171,3177 **** _copyAlterOpFamilyStmt(AlterOpFamilyStmt *from)
  }
  
  static CreatedbStmt *
! _copyCreatedbStmt(CreatedbStmt *from)
  {
  	CreatedbStmt *newnode = makeNode(CreatedbStmt);
  
--- 3171,3177 ----
  }
  
  static CreatedbStmt *
! _copyCreatedbStmt(const CreatedbStmt *from)
  {
  	CreatedbStmt *newnode = makeNode(CreatedbStmt);
  
***************
*** 3182,3188 **** _copyCreatedbStmt(CreatedbStmt *from)
  }
  
  static AlterDatabaseStmt *
! _copyAlterDatabaseStmt(AlterDatabaseStmt *from)
  {
  	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
  
--- 3182,3188 ----
  }
  
  static AlterDatabaseStmt *
! _copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
  {
  	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
  
***************
*** 3193,3199 **** _copyAlterDatabaseStmt(AlterDatabaseStmt *from)
  }
  
  static AlterDatabaseSetStmt *
! _copyAlterDatabaseSetStmt(AlterDatabaseSetStmt *from)
  {
  	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
  
--- 3193,3199 ----
  }
  
  static AlterDatabaseSetStmt *
! _copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
  {
  	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
  
***************
*** 3204,3210 **** _copyAlterDatabaseSetStmt(AlterDatabaseSetStmt *from)
  }
  
  static DropdbStmt *
! _copyDropdbStmt(DropdbStmt *from)
  {
  	DropdbStmt *newnode = makeNode(DropdbStmt);
  
--- 3204,3210 ----
  }
  
  static DropdbStmt *
! _copyDropdbStmt(const DropdbStmt *from)
  {
  	DropdbStmt *newnode = makeNode(DropdbStmt);
  
***************
*** 3215,3221 **** _copyDropdbStmt(DropdbStmt *from)
  }
  
  static VacuumStmt *
! _copyVacuumStmt(VacuumStmt *from)
  {
  	VacuumStmt *newnode = makeNode(VacuumStmt);
  
--- 3215,3221 ----
  }
  
  static VacuumStmt *
! _copyVacuumStmt(const VacuumStmt *from)
  {
  	VacuumStmt *newnode = makeNode(VacuumStmt);
  
***************
*** 3229,3235 **** _copyVacuumStmt(VacuumStmt *from)
  }
  
  static ExplainStmt *
! _copyExplainStmt(ExplainStmt *from)
  {
  	ExplainStmt *newnode = makeNode(ExplainStmt);
  
--- 3229,3235 ----
  }
  
  static ExplainStmt *
! _copyExplainStmt(const ExplainStmt *from)
  {
  	ExplainStmt *newnode = makeNode(ExplainStmt);
  
***************
*** 3240,3246 **** _copyExplainStmt(ExplainStmt *from)
  }
  
  static CreateSeqStmt *
! _copyCreateSeqStmt(CreateSeqStmt *from)
  {
  	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
  
--- 3240,3246 ----
  }
  
  static CreateSeqStmt *
! _copyCreateSeqStmt(const CreateSeqStmt *from)
  {
  	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
  
***************
*** 3252,3258 **** _copyCreateSeqStmt(CreateSeqStmt *from)
  }
  
  static AlterSeqStmt *
! _copyAlterSeqStmt(AlterSeqStmt *from)
  {
  	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
  
--- 3252,3258 ----
  }
  
  static AlterSeqStmt *
! _copyAlterSeqStmt(const AlterSeqStmt *from)
  {
  	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
  
***************
*** 3263,3269 **** _copyAlterSeqStmt(AlterSeqStmt *from)
  }
  
  static VariableSetStmt *
! _copyVariableSetStmt(VariableSetStmt *from)
  {
  	VariableSetStmt *newnode = makeNode(VariableSetStmt);
  
--- 3263,3269 ----
  }
  
  static VariableSetStmt *
! _copyVariableSetStmt(const VariableSetStmt *from)
  {
  	VariableSetStmt *newnode = makeNode(VariableSetStmt);
  
***************
*** 3276,3282 **** _copyVariableSetStmt(VariableSetStmt *from)
  }
  
  static VariableShowStmt *
! _copyVariableShowStmt(VariableShowStmt *from)
  {
  	VariableShowStmt *newnode = makeNode(VariableShowStmt);
  
--- 3276,3282 ----
  }
  
  static VariableShowStmt *
! _copyVariableShowStmt(const VariableShowStmt *from)
  {
  	VariableShowStmt *newnode = makeNode(VariableShowStmt);
  
***************
*** 3286,3292 **** _copyVariableShowStmt(VariableShowStmt *from)
  }
  
  static DiscardStmt *
! _copyDiscardStmt(DiscardStmt *from)
  {
  	DiscardStmt *newnode = makeNode(DiscardStmt);
  
--- 3286,3292 ----
  }
  
  static DiscardStmt *
! _copyDiscardStmt(const DiscardStmt *from)
  {
  	DiscardStmt *newnode = makeNode(DiscardStmt);
  
***************
*** 3296,3302 **** _copyDiscardStmt(DiscardStmt *from)
  }
  
  static CreateTableSpaceStmt *
! _copyCreateTableSpaceStmt(CreateTableSpaceStmt *from)
  {
  	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
  
--- 3296,3302 ----
  }
  
  static CreateTableSpaceStmt *
! _copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
  {
  	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
  
***************
*** 3308,3314 **** _copyCreateTableSpaceStmt(CreateTableSpaceStmt *from)
  }
  
  static DropTableSpaceStmt *
! _copyDropTableSpaceStmt(DropTableSpaceStmt *from)
  {
  	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
  
--- 3308,3314 ----
  }
  
  static DropTableSpaceStmt *
! _copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
  {
  	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
  
***************
*** 3319,3325 **** _copyDropTableSpaceStmt(DropTableSpaceStmt *from)
  }
  
  static AlterTableSpaceOptionsStmt *
! _copyAlterTableSpaceOptionsStmt(AlterTableSpaceOptionsStmt *from)
  {
  	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
  
--- 3319,3325 ----
  }
  
  static AlterTableSpaceOptionsStmt *
! _copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
  {
  	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
  
***************
*** 3331,3337 **** _copyAlterTableSpaceOptionsStmt(AlterTableSpaceOptionsStmt *from)
  }
  
  static CreateExtensionStmt *
! _copyCreateExtensionStmt(CreateExtensionStmt *from)
  {
  	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
  
--- 3331,3337 ----
  }
  
  static CreateExtensionStmt *
! _copyCreateExtensionStmt(const CreateExtensionStmt *from)
  {
  	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
  
***************
*** 3343,3349 **** _copyCreateExtensionStmt(CreateExtensionStmt *from)
  }
  
  static AlterExtensionStmt *
! _copyAlterExtensionStmt(AlterExtensionStmt *from)
  {
  	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
  
--- 3343,3349 ----
  }
  
  static AlterExtensionStmt *
! _copyAlterExtensionStmt(const AlterExtensionStmt *from)
  {
  	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
  
***************
*** 3354,3360 **** _copyAlterExtensionStmt(AlterExtensionStmt *from)
  }
  
  static AlterExtensionContentsStmt *
! _copyAlterExtensionContentsStmt(AlterExtensionContentsStmt *from)
  {
  	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
  
--- 3354,3360 ----
  }
  
  static AlterExtensionContentsStmt *
! _copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
  {
  	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
  
***************
*** 3368,3374 **** _copyAlterExtensionContentsStmt(AlterExtensionContentsStmt *from)
  }
  
  static CreateFdwStmt *
! _copyCreateFdwStmt(CreateFdwStmt *from)
  {
  	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
  
--- 3368,3374 ----
  }
  
  static CreateFdwStmt *
! _copyCreateFdwStmt(const CreateFdwStmt *from)
  {
  	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
  
***************
*** 3380,3386 **** _copyCreateFdwStmt(CreateFdwStmt *from)
  }
  
  static AlterFdwStmt *
! _copyAlterFdwStmt(AlterFdwStmt *from)
  {
  	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
  
--- 3380,3386 ----
  }
  
  static AlterFdwStmt *
! _copyAlterFdwStmt(const AlterFdwStmt *from)
  {
  	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
  
***************
*** 3392,3398 **** _copyAlterFdwStmt(AlterFdwStmt *from)
  }
  
  static DropFdwStmt *
! _copyDropFdwStmt(DropFdwStmt *from)
  {
  	DropFdwStmt *newnode = makeNode(DropFdwStmt);
  
--- 3392,3398 ----
  }
  
  static DropFdwStmt *
! _copyDropFdwStmt(const DropFdwStmt *from)
  {
  	DropFdwStmt *newnode = makeNode(DropFdwStmt);
  
***************
*** 3404,3410 **** _copyDropFdwStmt(DropFdwStmt *from)
  }
  
  static CreateForeignServerStmt *
! _copyCreateForeignServerStmt(CreateForeignServerStmt *from)
  {
  	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
  
--- 3404,3410 ----
  }
  
  static CreateForeignServerStmt *
! _copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
  {
  	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
  
***************
*** 3418,3424 **** _copyCreateForeignServerStmt(CreateForeignServerStmt *from)
  }
  
  static AlterForeignServerStmt *
! _copyAlterForeignServerStmt(AlterForeignServerStmt *from)
  {
  	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
  
--- 3418,3424 ----
  }
  
  static AlterForeignServerStmt *
! _copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
  {
  	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
  
***************
*** 3431,3437 **** _copyAlterForeignServerStmt(AlterForeignServerStmt *from)
  }
  
  static DropForeignServerStmt *
! _copyDropForeignServerStmt(DropForeignServerStmt *from)
  {
  	DropForeignServerStmt *newnode = makeNode(DropForeignServerStmt);
  
--- 3431,3437 ----
  }
  
  static DropForeignServerStmt *
! _copyDropForeignServerStmt(const DropForeignServerStmt *from)
  {
  	DropForeignServerStmt *newnode = makeNode(DropForeignServerStmt);
  
***************
*** 3443,3449 **** _copyDropForeignServerStmt(DropForeignServerStmt *from)
  }
  
  static CreateUserMappingStmt *
! _copyCreateUserMappingStmt(CreateUserMappingStmt *from)
  {
  	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
  
--- 3443,3449 ----
  }
  
  static CreateUserMappingStmt *
! _copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
  {
  	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
  
***************
*** 3455,3461 **** _copyCreateUserMappingStmt(CreateUserMappingStmt *from)
  }
  
  static AlterUserMappingStmt *
! _copyAlterUserMappingStmt(AlterUserMappingStmt *from)
  {
  	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
  
--- 3455,3461 ----
  }
  
  static AlterUserMappingStmt *
! _copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
  {
  	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
  
***************
*** 3467,3473 **** _copyAlterUserMappingStmt(AlterUserMappingStmt *from)
  }
  
  static DropUserMappingStmt *
! _copyDropUserMappingStmt(DropUserMappingStmt *from)
  {
  	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
  
--- 3467,3473 ----
  }
  
  static DropUserMappingStmt *
! _copyDropUserMappingStmt(const DropUserMappingStmt *from)
  {
  	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
  
***************
*** 3479,3485 **** _copyDropUserMappingStmt(DropUserMappingStmt *from)
  }
  
  static CreateForeignTableStmt *
! _copyCreateForeignTableStmt(CreateForeignTableStmt *from)
  {
  	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
  
--- 3479,3485 ----
  }
  
  static CreateForeignTableStmt *
! _copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
  {
  	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
  
***************
*** 3492,3498 **** _copyCreateForeignTableStmt(CreateForeignTableStmt *from)
  }
  
  static CreateTrigStmt *
! _copyCreateTrigStmt(CreateTrigStmt *from)
  {
  	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
  
--- 3492,3498 ----
  }
  
  static CreateTrigStmt *
! _copyCreateTrigStmt(const CreateTrigStmt *from)
  {
  	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
  
***************
*** 3514,3520 **** _copyCreateTrigStmt(CreateTrigStmt *from)
  }
  
  static DropPropertyStmt *
! _copyDropPropertyStmt(DropPropertyStmt *from)
  {
  	DropPropertyStmt *newnode = makeNode(DropPropertyStmt);
  
--- 3514,3520 ----
  }
  
  static DropPropertyStmt *
! _copyDropPropertyStmt(const DropPropertyStmt *from)
  {
  	DropPropertyStmt *newnode = makeNode(DropPropertyStmt);
  
***************
*** 3528,3534 **** _copyDropPropertyStmt(DropPropertyStmt *from)
  }
  
  static CreatePLangStmt *
! _copyCreatePLangStmt(CreatePLangStmt *from)
  {
  	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
  
--- 3528,3534 ----
  }
  
  static CreatePLangStmt *
! _copyCreatePLangStmt(const CreatePLangStmt *from)
  {
  	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
  
***************
*** 3543,3549 **** _copyCreatePLangStmt(CreatePLangStmt *from)
  }
  
  static DropPLangStmt *
! _copyDropPLangStmt(DropPLangStmt *from)
  {
  	DropPLangStmt *newnode = makeNode(DropPLangStmt);
  
--- 3543,3549 ----
  }
  
  static DropPLangStmt *
! _copyDropPLangStmt(const DropPLangStmt *from)
  {
  	DropPLangStmt *newnode = makeNode(DropPLangStmt);
  
***************
*** 3555,3561 **** _copyDropPLangStmt(DropPLangStmt *from)
  }
  
  static CreateRoleStmt *
! _copyCreateRoleStmt(CreateRoleStmt *from)
  {
  	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
  
--- 3555,3561 ----
  }
  
  static CreateRoleStmt *
! _copyCreateRoleStmt(const CreateRoleStmt *from)
  {
  	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
  
***************
*** 3567,3573 **** _copyCreateRoleStmt(CreateRoleStmt *from)
  }
  
  static AlterRoleStmt *
! _copyAlterRoleStmt(AlterRoleStmt *from)
  {
  	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
  
--- 3567,3573 ----
  }
  
  static AlterRoleStmt *
! _copyAlterRoleStmt(const AlterRoleStmt *from)
  {
  	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
  
***************
*** 3579,3585 **** _copyAlterRoleStmt(AlterRoleStmt *from)
  }
  
  static AlterRoleSetStmt *
! _copyAlterRoleSetStmt(AlterRoleSetStmt *from)
  {
  	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
  
--- 3579,3585 ----
  }
  
  static AlterRoleSetStmt *
! _copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
  {
  	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
  
***************
*** 3591,3597 **** _copyAlterRoleSetStmt(AlterRoleSetStmt *from)
  }
  
  static DropRoleStmt *
! _copyDropRoleStmt(DropRoleStmt *from)
  {
  	DropRoleStmt *newnode = makeNode(DropRoleStmt);
  
--- 3591,3597 ----
  }
  
  static DropRoleStmt *
! _copyDropRoleStmt(const DropRoleStmt *from)
  {
  	DropRoleStmt *newnode = makeNode(DropRoleStmt);
  
***************
*** 3602,3608 **** _copyDropRoleStmt(DropRoleStmt *from)
  }
  
  static LockStmt *
! _copyLockStmt(LockStmt *from)
  {
  	LockStmt   *newnode = makeNode(LockStmt);
  
--- 3602,3608 ----
  }
  
  static LockStmt *
! _copyLockStmt(const LockStmt *from)
  {
  	LockStmt   *newnode = makeNode(LockStmt);
  
***************
*** 3614,3620 **** _copyLockStmt(LockStmt *from)
  }
  
  static ConstraintsSetStmt *
! _copyConstraintsSetStmt(ConstraintsSetStmt *from)
  {
  	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
  
--- 3614,3620 ----
  }
  
  static ConstraintsSetStmt *
! _copyConstraintsSetStmt(const ConstraintsSetStmt *from)
  {
  	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
  
***************
*** 3625,3631 **** _copyConstraintsSetStmt(ConstraintsSetStmt *from)
  }
  
  static ReindexStmt *
! _copyReindexStmt(ReindexStmt *from)
  {
  	ReindexStmt *newnode = makeNode(ReindexStmt);
  
--- 3625,3631 ----
  }
  
  static ReindexStmt *
! _copyReindexStmt(const ReindexStmt *from)
  {
  	ReindexStmt *newnode = makeNode(ReindexStmt);
  
***************
*** 3639,3645 **** _copyReindexStmt(ReindexStmt *from)
  }
  
  static CreateSchemaStmt *
! _copyCreateSchemaStmt(CreateSchemaStmt *from)
  {
  	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
  
--- 3639,3645 ----
  }
  
  static CreateSchemaStmt *
! _copyCreateSchemaStmt(const CreateSchemaStmt *from)
  {
  	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
  
***************
*** 3651,3657 **** _copyCreateSchemaStmt(CreateSchemaStmt *from)
  }
  
  static CreateConversionStmt *
! _copyCreateConversionStmt(CreateConversionStmt *from)
  {
  	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
  
--- 3651,3657 ----
  }
  
  static CreateConversionStmt *
! _copyCreateConversionStmt(const CreateConversionStmt *from)
  {
  	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
  
***************
*** 3665,3671 **** _copyCreateConversionStmt(CreateConversionStmt *from)
  }
  
  static CreateCastStmt *
! _copyCreateCastStmt(CreateCastStmt *from)
  {
  	CreateCastStmt *newnode = makeNode(CreateCastStmt);
  
--- 3665,3671 ----
  }
  
  static CreateCastStmt *
! _copyCreateCastStmt(const CreateCastStmt *from)
  {
  	CreateCastStmt *newnode = makeNode(CreateCastStmt);
  
***************
*** 3679,3685 **** _copyCreateCastStmt(CreateCastStmt *from)
  }
  
  static DropCastStmt *
! _copyDropCastStmt(DropCastStmt *from)
  {
  	DropCastStmt *newnode = makeNode(DropCastStmt);
  
--- 3679,3685 ----
  }
  
  static DropCastStmt *
! _copyDropCastStmt(const DropCastStmt *from)
  {
  	DropCastStmt *newnode = makeNode(DropCastStmt);
  
***************
*** 3692,3698 **** _copyDropCastStmt(DropCastStmt *from)
  }
  
  static PrepareStmt *
! _copyPrepareStmt(PrepareStmt *from)
  {
  	PrepareStmt *newnode = makeNode(PrepareStmt);
  
--- 3692,3698 ----
  }
  
  static PrepareStmt *
! _copyPrepareStmt(const PrepareStmt *from)
  {
  	PrepareStmt *newnode = makeNode(PrepareStmt);
  
***************
*** 3704,3710 **** _copyPrepareStmt(PrepareStmt *from)
  }
  
  static ExecuteStmt *
! _copyExecuteStmt(ExecuteStmt *from)
  {
  	ExecuteStmt *newnode = makeNode(ExecuteStmt);
  
--- 3704,3710 ----
  }
  
  static ExecuteStmt *
! _copyExecuteStmt(const ExecuteStmt *from)
  {
  	ExecuteStmt *newnode = makeNode(ExecuteStmt);
  
***************
*** 3716,3722 **** _copyExecuteStmt(ExecuteStmt *from)
  }
  
  static DeallocateStmt *
! _copyDeallocateStmt(DeallocateStmt *from)
  {
  	DeallocateStmt *newnode = makeNode(DeallocateStmt);
  
--- 3716,3722 ----
  }
  
  static DeallocateStmt *
! _copyDeallocateStmt(const DeallocateStmt *from)
  {
  	DeallocateStmt *newnode = makeNode(DeallocateStmt);
  
***************
*** 3726,3732 **** _copyDeallocateStmt(DeallocateStmt *from)
  }
  
  static DropOwnedStmt *
! _copyDropOwnedStmt(DropOwnedStmt *from)
  {
  	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
  
--- 3726,3732 ----
  }
  
  static DropOwnedStmt *
! _copyDropOwnedStmt(const DropOwnedStmt *from)
  {
  	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
  
***************
*** 3737,3743 **** _copyDropOwnedStmt(DropOwnedStmt *from)
  }
  
  static ReassignOwnedStmt *
! _copyReassignOwnedStmt(ReassignOwnedStmt *from)
  {
  	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
  
--- 3737,3743 ----
  }
  
  static ReassignOwnedStmt *
! _copyReassignOwnedStmt(const ReassignOwnedStmt *from)
  {
  	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
  
***************
*** 3748,3754 **** _copyReassignOwnedStmt(ReassignOwnedStmt *from)
  }
  
  static AlterTSDictionaryStmt *
! _copyAlterTSDictionaryStmt(AlterTSDictionaryStmt *from)
  {
  	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
  
--- 3748,3754 ----
  }
  
  static AlterTSDictionaryStmt *
! _copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
  {
  	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
  
***************
*** 3759,3765 **** _copyAlterTSDictionaryStmt(AlterTSDictionaryStmt *from)
  }
  
  static AlterTSConfigurationStmt *
! _copyAlterTSConfigurationStmt(AlterTSConfigurationStmt *from)
  {
  	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
  
--- 3759,3765 ----
  }
  
  static AlterTSConfigurationStmt *
! _copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
  {
  	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
  
***************
*** 3820,3826 **** _copyList(List *from)
   * ****************************************************************
   */
  static Value *
! _copyValue(Value *from)
  {
  	Value	   *newnode = makeNode(Value);
  
--- 3820,3826 ----
   * ****************************************************************
   */
  static Value *
! _copyValue(const Value *from)
  {
  	Value	   *newnode = makeNode(Value);
  
***************
*** 4585,4591 **** copyObject(void *from)
  
  		default:
  			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(from));
! 			retval = from;		/* keep compiler quiet */
  			break;
  	}
  
--- 4585,4591 ----
  
  		default:
  			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(from));
! 			retval = NULL;		/* keep compiler quiet */
  			break;
  	}
  
*** a/src/backend/nodes/equalfuncs.c
--- b/src/backend/nodes/equalfuncs.c
***************
*** 89,95 ****
   */
  
  static bool
! _equalAlias(Alias *a, Alias *b)
  {
  	COMPARE_STRING_FIELD(aliasname);
  	COMPARE_NODE_FIELD(colnames);
--- 89,95 ----
   */
  
  static bool
! _equalAlias(const Alias *a, const Alias *b)
  {
  	COMPARE_STRING_FIELD(aliasname);
  	COMPARE_NODE_FIELD(colnames);
***************
*** 98,104 **** _equalAlias(Alias *a, Alias *b)
  }
  
  static bool
! _equalRangeVar(RangeVar *a, RangeVar *b)
  {
  	COMPARE_STRING_FIELD(catalogname);
  	COMPARE_STRING_FIELD(schemaname);
--- 98,104 ----
  }
  
  static bool
! _equalRangeVar(const RangeVar *a, const RangeVar *b)
  {
  	COMPARE_STRING_FIELD(catalogname);
  	COMPARE_STRING_FIELD(schemaname);
***************
*** 112,118 **** _equalRangeVar(RangeVar *a, RangeVar *b)
  }
  
  static bool
! _equalIntoClause(IntoClause *a, IntoClause *b)
  {
  	COMPARE_NODE_FIELD(rel);
  	COMPARE_NODE_FIELD(colNames);
--- 112,118 ----
  }
  
  static bool
! _equalIntoClause(const IntoClause *a, const IntoClause *b)
  {
  	COMPARE_NODE_FIELD(rel);
  	COMPARE_NODE_FIELD(colNames);
***************
*** 131,137 **** _equalIntoClause(IntoClause *a, IntoClause *b)
   */
  
  static bool
! _equalVar(Var *a, Var *b)
  {
  	COMPARE_SCALAR_FIELD(varno);
  	COMPARE_SCALAR_FIELD(varattno);
--- 131,137 ----
   */
  
  static bool
! _equalVar(const Var *a, const Var *b)
  {
  	COMPARE_SCALAR_FIELD(varno);
  	COMPARE_SCALAR_FIELD(varattno);
***************
*** 147,153 **** _equalVar(Var *a, Var *b)
  }
  
  static bool
! _equalConst(Const *a, Const *b)
  {
  	COMPARE_SCALAR_FIELD(consttype);
  	COMPARE_SCALAR_FIELD(consttypmod);
--- 147,153 ----
  }
  
  static bool
! _equalConst(const Const *a, const Const *b)
  {
  	COMPARE_SCALAR_FIELD(consttype);
  	COMPARE_SCALAR_FIELD(consttypmod);
***************
*** 168,174 **** _equalConst(Const *a, Const *b)
  }
  
  static bool
! _equalParam(Param *a, Param *b)
  {
  	COMPARE_SCALAR_FIELD(paramkind);
  	COMPARE_SCALAR_FIELD(paramid);
--- 168,174 ----
  }
  
  static bool
! _equalParam(const Param *a, const Param *b)
  {
  	COMPARE_SCALAR_FIELD(paramkind);
  	COMPARE_SCALAR_FIELD(paramid);
***************
*** 181,187 **** _equalParam(Param *a, Param *b)
  }
  
  static bool
! _equalAggref(Aggref *a, Aggref *b)
  {
  	COMPARE_SCALAR_FIELD(aggfnoid);
  	COMPARE_SCALAR_FIELD(aggtype);
--- 181,187 ----
  }
  
  static bool
! _equalAggref(const Aggref *a, const Aggref *b)
  {
  	COMPARE_SCALAR_FIELD(aggfnoid);
  	COMPARE_SCALAR_FIELD(aggtype);
***************
*** 198,204 **** _equalAggref(Aggref *a, Aggref *b)
  }
  
  static bool
! _equalWindowFunc(WindowFunc *a, WindowFunc *b)
  {
  	COMPARE_SCALAR_FIELD(winfnoid);
  	COMPARE_SCALAR_FIELD(wintype);
--- 198,204 ----
  }
  
  static bool
! _equalWindowFunc(const WindowFunc *a, const WindowFunc *b)
  {
  	COMPARE_SCALAR_FIELD(winfnoid);
  	COMPARE_SCALAR_FIELD(wintype);
***************
*** 214,220 **** _equalWindowFunc(WindowFunc *a, WindowFunc *b)
  }
  
  static bool
! _equalArrayRef(ArrayRef *a, ArrayRef *b)
  {
  	COMPARE_SCALAR_FIELD(refarraytype);
  	COMPARE_SCALAR_FIELD(refelemtype);
--- 214,220 ----
  }
  
  static bool
! _equalArrayRef(const ArrayRef *a, const ArrayRef *b)
  {
  	COMPARE_SCALAR_FIELD(refarraytype);
  	COMPARE_SCALAR_FIELD(refelemtype);
***************
*** 229,235 **** _equalArrayRef(ArrayRef *a, ArrayRef *b)
  }
  
  static bool
! _equalFuncExpr(FuncExpr *a, FuncExpr *b)
  {
  	COMPARE_SCALAR_FIELD(funcid);
  	COMPARE_SCALAR_FIELD(funcresulttype);
--- 229,235 ----
  }
  
  static bool
! _equalFuncExpr(const FuncExpr *a, const FuncExpr *b)
  {
  	COMPARE_SCALAR_FIELD(funcid);
  	COMPARE_SCALAR_FIELD(funcresulttype);
***************
*** 253,259 **** _equalFuncExpr(FuncExpr *a, FuncExpr *b)
  }
  
  static bool
! _equalNamedArgExpr(NamedArgExpr *a, NamedArgExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_STRING_FIELD(name);
--- 253,259 ----
  }
  
  static bool
! _equalNamedArgExpr(const NamedArgExpr *a, const NamedArgExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_STRING_FIELD(name);
***************
*** 264,270 **** _equalNamedArgExpr(NamedArgExpr *a, NamedArgExpr *b)
  }
  
  static bool
! _equalOpExpr(OpExpr *a, OpExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
--- 264,270 ----
  }
  
  static bool
! _equalOpExpr(const OpExpr *a, const OpExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
***************
*** 290,296 **** _equalOpExpr(OpExpr *a, OpExpr *b)
  }
  
  static bool
! _equalDistinctExpr(DistinctExpr *a, DistinctExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
--- 290,296 ----
  }
  
  static bool
! _equalDistinctExpr(const DistinctExpr *a, const DistinctExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
***************
*** 316,322 **** _equalDistinctExpr(DistinctExpr *a, DistinctExpr *b)
  }
  
  static bool
! _equalNullIfExpr(NullIfExpr *a, NullIfExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
--- 316,322 ----
  }
  
  static bool
! _equalNullIfExpr(const NullIfExpr *a, const NullIfExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
***************
*** 342,348 **** _equalNullIfExpr(NullIfExpr *a, NullIfExpr *b)
  }
  
  static bool
! _equalScalarArrayOpExpr(ScalarArrayOpExpr *a, ScalarArrayOpExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
--- 342,348 ----
  }
  
  static bool
! _equalScalarArrayOpExpr(const ScalarArrayOpExpr *a, const ScalarArrayOpExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
***************
*** 366,372 **** _equalScalarArrayOpExpr(ScalarArrayOpExpr *a, ScalarArrayOpExpr *b)
  }
  
  static bool
! _equalBoolExpr(BoolExpr *a, BoolExpr *b)
  {
  	COMPARE_SCALAR_FIELD(boolop);
  	COMPARE_NODE_FIELD(args);
--- 366,372 ----
  }
  
  static bool
! _equalBoolExpr(const BoolExpr *a, const BoolExpr *b)
  {
  	COMPARE_SCALAR_FIELD(boolop);
  	COMPARE_NODE_FIELD(args);
***************
*** 376,382 **** _equalBoolExpr(BoolExpr *a, BoolExpr *b)
  }
  
  static bool
! _equalSubLink(SubLink *a, SubLink *b)
  {
  	COMPARE_SCALAR_FIELD(subLinkType);
  	COMPARE_NODE_FIELD(testexpr);
--- 376,382 ----
  }
  
  static bool
! _equalSubLink(const SubLink *a, const SubLink *b)
  {
  	COMPARE_SCALAR_FIELD(subLinkType);
  	COMPARE_NODE_FIELD(testexpr);
***************
*** 388,394 **** _equalSubLink(SubLink *a, SubLink *b)
  }
  
  static bool
! _equalSubPlan(SubPlan *a, SubPlan *b)
  {
  	COMPARE_SCALAR_FIELD(subLinkType);
  	COMPARE_NODE_FIELD(testexpr);
--- 388,394 ----
  }
  
  static bool
! _equalSubPlan(const SubPlan *a, const SubPlan *b)
  {
  	COMPARE_SCALAR_FIELD(subLinkType);
  	COMPARE_NODE_FIELD(testexpr);
***************
*** 410,416 **** _equalSubPlan(SubPlan *a, SubPlan *b)
  }
  
  static bool
! _equalAlternativeSubPlan(AlternativeSubPlan *a, AlternativeSubPlan *b)
  {
  	COMPARE_NODE_FIELD(subplans);
  
--- 410,416 ----
  }
  
  static bool
! _equalAlternativeSubPlan(const AlternativeSubPlan *a, const AlternativeSubPlan *b)
  {
  	COMPARE_NODE_FIELD(subplans);
  
***************
*** 418,424 **** _equalAlternativeSubPlan(AlternativeSubPlan *a, AlternativeSubPlan *b)
  }
  
  static bool
! _equalFieldSelect(FieldSelect *a, FieldSelect *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(fieldnum);
--- 418,424 ----
  }
  
  static bool
! _equalFieldSelect(const FieldSelect *a, const FieldSelect *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(fieldnum);
***************
*** 430,436 **** _equalFieldSelect(FieldSelect *a, FieldSelect *b)
  }
  
  static bool
! _equalFieldStore(FieldStore *a, FieldStore *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(newvals);
--- 430,436 ----
  }
  
  static bool
! _equalFieldStore(const FieldStore *a, const FieldStore *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(newvals);
***************
*** 441,447 **** _equalFieldStore(FieldStore *a, FieldStore *b)
  }
  
  static bool
! _equalRelabelType(RelabelType *a, RelabelType *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
--- 441,447 ----
  }
  
  static bool
! _equalRelabelType(const RelabelType *a, const RelabelType *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
***************
*** 463,469 **** _equalRelabelType(RelabelType *a, RelabelType *b)
  }
  
  static bool
! _equalCoerceViaIO(CoerceViaIO *a, CoerceViaIO *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
--- 463,469 ----
  }
  
  static bool
! _equalCoerceViaIO(const CoerceViaIO *a, const CoerceViaIO *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
***************
*** 484,490 **** _equalCoerceViaIO(CoerceViaIO *a, CoerceViaIO *b)
  }
  
  static bool
! _equalArrayCoerceExpr(ArrayCoerceExpr *a, ArrayCoerceExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(elemfuncid);
--- 484,490 ----
  }
  
  static bool
! _equalArrayCoerceExpr(const ArrayCoerceExpr *a, const ArrayCoerceExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(elemfuncid);
***************
*** 508,514 **** _equalArrayCoerceExpr(ArrayCoerceExpr *a, ArrayCoerceExpr *b)
  }
  
  static bool
! _equalConvertRowtypeExpr(ConvertRowtypeExpr *a, ConvertRowtypeExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
--- 508,514 ----
  }
  
  static bool
! _equalConvertRowtypeExpr(const ConvertRowtypeExpr *a, const ConvertRowtypeExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
***************
*** 528,534 **** _equalConvertRowtypeExpr(ConvertRowtypeExpr *a, ConvertRowtypeExpr *b)
  }
  
  static bool
! _equalCollateExpr(CollateExpr *a, CollateExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(collOid);
--- 528,534 ----
  }
  
  static bool
! _equalCollateExpr(const CollateExpr *a, const CollateExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(collOid);
***************
*** 538,544 **** _equalCollateExpr(CollateExpr *a, CollateExpr *b)
  }
  
  static bool
! _equalCaseExpr(CaseExpr *a, CaseExpr *b)
  {
  	COMPARE_SCALAR_FIELD(casetype);
  	COMPARE_SCALAR_FIELD(casecollid);
--- 538,544 ----
  }
  
  static bool
! _equalCaseExpr(const CaseExpr *a, const CaseExpr *b)
  {
  	COMPARE_SCALAR_FIELD(casetype);
  	COMPARE_SCALAR_FIELD(casecollid);
***************
*** 551,557 **** _equalCaseExpr(CaseExpr *a, CaseExpr *b)
  }
  
  static bool
! _equalCaseWhen(CaseWhen *a, CaseWhen *b)
  {
  	COMPARE_NODE_FIELD(expr);
  	COMPARE_NODE_FIELD(result);
--- 551,557 ----
  }
  
  static bool
! _equalCaseWhen(const CaseWhen *a, const CaseWhen *b)
  {
  	COMPARE_NODE_FIELD(expr);
  	COMPARE_NODE_FIELD(result);
***************
*** 561,567 **** _equalCaseWhen(CaseWhen *a, CaseWhen *b)
  }
  
  static bool
! _equalCaseTestExpr(CaseTestExpr *a, CaseTestExpr *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
--- 561,567 ----
  }
  
  static bool
! _equalCaseTestExpr(const CaseTestExpr *a, const CaseTestExpr *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
***************
*** 571,577 **** _equalCaseTestExpr(CaseTestExpr *a, CaseTestExpr *b)
  }
  
  static bool
! _equalArrayExpr(ArrayExpr *a, ArrayExpr *b)
  {
  	COMPARE_SCALAR_FIELD(array_typeid);
  	COMPARE_SCALAR_FIELD(array_collid);
--- 571,577 ----
  }
  
  static bool
! _equalArrayExpr(const ArrayExpr *a, const ArrayExpr *b)
  {
  	COMPARE_SCALAR_FIELD(array_typeid);
  	COMPARE_SCALAR_FIELD(array_collid);
***************
*** 584,590 **** _equalArrayExpr(ArrayExpr *a, ArrayExpr *b)
  }
  
  static bool
! _equalRowExpr(RowExpr *a, RowExpr *b)
  {
  	COMPARE_NODE_FIELD(args);
  	COMPARE_SCALAR_FIELD(row_typeid);
--- 584,590 ----
  }
  
  static bool
! _equalRowExpr(const RowExpr *a, const RowExpr *b)
  {
  	COMPARE_NODE_FIELD(args);
  	COMPARE_SCALAR_FIELD(row_typeid);
***************
*** 605,611 **** _equalRowExpr(RowExpr *a, RowExpr *b)
  }
  
  static bool
! _equalRowCompareExpr(RowCompareExpr *a, RowCompareExpr *b)
  {
  	COMPARE_SCALAR_FIELD(rctype);
  	COMPARE_NODE_FIELD(opnos);
--- 605,611 ----
  }
  
  static bool
! _equalRowCompareExpr(const RowCompareExpr *a, const RowCompareExpr *b)
  {
  	COMPARE_SCALAR_FIELD(rctype);
  	COMPARE_NODE_FIELD(opnos);
***************
*** 618,624 **** _equalRowCompareExpr(RowCompareExpr *a, RowCompareExpr *b)
  }
  
  static bool
! _equalCoalesceExpr(CoalesceExpr *a, CoalesceExpr *b)
  {
  	COMPARE_SCALAR_FIELD(coalescetype);
  	COMPARE_SCALAR_FIELD(coalescecollid);
--- 618,624 ----
  }
  
  static bool
! _equalCoalesceExpr(const CoalesceExpr *a, const CoalesceExpr *b)
  {
  	COMPARE_SCALAR_FIELD(coalescetype);
  	COMPARE_SCALAR_FIELD(coalescecollid);
***************
*** 629,635 **** _equalCoalesceExpr(CoalesceExpr *a, CoalesceExpr *b)
  }
  
  static bool
! _equalMinMaxExpr(MinMaxExpr *a, MinMaxExpr *b)
  {
  	COMPARE_SCALAR_FIELD(minmaxtype);
  	COMPARE_SCALAR_FIELD(minmaxcollid);
--- 629,635 ----
  }
  
  static bool
! _equalMinMaxExpr(const MinMaxExpr *a, const MinMaxExpr *b)
  {
  	COMPARE_SCALAR_FIELD(minmaxtype);
  	COMPARE_SCALAR_FIELD(minmaxcollid);
***************
*** 642,648 **** _equalMinMaxExpr(MinMaxExpr *a, MinMaxExpr *b)
  }
  
  static bool
! _equalXmlExpr(XmlExpr *a, XmlExpr *b)
  {
  	COMPARE_SCALAR_FIELD(op);
  	COMPARE_STRING_FIELD(name);
--- 642,648 ----
  }
  
  static bool
! _equalXmlExpr(const XmlExpr *a, const XmlExpr *b)
  {
  	COMPARE_SCALAR_FIELD(op);
  	COMPARE_STRING_FIELD(name);
***************
*** 658,664 **** _equalXmlExpr(XmlExpr *a, XmlExpr *b)
  }
  
  static bool
! _equalNullTest(NullTest *a, NullTest *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(nulltesttype);
--- 658,664 ----
  }
  
  static bool
! _equalNullTest(const NullTest *a, const NullTest *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(nulltesttype);
***************
*** 668,674 **** _equalNullTest(NullTest *a, NullTest *b)
  }
  
  static bool
! _equalBooleanTest(BooleanTest *a, BooleanTest *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(booltesttype);
--- 668,674 ----
  }
  
  static bool
! _equalBooleanTest(const BooleanTest *a, const BooleanTest *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(booltesttype);
***************
*** 677,683 **** _equalBooleanTest(BooleanTest *a, BooleanTest *b)
  }
  
  static bool
! _equalCoerceToDomain(CoerceToDomain *a, CoerceToDomain *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
--- 677,683 ----
  }
  
  static bool
! _equalCoerceToDomain(const CoerceToDomain *a, const CoerceToDomain *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
***************
*** 699,705 **** _equalCoerceToDomain(CoerceToDomain *a, CoerceToDomain *b)
  }
  
  static bool
! _equalCoerceToDomainValue(CoerceToDomainValue *a, CoerceToDomainValue *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
--- 699,705 ----
  }
  
  static bool
! _equalCoerceToDomainValue(const CoerceToDomainValue *a, const CoerceToDomainValue *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
***************
*** 710,716 **** _equalCoerceToDomainValue(CoerceToDomainValue *a, CoerceToDomainValue *b)
  }
  
  static bool
! _equalSetToDefault(SetToDefault *a, SetToDefault *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
--- 710,716 ----
  }
  
  static bool
! _equalSetToDefault(const SetToDefault *a, const SetToDefault *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
***************
*** 721,727 **** _equalSetToDefault(SetToDefault *a, SetToDefault *b)
  }
  
  static bool
! _equalCurrentOfExpr(CurrentOfExpr *a, CurrentOfExpr *b)
  {
  	COMPARE_SCALAR_FIELD(cvarno);
  	COMPARE_STRING_FIELD(cursor_name);
--- 721,727 ----
  }
  
  static bool
! _equalCurrentOfExpr(const CurrentOfExpr *a, const CurrentOfExpr *b)
  {
  	COMPARE_SCALAR_FIELD(cvarno);
  	COMPARE_STRING_FIELD(cursor_name);
***************
*** 731,737 **** _equalCurrentOfExpr(CurrentOfExpr *a, CurrentOfExpr *b)
  }
  
  static bool
! _equalTargetEntry(TargetEntry *a, TargetEntry *b)
  {
  	COMPARE_NODE_FIELD(expr);
  	COMPARE_SCALAR_FIELD(resno);
--- 731,737 ----
  }
  
  static bool
! _equalTargetEntry(const TargetEntry *a, const TargetEntry *b)
  {
  	COMPARE_NODE_FIELD(expr);
  	COMPARE_SCALAR_FIELD(resno);
***************
*** 745,751 **** _equalTargetEntry(TargetEntry *a, TargetEntry *b)
  }
  
  static bool
! _equalRangeTblRef(RangeTblRef *a, RangeTblRef *b)
  {
  	COMPARE_SCALAR_FIELD(rtindex);
  
--- 745,751 ----
  }
  
  static bool
! _equalRangeTblRef(const RangeTblRef *a, const RangeTblRef *b)
  {
  	COMPARE_SCALAR_FIELD(rtindex);
  
***************
*** 753,759 **** _equalRangeTblRef(RangeTblRef *a, RangeTblRef *b)
  }
  
  static bool
! _equalJoinExpr(JoinExpr *a, JoinExpr *b)
  {
  	COMPARE_SCALAR_FIELD(jointype);
  	COMPARE_SCALAR_FIELD(isNatural);
--- 753,759 ----
  }
  
  static bool
! _equalJoinExpr(const JoinExpr *a, const JoinExpr *b)
  {
  	COMPARE_SCALAR_FIELD(jointype);
  	COMPARE_SCALAR_FIELD(isNatural);
***************
*** 768,774 **** _equalJoinExpr(JoinExpr *a, JoinExpr *b)
  }
  
  static bool
! _equalFromExpr(FromExpr *a, FromExpr *b)
  {
  	COMPARE_NODE_FIELD(fromlist);
  	COMPARE_NODE_FIELD(quals);
--- 768,774 ----
  }
  
  static bool
! _equalFromExpr(const FromExpr *a, const FromExpr *b)
  {
  	COMPARE_NODE_FIELD(fromlist);
  	COMPARE_NODE_FIELD(quals);
***************
*** 782,788 **** _equalFromExpr(FromExpr *a, FromExpr *b)
   */
  
  static bool
! _equalPathKey(PathKey *a, PathKey *b)
  {
  	/*
  	 * This is normally used on non-canonicalized PathKeys, so must chase up
--- 782,788 ----
   */
  
  static bool
! _equalPathKey(const PathKey *a, const PathKey *b)
  {
  	/*
  	 * This is normally used on non-canonicalized PathKeys, so must chase up
***************
*** 808,814 **** _equalPathKey(PathKey *a, PathKey *b)
  }
  
  static bool
! _equalRestrictInfo(RestrictInfo *a, RestrictInfo *b)
  {
  	COMPARE_NODE_FIELD(clause);
  	COMPARE_SCALAR_FIELD(is_pushed_down);
--- 808,814 ----
  }
  
  static bool
! _equalRestrictInfo(const RestrictInfo *a, const RestrictInfo *b)
  {
  	COMPARE_NODE_FIELD(clause);
  	COMPARE_SCALAR_FIELD(is_pushed_down);
***************
*** 825,831 **** _equalRestrictInfo(RestrictInfo *a, RestrictInfo *b)
  }
  
  static bool
! _equalPlaceHolderVar(PlaceHolderVar *a, PlaceHolderVar *b)
  {
  	/*
  	 * We intentionally do not compare phexpr.	Two PlaceHolderVars with the
--- 825,831 ----
  }
  
  static bool
! _equalPlaceHolderVar(const PlaceHolderVar *a, const PlaceHolderVar *b)
  {
  	/*
  	 * We intentionally do not compare phexpr.	Two PlaceHolderVars with the
***************
*** 846,852 **** _equalPlaceHolderVar(PlaceHolderVar *a, PlaceHolderVar *b)
  }
  
  static bool
! _equalSpecialJoinInfo(SpecialJoinInfo *a, SpecialJoinInfo *b)
  {
  	COMPARE_BITMAPSET_FIELD(min_lefthand);
  	COMPARE_BITMAPSET_FIELD(min_righthand);
--- 846,852 ----
  }
  
  static bool
! _equalSpecialJoinInfo(const SpecialJoinInfo *a, const SpecialJoinInfo *b)
  {
  	COMPARE_BITMAPSET_FIELD(min_lefthand);
  	COMPARE_BITMAPSET_FIELD(min_righthand);
***************
*** 861,867 **** _equalSpecialJoinInfo(SpecialJoinInfo *a, SpecialJoinInfo *b)
  }
  
  static bool
! _equalAppendRelInfo(AppendRelInfo *a, AppendRelInfo *b)
  {
  	COMPARE_SCALAR_FIELD(parent_relid);
  	COMPARE_SCALAR_FIELD(child_relid);
--- 861,867 ----
  }
  
  static bool
! _equalAppendRelInfo(const AppendRelInfo *a, const AppendRelInfo *b)
  {
  	COMPARE_SCALAR_FIELD(parent_relid);
  	COMPARE_SCALAR_FIELD(child_relid);
***************
*** 874,880 **** _equalAppendRelInfo(AppendRelInfo *a, AppendRelInfo *b)
  }
  
  static bool
! _equalPlaceHolderInfo(PlaceHolderInfo *a, PlaceHolderInfo *b)
  {
  	COMPARE_SCALAR_FIELD(phid);
  	COMPARE_NODE_FIELD(ph_var);
--- 874,880 ----
  }
  
  static bool
! _equalPlaceHolderInfo(const PlaceHolderInfo *a, const PlaceHolderInfo *b)
  {
  	COMPARE_SCALAR_FIELD(phid);
  	COMPARE_NODE_FIELD(ph_var);
***************
*** 892,898 **** _equalPlaceHolderInfo(PlaceHolderInfo *a, PlaceHolderInfo *b)
   */
  
  static bool
! _equalQuery(Query *a, Query *b)
  {
  	COMPARE_SCALAR_FIELD(commandType);
  	COMPARE_SCALAR_FIELD(querySource);
--- 892,898 ----
   */
  
  static bool
! _equalQuery(const Query *a, const Query *b)
  {
  	COMPARE_SCALAR_FIELD(commandType);
  	COMPARE_SCALAR_FIELD(querySource);
***************
*** 927,933 **** _equalQuery(Query *a, Query *b)
  }
  
  static bool
! _equalInsertStmt(InsertStmt *a, InsertStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(cols);
--- 927,933 ----
  }
  
  static bool
! _equalInsertStmt(const InsertStmt *a, const InsertStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(cols);
***************
*** 939,945 **** _equalInsertStmt(InsertStmt *a, InsertStmt *b)
  }
  
  static bool
! _equalDeleteStmt(DeleteStmt *a, DeleteStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(usingClause);
--- 939,945 ----
  }
  
  static bool
! _equalDeleteStmt(const DeleteStmt *a, const DeleteStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(usingClause);
***************
*** 951,957 **** _equalDeleteStmt(DeleteStmt *a, DeleteStmt *b)
  }
  
  static bool
! _equalUpdateStmt(UpdateStmt *a, UpdateStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(targetList);
--- 951,957 ----
  }
  
  static bool
! _equalUpdateStmt(const UpdateStmt *a, const UpdateStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(targetList);
***************
*** 964,970 **** _equalUpdateStmt(UpdateStmt *a, UpdateStmt *b)
  }
  
  static bool
! _equalSelectStmt(SelectStmt *a, SelectStmt *b)
  {
  	COMPARE_NODE_FIELD(distinctClause);
  	COMPARE_NODE_FIELD(intoClause);
--- 964,970 ----
  }
  
  static bool
! _equalSelectStmt(const SelectStmt *a, const SelectStmt *b)
  {
  	COMPARE_NODE_FIELD(distinctClause);
  	COMPARE_NODE_FIELD(intoClause);
***************
*** 989,995 **** _equalSelectStmt(SelectStmt *a, SelectStmt *b)
  }
  
  static bool
! _equalSetOperationStmt(SetOperationStmt *a, SetOperationStmt *b)
  {
  	COMPARE_SCALAR_FIELD(op);
  	COMPARE_SCALAR_FIELD(all);
--- 989,995 ----
  }
  
  static bool
! _equalSetOperationStmt(const SetOperationStmt *a, const SetOperationStmt *b)
  {
  	COMPARE_SCALAR_FIELD(op);
  	COMPARE_SCALAR_FIELD(all);
***************
*** 1004,1010 **** _equalSetOperationStmt(SetOperationStmt *a, SetOperationStmt *b)
  }
  
  static bool
! _equalAlterTableStmt(AlterTableStmt *a, AlterTableStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(cmds);
--- 1004,1010 ----
  }
  
  static bool
! _equalAlterTableStmt(const AlterTableStmt *a, const AlterTableStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(cmds);
***************
*** 1014,1020 **** _equalAlterTableStmt(AlterTableStmt *a, AlterTableStmt *b)
  }
  
  static bool
! _equalAlterTableCmd(AlterTableCmd *a, AlterTableCmd *b)
  {
  	COMPARE_SCALAR_FIELD(subtype);
  	COMPARE_STRING_FIELD(name);
--- 1014,1020 ----
  }
  
  static bool
! _equalAlterTableCmd(const AlterTableCmd *a, const AlterTableCmd *b)
  {
  	COMPARE_SCALAR_FIELD(subtype);
  	COMPARE_STRING_FIELD(name);
***************
*** 1026,1032 **** _equalAlterTableCmd(AlterTableCmd *a, AlterTableCmd *b)
  }
  
  static bool
! _equalAlterDomainStmt(AlterDomainStmt *a, AlterDomainStmt *b)
  {
  	COMPARE_SCALAR_FIELD(subtype);
  	COMPARE_NODE_FIELD(typeName);
--- 1026,1032 ----
  }
  
  static bool
! _equalAlterDomainStmt(const AlterDomainStmt *a, const AlterDomainStmt *b)
  {
  	COMPARE_SCALAR_FIELD(subtype);
  	COMPARE_NODE_FIELD(typeName);
***************
*** 1038,1044 **** _equalAlterDomainStmt(AlterDomainStmt *a, AlterDomainStmt *b)
  }
  
  static bool
! _equalGrantStmt(GrantStmt *a, GrantStmt *b)
  {
  	COMPARE_SCALAR_FIELD(is_grant);
  	COMPARE_SCALAR_FIELD(targtype);
--- 1038,1044 ----
  }
  
  static bool
! _equalGrantStmt(const GrantStmt *a, const GrantStmt *b)
  {
  	COMPARE_SCALAR_FIELD(is_grant);
  	COMPARE_SCALAR_FIELD(targtype);
***************
*** 1053,1059 **** _equalGrantStmt(GrantStmt *a, GrantStmt *b)
  }
  
  static bool
! _equalPrivGrantee(PrivGrantee *a, PrivGrantee *b)
  {
  	COMPARE_STRING_FIELD(rolname);
  
--- 1053,1059 ----
  }
  
  static bool
! _equalPrivGrantee(const PrivGrantee *a, const PrivGrantee *b)
  {
  	COMPARE_STRING_FIELD(rolname);
  
***************
*** 1061,1067 **** _equalPrivGrantee(PrivGrantee *a, PrivGrantee *b)
  }
  
  static bool
! _equalFuncWithArgs(FuncWithArgs *a, FuncWithArgs *b)
  {
  	COMPARE_NODE_FIELD(funcname);
  	COMPARE_NODE_FIELD(funcargs);
--- 1061,1067 ----
  }
  
  static bool
! _equalFuncWithArgs(const FuncWithArgs *a, const FuncWithArgs *b)
  {
  	COMPARE_NODE_FIELD(funcname);
  	COMPARE_NODE_FIELD(funcargs);
***************
*** 1070,1076 **** _equalFuncWithArgs(FuncWithArgs *a, FuncWithArgs *b)
  }
  
  static bool
! _equalAccessPriv(AccessPriv *a, AccessPriv *b)
  {
  	COMPARE_STRING_FIELD(priv_name);
  	COMPARE_NODE_FIELD(cols);
--- 1070,1076 ----
  }
  
  static bool
! _equalAccessPriv(const AccessPriv *a, const AccessPriv *b)
  {
  	COMPARE_STRING_FIELD(priv_name);
  	COMPARE_NODE_FIELD(cols);
***************
*** 1079,1085 **** _equalAccessPriv(AccessPriv *a, AccessPriv *b)
  }
  
  static bool
! _equalGrantRoleStmt(GrantRoleStmt *a, GrantRoleStmt *b)
  {
  	COMPARE_NODE_FIELD(granted_roles);
  	COMPARE_NODE_FIELD(grantee_roles);
--- 1079,1085 ----
  }
  
  static bool
! _equalGrantRoleStmt(const GrantRoleStmt *a, const GrantRoleStmt *b)
  {
  	COMPARE_NODE_FIELD(granted_roles);
  	COMPARE_NODE_FIELD(grantee_roles);
***************
*** 1092,1098 **** _equalGrantRoleStmt(GrantRoleStmt *a, GrantRoleStmt *b)
  }
  
  static bool
! _equalAlterDefaultPrivilegesStmt(AlterDefaultPrivilegesStmt *a, AlterDefaultPrivilegesStmt *b)
  {
  	COMPARE_NODE_FIELD(options);
  	COMPARE_NODE_FIELD(action);
--- 1092,1098 ----
  }
  
  static bool
! _equalAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *a, const AlterDefaultPrivilegesStmt *b)
  {
  	COMPARE_NODE_FIELD(options);
  	COMPARE_NODE_FIELD(action);
***************
*** 1101,1107 **** _equalAlterDefaultPrivilegesStmt(AlterDefaultPrivilegesStmt *a, AlterDefaultPriv
  }
  
  static bool
! _equalDeclareCursorStmt(DeclareCursorStmt *a, DeclareCursorStmt *b)
  {
  	COMPARE_STRING_FIELD(portalname);
  	COMPARE_SCALAR_FIELD(options);
--- 1101,1107 ----
  }
  
  static bool
! _equalDeclareCursorStmt(const DeclareCursorStmt *a, const DeclareCursorStmt *b)
  {
  	COMPARE_STRING_FIELD(portalname);
  	COMPARE_SCALAR_FIELD(options);
***************
*** 1111,1117 **** _equalDeclareCursorStmt(DeclareCursorStmt *a, DeclareCursorStmt *b)
  }
  
  static bool
! _equalClosePortalStmt(ClosePortalStmt *a, ClosePortalStmt *b)
  {
  	COMPARE_STRING_FIELD(portalname);
  
--- 1111,1117 ----
  }
  
  static bool
! _equalClosePortalStmt(const ClosePortalStmt *a, const ClosePortalStmt *b)
  {
  	COMPARE_STRING_FIELD(portalname);
  
***************
*** 1119,1125 **** _equalClosePortalStmt(ClosePortalStmt *a, ClosePortalStmt *b)
  }
  
  static bool
! _equalClusterStmt(ClusterStmt *a, ClusterStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(indexname);
--- 1119,1125 ----
  }
  
  static bool
! _equalClusterStmt(const ClusterStmt *a, const ClusterStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(indexname);
***************
*** 1129,1135 **** _equalClusterStmt(ClusterStmt *a, ClusterStmt *b)
  }
  
  static bool
! _equalCopyStmt(CopyStmt *a, CopyStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(query);
--- 1129,1135 ----
  }
  
  static bool
! _equalCopyStmt(const CopyStmt *a, const CopyStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(query);
***************
*** 1142,1148 **** _equalCopyStmt(CopyStmt *a, CopyStmt *b)
  }
  
  static bool
! _equalCreateStmt(CreateStmt *a, CreateStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(tableElts);
--- 1142,1148 ----
  }
  
  static bool
! _equalCreateStmt(const CreateStmt *a, const CreateStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(tableElts);
***************
*** 1158,1164 **** _equalCreateStmt(CreateStmt *a, CreateStmt *b)
  }
  
  static bool
! _equalInhRelation(InhRelation *a, InhRelation *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_SCALAR_FIELD(options);
--- 1158,1164 ----
  }
  
  static bool
! _equalInhRelation(const InhRelation *a, const InhRelation *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_SCALAR_FIELD(options);
***************
*** 1167,1173 **** _equalInhRelation(InhRelation *a, InhRelation *b)
  }
  
  static bool
! _equalDefineStmt(DefineStmt *a, DefineStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_SCALAR_FIELD(oldstyle);
--- 1167,1173 ----
  }
  
  static bool
! _equalDefineStmt(const DefineStmt *a, const DefineStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_SCALAR_FIELD(oldstyle);
***************
*** 1179,1185 **** _equalDefineStmt(DefineStmt *a, DefineStmt *b)
  }
  
  static bool
! _equalDropStmt(DropStmt *a, DropStmt *b)
  {
  	COMPARE_NODE_FIELD(objects);
  	COMPARE_SCALAR_FIELD(removeType);
--- 1179,1185 ----
  }
  
  static bool
! _equalDropStmt(const DropStmt *a, const DropStmt *b)
  {
  	COMPARE_NODE_FIELD(objects);
  	COMPARE_SCALAR_FIELD(removeType);
***************
*** 1190,1196 **** _equalDropStmt(DropStmt *a, DropStmt *b)
  }
  
  static bool
! _equalTruncateStmt(TruncateStmt *a, TruncateStmt *b)
  {
  	COMPARE_NODE_FIELD(relations);
  	COMPARE_SCALAR_FIELD(restart_seqs);
--- 1190,1196 ----
  }
  
  static bool
! _equalTruncateStmt(const TruncateStmt *a, const TruncateStmt *b)
  {
  	COMPARE_NODE_FIELD(relations);
  	COMPARE_SCALAR_FIELD(restart_seqs);
***************
*** 1200,1206 **** _equalTruncateStmt(TruncateStmt *a, TruncateStmt *b)
  }
  
  static bool
! _equalCommentStmt(CommentStmt *a, CommentStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objtype);
  	COMPARE_NODE_FIELD(objname);
--- 1200,1206 ----
  }
  
  static bool
! _equalCommentStmt(const CommentStmt *a, const CommentStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objtype);
  	COMPARE_NODE_FIELD(objname);
***************
*** 1211,1217 **** _equalCommentStmt(CommentStmt *a, CommentStmt *b)
  }
  
  static bool
! _equalSecLabelStmt(SecLabelStmt *a, SecLabelStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objtype);
  	COMPARE_NODE_FIELD(objname);
--- 1211,1217 ----
  }
  
  static bool
! _equalSecLabelStmt(const SecLabelStmt *a, const SecLabelStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objtype);
  	COMPARE_NODE_FIELD(objname);
***************
*** 1223,1229 **** _equalSecLabelStmt(SecLabelStmt *a, SecLabelStmt *b)
  }
  
  static bool
! _equalFetchStmt(FetchStmt *a, FetchStmt *b)
  {
  	COMPARE_SCALAR_FIELD(direction);
  	COMPARE_SCALAR_FIELD(howMany);
--- 1223,1229 ----
  }
  
  static bool
! _equalFetchStmt(const FetchStmt *a, const FetchStmt *b)
  {
  	COMPARE_SCALAR_FIELD(direction);
  	COMPARE_SCALAR_FIELD(howMany);
***************
*** 1234,1240 **** _equalFetchStmt(FetchStmt *a, FetchStmt *b)
  }
  
  static bool
! _equalIndexStmt(IndexStmt *a, IndexStmt *b)
  {
  	COMPARE_STRING_FIELD(idxname);
  	COMPARE_NODE_FIELD(relation);
--- 1234,1240 ----
  }
  
  static bool
! _equalIndexStmt(const IndexStmt *a, const IndexStmt *b)
  {
  	COMPARE_STRING_FIELD(idxname);
  	COMPARE_NODE_FIELD(relation);
***************
*** 1257,1263 **** _equalIndexStmt(IndexStmt *a, IndexStmt *b)
  }
  
  static bool
! _equalCreateFunctionStmt(CreateFunctionStmt *a, CreateFunctionStmt *b)
  {
  	COMPARE_SCALAR_FIELD(replace);
  	COMPARE_NODE_FIELD(funcname);
--- 1257,1263 ----
  }
  
  static bool
! _equalCreateFunctionStmt(const CreateFunctionStmt *a, const CreateFunctionStmt *b)
  {
  	COMPARE_SCALAR_FIELD(replace);
  	COMPARE_NODE_FIELD(funcname);
***************
*** 1270,1276 **** _equalCreateFunctionStmt(CreateFunctionStmt *a, CreateFunctionStmt *b)
  }
  
  static bool
! _equalFunctionParameter(FunctionParameter *a, FunctionParameter *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(argType);
--- 1270,1276 ----
  }
  
  static bool
! _equalFunctionParameter(const FunctionParameter *a, const FunctionParameter *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(argType);
***************
*** 1281,1287 **** _equalFunctionParameter(FunctionParameter *a, FunctionParameter *b)
  }
  
  static bool
! _equalAlterFunctionStmt(AlterFunctionStmt *a, AlterFunctionStmt *b)
  {
  	COMPARE_NODE_FIELD(func);
  	COMPARE_NODE_FIELD(actions);
--- 1281,1287 ----
  }
  
  static bool
! _equalAlterFunctionStmt(const AlterFunctionStmt *a, const AlterFunctionStmt *b)
  {
  	COMPARE_NODE_FIELD(func);
  	COMPARE_NODE_FIELD(actions);
***************
*** 1290,1296 **** _equalAlterFunctionStmt(AlterFunctionStmt *a, AlterFunctionStmt *b)
  }
  
  static bool
! _equalRemoveFuncStmt(RemoveFuncStmt *a, RemoveFuncStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(name);
--- 1290,1296 ----
  }
  
  static bool
! _equalRemoveFuncStmt(const RemoveFuncStmt *a, const RemoveFuncStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(name);
***************
*** 1302,1308 **** _equalRemoveFuncStmt(RemoveFuncStmt *a, RemoveFuncStmt *b)
  }
  
  static bool
! _equalDoStmt(DoStmt *a, DoStmt *b)
  {
  	COMPARE_NODE_FIELD(args);
  
--- 1302,1308 ----
  }
  
  static bool
! _equalDoStmt(const DoStmt *a, const DoStmt *b)
  {
  	COMPARE_NODE_FIELD(args);
  
***************
*** 1310,1316 **** _equalDoStmt(DoStmt *a, DoStmt *b)
  }
  
  static bool
! _equalRemoveOpClassStmt(RemoveOpClassStmt *a, RemoveOpClassStmt *b)
  {
  	COMPARE_NODE_FIELD(opclassname);
  	COMPARE_STRING_FIELD(amname);
--- 1310,1316 ----
  }
  
  static bool
! _equalRemoveOpClassStmt(const RemoveOpClassStmt *a, const RemoveOpClassStmt *b)
  {
  	COMPARE_NODE_FIELD(opclassname);
  	COMPARE_STRING_FIELD(amname);
***************
*** 1321,1327 **** _equalRemoveOpClassStmt(RemoveOpClassStmt *a, RemoveOpClassStmt *b)
  }
  
  static bool
! _equalRemoveOpFamilyStmt(RemoveOpFamilyStmt *a, RemoveOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
--- 1321,1327 ----
  }
  
  static bool
! _equalRemoveOpFamilyStmt(const RemoveOpFamilyStmt *a, const RemoveOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
***************
*** 1332,1338 **** _equalRemoveOpFamilyStmt(RemoveOpFamilyStmt *a, RemoveOpFamilyStmt *b)
  }
  
  static bool
! _equalRenameStmt(RenameStmt *a, RenameStmt *b)
  {
  	COMPARE_SCALAR_FIELD(renameType);
  	COMPARE_NODE_FIELD(relation);
--- 1332,1338 ----
  }
  
  static bool
! _equalRenameStmt(const RenameStmt *a, const RenameStmt *b)
  {
  	COMPARE_SCALAR_FIELD(renameType);
  	COMPARE_NODE_FIELD(relation);
***************
*** 1346,1352 **** _equalRenameStmt(RenameStmt *a, RenameStmt *b)
  }
  
  static bool
! _equalAlterObjectSchemaStmt(AlterObjectSchemaStmt *a, AlterObjectSchemaStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objectType);
  	COMPARE_NODE_FIELD(relation);
--- 1346,1352 ----
  }
  
  static bool
! _equalAlterObjectSchemaStmt(const AlterObjectSchemaStmt *a, const AlterObjectSchemaStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objectType);
  	COMPARE_NODE_FIELD(relation);
***************
*** 1359,1365 **** _equalAlterObjectSchemaStmt(AlterObjectSchemaStmt *a, AlterObjectSchemaStmt *b)
  }
  
  static bool
! _equalAlterOwnerStmt(AlterOwnerStmt *a, AlterOwnerStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objectType);
  	COMPARE_NODE_FIELD(relation);
--- 1359,1365 ----
  }
  
  static bool
! _equalAlterOwnerStmt(const AlterOwnerStmt *a, const AlterOwnerStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objectType);
  	COMPARE_NODE_FIELD(relation);
***************
*** 1372,1378 **** _equalAlterOwnerStmt(AlterOwnerStmt *a, AlterOwnerStmt *b)
  }
  
  static bool
! _equalRuleStmt(RuleStmt *a, RuleStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(rulename);
--- 1372,1378 ----
  }
  
  static bool
! _equalRuleStmt(const RuleStmt *a, const RuleStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(rulename);
***************
*** 1386,1392 **** _equalRuleStmt(RuleStmt *a, RuleStmt *b)
  }
  
  static bool
! _equalNotifyStmt(NotifyStmt *a, NotifyStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  	COMPARE_STRING_FIELD(payload);
--- 1386,1392 ----
  }
  
  static bool
! _equalNotifyStmt(const NotifyStmt *a, const NotifyStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  	COMPARE_STRING_FIELD(payload);
***************
*** 1395,1401 **** _equalNotifyStmt(NotifyStmt *a, NotifyStmt *b)
  }
  
  static bool
! _equalListenStmt(ListenStmt *a, ListenStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  
--- 1395,1401 ----
  }
  
  static bool
! _equalListenStmt(const ListenStmt *a, const ListenStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  
***************
*** 1403,1409 **** _equalListenStmt(ListenStmt *a, ListenStmt *b)
  }
  
  static bool
! _equalUnlistenStmt(UnlistenStmt *a, UnlistenStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  
--- 1403,1409 ----
  }
  
  static bool
! _equalUnlistenStmt(const UnlistenStmt *a, const UnlistenStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  
***************
*** 1411,1417 **** _equalUnlistenStmt(UnlistenStmt *a, UnlistenStmt *b)
  }
  
  static bool
! _equalTransactionStmt(TransactionStmt *a, TransactionStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(options);
--- 1411,1417 ----
  }
  
  static bool
! _equalTransactionStmt(const TransactionStmt *a, const TransactionStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(options);
***************
*** 1421,1427 **** _equalTransactionStmt(TransactionStmt *a, TransactionStmt *b)
  }
  
  static bool
! _equalCompositeTypeStmt(CompositeTypeStmt *a, CompositeTypeStmt *b)
  {
  	COMPARE_NODE_FIELD(typevar);
  	COMPARE_NODE_FIELD(coldeflist);
--- 1421,1427 ----
  }
  
  static bool
! _equalCompositeTypeStmt(const CompositeTypeStmt *a, const CompositeTypeStmt *b)
  {
  	COMPARE_NODE_FIELD(typevar);
  	COMPARE_NODE_FIELD(coldeflist);
***************
*** 1430,1436 **** _equalCompositeTypeStmt(CompositeTypeStmt *a, CompositeTypeStmt *b)
  }
  
  static bool
! _equalCreateEnumStmt(CreateEnumStmt *a, CreateEnumStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_NODE_FIELD(vals);
--- 1430,1436 ----
  }
  
  static bool
! _equalCreateEnumStmt(const CreateEnumStmt *a, const CreateEnumStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_NODE_FIELD(vals);
***************
*** 1439,1445 **** _equalCreateEnumStmt(CreateEnumStmt *a, CreateEnumStmt *b)
  }
  
  static bool
! _equalCreateRangeStmt(CreateRangeStmt *a, CreateRangeStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_NODE_FIELD(params);
--- 1439,1445 ----
  }
  
  static bool
! _equalCreateRangeStmt(const CreateRangeStmt *a, const CreateRangeStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_NODE_FIELD(params);
***************
*** 1448,1454 **** _equalCreateRangeStmt(CreateRangeStmt *a, CreateRangeStmt *b)
  }
  
  static bool
! _equalAlterEnumStmt(AlterEnumStmt *a, AlterEnumStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_STRING_FIELD(newVal);
--- 1448,1454 ----
  }
  
  static bool
! _equalAlterEnumStmt(const AlterEnumStmt *a, const AlterEnumStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_STRING_FIELD(newVal);
***************
*** 1459,1465 **** _equalAlterEnumStmt(AlterEnumStmt *a, AlterEnumStmt *b)
  }
  
  static bool
! _equalViewStmt(ViewStmt *a, ViewStmt *b)
  {
  	COMPARE_NODE_FIELD(view);
  	COMPARE_NODE_FIELD(aliases);
--- 1459,1465 ----
  }
  
  static bool
! _equalViewStmt(const ViewStmt *a, const ViewStmt *b)
  {
  	COMPARE_NODE_FIELD(view);
  	COMPARE_NODE_FIELD(aliases);
***************
*** 1470,1476 **** _equalViewStmt(ViewStmt *a, ViewStmt *b)
  }
  
  static bool
! _equalLoadStmt(LoadStmt *a, LoadStmt *b)
  {
  	COMPARE_STRING_FIELD(filename);
  
--- 1470,1476 ----
  }
  
  static bool
! _equalLoadStmt(const LoadStmt *a, const LoadStmt *b)
  {
  	COMPARE_STRING_FIELD(filename);
  
***************
*** 1478,1484 **** _equalLoadStmt(LoadStmt *a, LoadStmt *b)
  }
  
  static bool
! _equalCreateDomainStmt(CreateDomainStmt *a, CreateDomainStmt *b)
  {
  	COMPARE_NODE_FIELD(domainname);
  	COMPARE_NODE_FIELD(typeName);
--- 1478,1484 ----
  }
  
  static bool
! _equalCreateDomainStmt(const CreateDomainStmt *a, const CreateDomainStmt *b)
  {
  	COMPARE_NODE_FIELD(domainname);
  	COMPARE_NODE_FIELD(typeName);
***************
*** 1489,1495 **** _equalCreateDomainStmt(CreateDomainStmt *a, CreateDomainStmt *b)
  }
  
  static bool
! _equalCreateOpClassStmt(CreateOpClassStmt *a, CreateOpClassStmt *b)
  {
  	COMPARE_NODE_FIELD(opclassname);
  	COMPARE_NODE_FIELD(opfamilyname);
--- 1489,1495 ----
  }
  
  static bool
! _equalCreateOpClassStmt(const CreateOpClassStmt *a, const CreateOpClassStmt *b)
  {
  	COMPARE_NODE_FIELD(opclassname);
  	COMPARE_NODE_FIELD(opfamilyname);
***************
*** 1502,1508 **** _equalCreateOpClassStmt(CreateOpClassStmt *a, CreateOpClassStmt *b)
  }
  
  static bool
! _equalCreateOpClassItem(CreateOpClassItem *a, CreateOpClassItem *b)
  {
  	COMPARE_SCALAR_FIELD(itemtype);
  	COMPARE_NODE_FIELD(name);
--- 1502,1508 ----
  }
  
  static bool
! _equalCreateOpClassItem(const CreateOpClassItem *a, const CreateOpClassItem *b)
  {
  	COMPARE_SCALAR_FIELD(itemtype);
  	COMPARE_NODE_FIELD(name);
***************
*** 1516,1522 **** _equalCreateOpClassItem(CreateOpClassItem *a, CreateOpClassItem *b)
  }
  
  static bool
! _equalCreateOpFamilyStmt(CreateOpFamilyStmt *a, CreateOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
--- 1516,1522 ----
  }
  
  static bool
! _equalCreateOpFamilyStmt(const CreateOpFamilyStmt *a, const CreateOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
***************
*** 1525,1531 **** _equalCreateOpFamilyStmt(CreateOpFamilyStmt *a, CreateOpFamilyStmt *b)
  }
  
  static bool
! _equalAlterOpFamilyStmt(AlterOpFamilyStmt *a, AlterOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
--- 1525,1531 ----
  }
  
  static bool
! _equalAlterOpFamilyStmt(const AlterOpFamilyStmt *a, const AlterOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
***************
*** 1536,1542 **** _equalAlterOpFamilyStmt(AlterOpFamilyStmt *a, AlterOpFamilyStmt *b)
  }
  
  static bool
! _equalCreatedbStmt(CreatedbStmt *a, CreatedbStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(options);
--- 1536,1542 ----
  }
  
  static bool
! _equalCreatedbStmt(const CreatedbStmt *a, const CreatedbStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(options);
***************
*** 1545,1551 **** _equalCreatedbStmt(CreatedbStmt *a, CreatedbStmt *b)
  }
  
  static bool
! _equalAlterDatabaseStmt(AlterDatabaseStmt *a, AlterDatabaseStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(options);
--- 1545,1551 ----
  }
  
  static bool
! _equalAlterDatabaseStmt(const AlterDatabaseStmt *a, const AlterDatabaseStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(options);
***************
*** 1554,1560 **** _equalAlterDatabaseStmt(AlterDatabaseStmt *a, AlterDatabaseStmt *b)
  }
  
  static bool
! _equalAlterDatabaseSetStmt(AlterDatabaseSetStmt *a, AlterDatabaseSetStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(setstmt);
--- 1554,1560 ----
  }
  
  static bool
! _equalAlterDatabaseSetStmt(const AlterDatabaseSetStmt *a, const AlterDatabaseSetStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(setstmt);
***************
*** 1563,1569 **** _equalAlterDatabaseSetStmt(AlterDatabaseSetStmt *a, AlterDatabaseSetStmt *b)
  }
  
  static bool
! _equalDropdbStmt(DropdbStmt *a, DropdbStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_SCALAR_FIELD(missing_ok);
--- 1563,1569 ----
  }
  
  static bool
! _equalDropdbStmt(const DropdbStmt *a, const DropdbStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_SCALAR_FIELD(missing_ok);
***************
*** 1572,1578 **** _equalDropdbStmt(DropdbStmt *a, DropdbStmt *b)
  }
  
  static bool
! _equalVacuumStmt(VacuumStmt *a, VacuumStmt *b)
  {
  	COMPARE_SCALAR_FIELD(options);
  	COMPARE_SCALAR_FIELD(freeze_min_age);
--- 1572,1578 ----
  }
  
  static bool
! _equalVacuumStmt(const VacuumStmt *a, const VacuumStmt *b)
  {
  	COMPARE_SCALAR_FIELD(options);
  	COMPARE_SCALAR_FIELD(freeze_min_age);
***************
*** 1584,1590 **** _equalVacuumStmt(VacuumStmt *a, VacuumStmt *b)
  }
  
  static bool
! _equalExplainStmt(ExplainStmt *a, ExplainStmt *b)
  {
  	COMPARE_NODE_FIELD(query);
  	COMPARE_NODE_FIELD(options);
--- 1584,1590 ----
  }
  
  static bool
! _equalExplainStmt(const ExplainStmt *a, const ExplainStmt *b)
  {
  	COMPARE_NODE_FIELD(query);
  	COMPARE_NODE_FIELD(options);
***************
*** 1593,1599 **** _equalExplainStmt(ExplainStmt *a, ExplainStmt *b)
  }
  
  static bool
! _equalCreateSeqStmt(CreateSeqStmt *a, CreateSeqStmt *b)
  {
  	COMPARE_NODE_FIELD(sequence);
  	COMPARE_NODE_FIELD(options);
--- 1593,1599 ----
  }
  
  static bool
! _equalCreateSeqStmt(const CreateSeqStmt *a, const CreateSeqStmt *b)
  {
  	COMPARE_NODE_FIELD(sequence);
  	COMPARE_NODE_FIELD(options);
***************
*** 1603,1609 **** _equalCreateSeqStmt(CreateSeqStmt *a, CreateSeqStmt *b)
  }
  
  static bool
! _equalAlterSeqStmt(AlterSeqStmt *a, AlterSeqStmt *b)
  {
  	COMPARE_NODE_FIELD(sequence);
  	COMPARE_NODE_FIELD(options);
--- 1603,1609 ----
  }
  
  static bool
! _equalAlterSeqStmt(const AlterSeqStmt *a, const AlterSeqStmt *b)
  {
  	COMPARE_NODE_FIELD(sequence);
  	COMPARE_NODE_FIELD(options);
***************
*** 1612,1618 **** _equalAlterSeqStmt(AlterSeqStmt *a, AlterSeqStmt *b)
  }
  
  static bool
! _equalVariableSetStmt(VariableSetStmt *a, VariableSetStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_STRING_FIELD(name);
--- 1612,1618 ----
  }
  
  static bool
! _equalVariableSetStmt(const VariableSetStmt *a, const VariableSetStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_STRING_FIELD(name);
***************
*** 1623,1629 **** _equalVariableSetStmt(VariableSetStmt *a, VariableSetStmt *b)
  }
  
  static bool
! _equalVariableShowStmt(VariableShowStmt *a, VariableShowStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  
--- 1623,1629 ----
  }
  
  static bool
! _equalVariableShowStmt(const VariableShowStmt *a, const VariableShowStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  
***************
*** 1631,1637 **** _equalVariableShowStmt(VariableShowStmt *a, VariableShowStmt *b)
  }
  
  static bool
! _equalDiscardStmt(DiscardStmt *a, DiscardStmt *b)
  {
  	COMPARE_SCALAR_FIELD(target);
  
--- 1631,1637 ----
  }
  
  static bool
! _equalDiscardStmt(const DiscardStmt *a, const DiscardStmt *b)
  {
  	COMPARE_SCALAR_FIELD(target);
  
***************
*** 1639,1645 **** _equalDiscardStmt(DiscardStmt *a, DiscardStmt *b)
  }
  
  static bool
! _equalCreateTableSpaceStmt(CreateTableSpaceStmt *a, CreateTableSpaceStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_STRING_FIELD(owner);
--- 1639,1645 ----
  }
  
  static bool
! _equalCreateTableSpaceStmt(const CreateTableSpaceStmt *a, const CreateTableSpaceStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_STRING_FIELD(owner);
***************
*** 1649,1655 **** _equalCreateTableSpaceStmt(CreateTableSpaceStmt *a, CreateTableSpaceStmt *b)
  }
  
  static bool
! _equalDropTableSpaceStmt(DropTableSpaceStmt *a, DropTableSpaceStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_SCALAR_FIELD(missing_ok);
--- 1649,1655 ----
  }
  
  static bool
! _equalDropTableSpaceStmt(const DropTableSpaceStmt *a, const DropTableSpaceStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_SCALAR_FIELD(missing_ok);
***************
*** 1658,1665 **** _equalDropTableSpaceStmt(DropTableSpaceStmt *a, DropTableSpaceStmt *b)
  }
  
  static bool
! _equalAlterTableSpaceOptionsStmt(AlterTableSpaceOptionsStmt *a,
! 								 AlterTableSpaceOptionsStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_NODE_FIELD(options);
--- 1658,1665 ----
  }
  
  static bool
! _equalAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *a,
! 								 const AlterTableSpaceOptionsStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_NODE_FIELD(options);
***************
*** 1669,1675 **** _equalAlterTableSpaceOptionsStmt(AlterTableSpaceOptionsStmt *a,
  }
  
  static bool
! _equalCreateExtensionStmt(CreateExtensionStmt *a, CreateExtensionStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_SCALAR_FIELD(if_not_exists);
--- 1669,1675 ----
  }
  
  static bool
! _equalCreateExtensionStmt(const CreateExtensionStmt *a, const CreateExtensionStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_SCALAR_FIELD(if_not_exists);
***************
*** 1679,1685 **** _equalCreateExtensionStmt(CreateExtensionStmt *a, CreateExtensionStmt *b)
  }
  
  static bool
! _equalAlterExtensionStmt(AlterExtensionStmt *a, AlterExtensionStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_NODE_FIELD(options);
--- 1679,1685 ----
  }
  
  static bool
! _equalAlterExtensionStmt(const AlterExtensionStmt *a, const AlterExtensionStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_NODE_FIELD(options);
***************
*** 1688,1694 **** _equalAlterExtensionStmt(AlterExtensionStmt *a, AlterExtensionStmt *b)
  }
  
  static bool
! _equalAlterExtensionContentsStmt(AlterExtensionContentsStmt *a, AlterExtensionContentsStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_SCALAR_FIELD(action);
--- 1688,1694 ----
  }
  
  static bool
! _equalAlterExtensionContentsStmt(const AlterExtensionContentsStmt *a, const AlterExtensionContentsStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_SCALAR_FIELD(action);
***************
*** 1700,1706 **** _equalAlterExtensionContentsStmt(AlterExtensionContentsStmt *a, AlterExtensionCo
  }
  
  static bool
! _equalCreateFdwStmt(CreateFdwStmt *a, CreateFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_NODE_FIELD(func_options);
--- 1700,1706 ----
  }
  
  static bool
! _equalCreateFdwStmt(const CreateFdwStmt *a, const CreateFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_NODE_FIELD(func_options);
***************
*** 1710,1716 **** _equalCreateFdwStmt(CreateFdwStmt *a, CreateFdwStmt *b)
  }
  
  static bool
! _equalAlterFdwStmt(AlterFdwStmt *a, AlterFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_NODE_FIELD(func_options);
--- 1710,1716 ----
  }
  
  static bool
! _equalAlterFdwStmt(const AlterFdwStmt *a, const AlterFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_NODE_FIELD(func_options);
***************
*** 1720,1726 **** _equalAlterFdwStmt(AlterFdwStmt *a, AlterFdwStmt *b)
  }
  
  static bool
! _equalDropFdwStmt(DropFdwStmt *a, DropFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_SCALAR_FIELD(missing_ok);
--- 1720,1726 ----
  }
  
  static bool
! _equalDropFdwStmt(const DropFdwStmt *a, const DropFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_SCALAR_FIELD(missing_ok);
***************
*** 1730,1736 **** _equalDropFdwStmt(DropFdwStmt *a, DropFdwStmt *b)
  }
  
  static bool
! _equalCreateForeignServerStmt(CreateForeignServerStmt *a, CreateForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_STRING_FIELD(servertype);
--- 1730,1736 ----
  }
  
  static bool
! _equalCreateForeignServerStmt(const CreateForeignServerStmt *a, const CreateForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_STRING_FIELD(servertype);
***************
*** 1742,1748 **** _equalCreateForeignServerStmt(CreateForeignServerStmt *a, CreateForeignServerStm
  }
  
  static bool
! _equalAlterForeignServerStmt(AlterForeignServerStmt *a, AlterForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_STRING_FIELD(version);
--- 1742,1748 ----
  }
  
  static bool
! _equalAlterForeignServerStmt(const AlterForeignServerStmt *a, const AlterForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_STRING_FIELD(version);
***************
*** 1753,1759 **** _equalAlterForeignServerStmt(AlterForeignServerStmt *a, AlterForeignServerStmt *
  }
  
  static bool
! _equalDropForeignServerStmt(DropForeignServerStmt *a, DropForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_SCALAR_FIELD(missing_ok);
--- 1753,1759 ----
  }
  
  static bool
! _equalDropForeignServerStmt(const DropForeignServerStmt *a, const DropForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_SCALAR_FIELD(missing_ok);
***************
*** 1763,1769 **** _equalDropForeignServerStmt(DropForeignServerStmt *a, DropForeignServerStmt *b)
  }
  
  static bool
! _equalCreateUserMappingStmt(CreateUserMappingStmt *a, CreateUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
--- 1763,1769 ----
  }
  
  static bool
! _equalCreateUserMappingStmt(const CreateUserMappingStmt *a, const CreateUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
***************
*** 1773,1779 **** _equalCreateUserMappingStmt(CreateUserMappingStmt *a, CreateUserMappingStmt *b)
  }
  
  static bool
! _equalAlterUserMappingStmt(AlterUserMappingStmt *a, AlterUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
--- 1773,1779 ----
  }
  
  static bool
! _equalAlterUserMappingStmt(const AlterUserMappingStmt *a, const AlterUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
***************
*** 1783,1789 **** _equalAlterUserMappingStmt(AlterUserMappingStmt *a, AlterUserMappingStmt *b)
  }
  
  static bool
! _equalDropUserMappingStmt(DropUserMappingStmt *a, DropUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
--- 1783,1789 ----
  }
  
  static bool
! _equalDropUserMappingStmt(const DropUserMappingStmt *a, const DropUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
***************
*** 1793,1799 **** _equalDropUserMappingStmt(DropUserMappingStmt *a, DropUserMappingStmt *b)
  }
  
  static bool
! _equalCreateForeignTableStmt(CreateForeignTableStmt *a, CreateForeignTableStmt *b)
  {
  	if (!_equalCreateStmt(&a->base, &b->base))
  		return false;
--- 1793,1799 ----
  }
  
  static bool
! _equalCreateForeignTableStmt(const CreateForeignTableStmt *a, const CreateForeignTableStmt *b)
  {
  	if (!_equalCreateStmt(&a->base, &b->base))
  		return false;
***************
*** 1805,1811 **** _equalCreateForeignTableStmt(CreateForeignTableStmt *a, CreateForeignTableStmt *
  }
  
  static bool
! _equalCreateTrigStmt(CreateTrigStmt *a, CreateTrigStmt *b)
  {
  	COMPARE_STRING_FIELD(trigname);
  	COMPARE_NODE_FIELD(relation);
--- 1805,1811 ----
  }
  
  static bool
! _equalCreateTrigStmt(const CreateTrigStmt *a, const CreateTrigStmt *b)
  {
  	COMPARE_STRING_FIELD(trigname);
  	COMPARE_NODE_FIELD(relation);
***************
*** 1825,1831 **** _equalCreateTrigStmt(CreateTrigStmt *a, CreateTrigStmt *b)
  }
  
  static bool
! _equalDropPropertyStmt(DropPropertyStmt *a, DropPropertyStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(property);
--- 1825,1831 ----
  }
  
  static bool
! _equalDropPropertyStmt(const DropPropertyStmt *a, const DropPropertyStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(property);
***************
*** 1837,1843 **** _equalDropPropertyStmt(DropPropertyStmt *a, DropPropertyStmt *b)
  }
  
  static bool
! _equalCreatePLangStmt(CreatePLangStmt *a, CreatePLangStmt *b)
  {
  	COMPARE_SCALAR_FIELD(replace);
  	COMPARE_STRING_FIELD(plname);
--- 1837,1843 ----
  }
  
  static bool
! _equalCreatePLangStmt(const CreatePLangStmt *a, const CreatePLangStmt *b)
  {
  	COMPARE_SCALAR_FIELD(replace);
  	COMPARE_STRING_FIELD(plname);
***************
*** 1850,1856 **** _equalCreatePLangStmt(CreatePLangStmt *a, CreatePLangStmt *b)
  }
  
  static bool
! _equalDropPLangStmt(DropPLangStmt *a, DropPLangStmt *b)
  {
  	COMPARE_STRING_FIELD(plname);
  	COMPARE_SCALAR_FIELD(behavior);
--- 1850,1856 ----
  }
  
  static bool
! _equalDropPLangStmt(const DropPLangStmt *a, const DropPLangStmt *b)
  {
  	COMPARE_STRING_FIELD(plname);
  	COMPARE_SCALAR_FIELD(behavior);
***************
*** 1860,1866 **** _equalDropPLangStmt(DropPLangStmt *a, DropPLangStmt *b)
  }
  
  static bool
! _equalCreateRoleStmt(CreateRoleStmt *a, CreateRoleStmt *b)
  {
  	COMPARE_SCALAR_FIELD(stmt_type);
  	COMPARE_STRING_FIELD(role);
--- 1860,1866 ----
  }
  
  static bool
! _equalCreateRoleStmt(const CreateRoleStmt *a, const CreateRoleStmt *b)
  {
  	COMPARE_SCALAR_FIELD(stmt_type);
  	COMPARE_STRING_FIELD(role);
***************
*** 1870,1876 **** _equalCreateRoleStmt(CreateRoleStmt *a, CreateRoleStmt *b)
  }
  
  static bool
! _equalAlterRoleStmt(AlterRoleStmt *a, AlterRoleStmt *b)
  {
  	COMPARE_STRING_FIELD(role);
  	COMPARE_NODE_FIELD(options);
--- 1870,1876 ----
  }
  
  static bool
! _equalAlterRoleStmt(const AlterRoleStmt *a, const AlterRoleStmt *b)
  {
  	COMPARE_STRING_FIELD(role);
  	COMPARE_NODE_FIELD(options);
***************
*** 1880,1886 **** _equalAlterRoleStmt(AlterRoleStmt *a, AlterRoleStmt *b)
  }
  
  static bool
! _equalAlterRoleSetStmt(AlterRoleSetStmt *a, AlterRoleSetStmt *b)
  {
  	COMPARE_STRING_FIELD(role);
  	COMPARE_STRING_FIELD(database);
--- 1880,1886 ----
  }
  
  static bool
! _equalAlterRoleSetStmt(const AlterRoleSetStmt *a, const AlterRoleSetStmt *b)
  {
  	COMPARE_STRING_FIELD(role);
  	COMPARE_STRING_FIELD(database);
***************
*** 1890,1896 **** _equalAlterRoleSetStmt(AlterRoleSetStmt *a, AlterRoleSetStmt *b)
  }
  
  static bool
! _equalDropRoleStmt(DropRoleStmt *a, DropRoleStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_SCALAR_FIELD(missing_ok);
--- 1890,1896 ----
  }
  
  static bool
! _equalDropRoleStmt(const DropRoleStmt *a, const DropRoleStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_SCALAR_FIELD(missing_ok);
***************
*** 1899,1905 **** _equalDropRoleStmt(DropRoleStmt *a, DropRoleStmt *b)
  }
  
  static bool
! _equalLockStmt(LockStmt *a, LockStmt *b)
  {
  	COMPARE_NODE_FIELD(relations);
  	COMPARE_SCALAR_FIELD(mode);
--- 1899,1905 ----
  }
  
  static bool
! _equalLockStmt(const LockStmt *a, const LockStmt *b)
  {
  	COMPARE_NODE_FIELD(relations);
  	COMPARE_SCALAR_FIELD(mode);
***************
*** 1909,1915 **** _equalLockStmt(LockStmt *a, LockStmt *b)
  }
  
  static bool
! _equalConstraintsSetStmt(ConstraintsSetStmt *a, ConstraintsSetStmt *b)
  {
  	COMPARE_NODE_FIELD(constraints);
  	COMPARE_SCALAR_FIELD(deferred);
--- 1909,1915 ----
  }
  
  static bool
! _equalConstraintsSetStmt(const ConstraintsSetStmt *a, const ConstraintsSetStmt *b)
  {
  	COMPARE_NODE_FIELD(constraints);
  	COMPARE_SCALAR_FIELD(deferred);
***************
*** 1918,1924 **** _equalConstraintsSetStmt(ConstraintsSetStmt *a, ConstraintsSetStmt *b)
  }
  
  static bool
! _equalReindexStmt(ReindexStmt *a, ReindexStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(relation);
--- 1918,1924 ----
  }
  
  static bool
! _equalReindexStmt(const ReindexStmt *a, const ReindexStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(relation);
***************
*** 1930,1936 **** _equalReindexStmt(ReindexStmt *a, ReindexStmt *b)
  }
  
  static bool
! _equalCreateSchemaStmt(CreateSchemaStmt *a, CreateSchemaStmt *b)
  {
  	COMPARE_STRING_FIELD(schemaname);
  	COMPARE_STRING_FIELD(authid);
--- 1930,1936 ----
  }
  
  static bool
! _equalCreateSchemaStmt(const CreateSchemaStmt *a, const CreateSchemaStmt *b)
  {
  	COMPARE_STRING_FIELD(schemaname);
  	COMPARE_STRING_FIELD(authid);
***************
*** 1940,1946 **** _equalCreateSchemaStmt(CreateSchemaStmt *a, CreateSchemaStmt *b)
  }
  
  static bool
! _equalCreateConversionStmt(CreateConversionStmt *a, CreateConversionStmt *b)
  {
  	COMPARE_NODE_FIELD(conversion_name);
  	COMPARE_STRING_FIELD(for_encoding_name);
--- 1940,1946 ----
  }
  
  static bool
! _equalCreateConversionStmt(const CreateConversionStmt *a, const CreateConversionStmt *b)
  {
  	COMPARE_NODE_FIELD(conversion_name);
  	COMPARE_STRING_FIELD(for_encoding_name);
***************
*** 1952,1958 **** _equalCreateConversionStmt(CreateConversionStmt *a, CreateConversionStmt *b)
  }
  
  static bool
! _equalCreateCastStmt(CreateCastStmt *a, CreateCastStmt *b)
  {
  	COMPARE_NODE_FIELD(sourcetype);
  	COMPARE_NODE_FIELD(targettype);
--- 1952,1958 ----
  }
  
  static bool
! _equalCreateCastStmt(const CreateCastStmt *a, const CreateCastStmt *b)
  {
  	COMPARE_NODE_FIELD(sourcetype);
  	COMPARE_NODE_FIELD(targettype);
***************
*** 1964,1970 **** _equalCreateCastStmt(CreateCastStmt *a, CreateCastStmt *b)
  }
  
  static bool
! _equalDropCastStmt(DropCastStmt *a, DropCastStmt *b)
  {
  	COMPARE_NODE_FIELD(sourcetype);
  	COMPARE_NODE_FIELD(targettype);
--- 1964,1970 ----
  }
  
  static bool
! _equalDropCastStmt(const DropCastStmt *a, const DropCastStmt *b)
  {
  	COMPARE_NODE_FIELD(sourcetype);
  	COMPARE_NODE_FIELD(targettype);
***************
*** 1975,1981 **** _equalDropCastStmt(DropCastStmt *a, DropCastStmt *b)
  }
  
  static bool
! _equalPrepareStmt(PrepareStmt *a, PrepareStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(argtypes);
--- 1975,1981 ----
  }
  
  static bool
! _equalPrepareStmt(const PrepareStmt *a, const PrepareStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(argtypes);
***************
*** 1985,1991 **** _equalPrepareStmt(PrepareStmt *a, PrepareStmt *b)
  }
  
  static bool
! _equalExecuteStmt(ExecuteStmt *a, ExecuteStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(into);
--- 1985,1991 ----
  }
  
  static bool
! _equalExecuteStmt(const ExecuteStmt *a, const ExecuteStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(into);
***************
*** 1995,2001 **** _equalExecuteStmt(ExecuteStmt *a, ExecuteStmt *b)
  }
  
  static bool
! _equalDeallocateStmt(DeallocateStmt *a, DeallocateStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  
--- 1995,2001 ----
  }
  
  static bool
! _equalDeallocateStmt(const DeallocateStmt *a, const DeallocateStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  
***************
*** 2003,2009 **** _equalDeallocateStmt(DeallocateStmt *a, DeallocateStmt *b)
  }
  
  static bool
! _equalDropOwnedStmt(DropOwnedStmt *a, DropOwnedStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_SCALAR_FIELD(behavior);
--- 2003,2009 ----
  }
  
  static bool
! _equalDropOwnedStmt(const DropOwnedStmt *a, const DropOwnedStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_SCALAR_FIELD(behavior);
***************
*** 2012,2018 **** _equalDropOwnedStmt(DropOwnedStmt *a, DropOwnedStmt *b)
  }
  
  static bool
! _equalReassignOwnedStmt(ReassignOwnedStmt *a, ReassignOwnedStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_NODE_FIELD(newrole);
--- 2012,2018 ----
  }
  
  static bool
! _equalReassignOwnedStmt(const ReassignOwnedStmt *a, const ReassignOwnedStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_NODE_FIELD(newrole);
***************
*** 2021,2027 **** _equalReassignOwnedStmt(ReassignOwnedStmt *a, ReassignOwnedStmt *b)
  }
  
  static bool
! _equalAlterTSDictionaryStmt(AlterTSDictionaryStmt *a, AlterTSDictionaryStmt *b)
  {
  	COMPARE_NODE_FIELD(dictname);
  	COMPARE_NODE_FIELD(options);
--- 2021,2027 ----
  }
  
  static bool
! _equalAlterTSDictionaryStmt(const AlterTSDictionaryStmt *a, const AlterTSDictionaryStmt *b)
  {
  	COMPARE_NODE_FIELD(dictname);
  	COMPARE_NODE_FIELD(options);
***************
*** 2030,2037 **** _equalAlterTSDictionaryStmt(AlterTSDictionaryStmt *a, AlterTSDictionaryStmt *b)
  }
  
  static bool
! _equalAlterTSConfigurationStmt(AlterTSConfigurationStmt *a,
! 							   AlterTSConfigurationStmt *b)
  {
  	COMPARE_NODE_FIELD(cfgname);
  	COMPARE_NODE_FIELD(tokentype);
--- 2030,2037 ----
  }
  
  static bool
! _equalAlterTSConfigurationStmt(const AlterTSConfigurationStmt *a,
! 							   const AlterTSConfigurationStmt *b)
  {
  	COMPARE_NODE_FIELD(cfgname);
  	COMPARE_NODE_FIELD(tokentype);
***************
*** 2044,2050 **** _equalAlterTSConfigurationStmt(AlterTSConfigurationStmt *a,
  }
  
  static bool
! _equalAExpr(A_Expr *a, A_Expr *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(name);
--- 2044,2050 ----
  }
  
  static bool
! _equalAExpr(const A_Expr *a, const A_Expr *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(name);
***************
*** 2056,2062 **** _equalAExpr(A_Expr *a, A_Expr *b)
  }
  
  static bool
! _equalColumnRef(ColumnRef *a, ColumnRef *b)
  {
  	COMPARE_NODE_FIELD(fields);
  	COMPARE_LOCATION_FIELD(location);
--- 2056,2062 ----
  }
  
  static bool
! _equalColumnRef(const ColumnRef *a, const ColumnRef *b)
  {
  	COMPARE_NODE_FIELD(fields);
  	COMPARE_LOCATION_FIELD(location);
***************
*** 2065,2071 **** _equalColumnRef(ColumnRef *a, ColumnRef *b)
  }
  
  static bool
! _equalParamRef(ParamRef *a, ParamRef *b)
  {
  	COMPARE_SCALAR_FIELD(number);
  	COMPARE_LOCATION_FIELD(location);
--- 2065,2071 ----
  }
  
  static bool
! _equalParamRef(const ParamRef *a, const ParamRef *b)
  {
  	COMPARE_SCALAR_FIELD(number);
  	COMPARE_LOCATION_FIELD(location);
***************
*** 2084,2090 **** _equalAConst(A_Const *a, A_Const *b)
  }
  
  static bool
! _equalFuncCall(FuncCall *a, FuncCall *b)
  {
  	COMPARE_NODE_FIELD(funcname);
  	COMPARE_NODE_FIELD(args);
--- 2084,2090 ----
  }
  
  static bool
! _equalFuncCall(const FuncCall *a, const FuncCall *b)
  {
  	COMPARE_NODE_FIELD(funcname);
  	COMPARE_NODE_FIELD(args);
***************
*** 2099,2111 **** _equalFuncCall(FuncCall *a, FuncCall *b)
  }
  
  static bool
! _equalAStar(A_Star *a, A_Star *b)
  {
  	return true;
  }
  
  static bool
! _equalAIndices(A_Indices *a, A_Indices *b)
  {
  	COMPARE_NODE_FIELD(lidx);
  	COMPARE_NODE_FIELD(uidx);
--- 2099,2111 ----
  }
  
  static bool
! _equalAStar(const A_Star *a, const A_Star *b)
  {
  	return true;
  }
  
  static bool
! _equalAIndices(const A_Indices *a, const A_Indices *b)
  {
  	COMPARE_NODE_FIELD(lidx);
  	COMPARE_NODE_FIELD(uidx);
***************
*** 2114,2120 **** _equalAIndices(A_Indices *a, A_Indices *b)
  }
  
  static bool
! _equalA_Indirection(A_Indirection *a, A_Indirection *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(indirection);
--- 2114,2120 ----
  }
  
  static bool
! _equalA_Indirection(const A_Indirection *a, const A_Indirection *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(indirection);
***************
*** 2123,2129 **** _equalA_Indirection(A_Indirection *a, A_Indirection *b)
  }
  
  static bool
! _equalA_ArrayExpr(A_ArrayExpr *a, A_ArrayExpr *b)
  {
  	COMPARE_NODE_FIELD(elements);
  	COMPARE_LOCATION_FIELD(location);
--- 2123,2129 ----
  }
  
  static bool
! _equalA_ArrayExpr(const A_ArrayExpr *a, const A_ArrayExpr *b)
  {
  	COMPARE_NODE_FIELD(elements);
  	COMPARE_LOCATION_FIELD(location);
***************
*** 2132,2138 **** _equalA_ArrayExpr(A_ArrayExpr *a, A_ArrayExpr *b)
  }
  
  static bool
! _equalResTarget(ResTarget *a, ResTarget *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(indirection);
--- 2132,2138 ----
  }
  
  static bool
! _equalResTarget(const ResTarget *a, const ResTarget *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(indirection);
***************
*** 2143,2149 **** _equalResTarget(ResTarget *a, ResTarget *b)
  }
  
  static bool
! _equalTypeName(TypeName *a, TypeName *b)
  {
  	COMPARE_NODE_FIELD(names);
  	COMPARE_SCALAR_FIELD(typeOid);
--- 2143,2149 ----
  }
  
  static bool
! _equalTypeName(const TypeName *a, const TypeName *b)
  {
  	COMPARE_NODE_FIELD(names);
  	COMPARE_SCALAR_FIELD(typeOid);
***************
*** 2158,2164 **** _equalTypeName(TypeName *a, TypeName *b)
  }
  
  static bool
! _equalTypeCast(TypeCast *a, TypeCast *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(typeName);
--- 2158,2164 ----
  }
  
  static bool
! _equalTypeCast(const TypeCast *a, const TypeCast *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(typeName);
***************
*** 2168,2174 **** _equalTypeCast(TypeCast *a, TypeCast *b)
  }
  
  static bool
! _equalCollateClause(CollateClause *a, CollateClause *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(collname);
--- 2168,2174 ----
  }
  
  static bool
! _equalCollateClause(const CollateClause *a, const CollateClause *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(collname);
***************
*** 2178,2184 **** _equalCollateClause(CollateClause *a, CollateClause *b)
  }
  
  static bool
! _equalSortBy(SortBy *a, SortBy *b)
  {
  	COMPARE_NODE_FIELD(node);
  	COMPARE_SCALAR_FIELD(sortby_dir);
--- 2178,2184 ----
  }
  
  static bool
! _equalSortBy(const SortBy *a, const SortBy *b)
  {
  	COMPARE_NODE_FIELD(node);
  	COMPARE_SCALAR_FIELD(sortby_dir);
***************
*** 2190,2196 **** _equalSortBy(SortBy *a, SortBy *b)
  }
  
  static bool
! _equalWindowDef(WindowDef *a, WindowDef *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_STRING_FIELD(refname);
--- 2190,2196 ----
  }
  
  static bool
! _equalWindowDef(const WindowDef *a, const WindowDef *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_STRING_FIELD(refname);
***************
*** 2205,2211 **** _equalWindowDef(WindowDef *a, WindowDef *b)
  }
  
  static bool
! _equalRangeSubselect(RangeSubselect *a, RangeSubselect *b)
  {
  	COMPARE_NODE_FIELD(subquery);
  	COMPARE_NODE_FIELD(alias);
--- 2205,2211 ----
  }
  
  static bool
! _equalRangeSubselect(const RangeSubselect *a, const RangeSubselect *b)
  {
  	COMPARE_NODE_FIELD(subquery);
  	COMPARE_NODE_FIELD(alias);
***************
*** 2214,2220 **** _equalRangeSubselect(RangeSubselect *a, RangeSubselect *b)
  }
  
  static bool
! _equalRangeFunction(RangeFunction *a, RangeFunction *b)
  {
  	COMPARE_NODE_FIELD(funccallnode);
  	COMPARE_NODE_FIELD(alias);
--- 2214,2220 ----
  }
  
  static bool
! _equalRangeFunction(const RangeFunction *a, const RangeFunction *b)
  {
  	COMPARE_NODE_FIELD(funccallnode);
  	COMPARE_NODE_FIELD(alias);
***************
*** 2224,2230 **** _equalRangeFunction(RangeFunction *a, RangeFunction *b)
  }
  
  static bool
! _equalIndexElem(IndexElem *a, IndexElem *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(expr);
--- 2224,2230 ----
  }
  
  static bool
! _equalIndexElem(const IndexElem *a, const IndexElem *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(expr);
***************
*** 2238,2244 **** _equalIndexElem(IndexElem *a, IndexElem *b)
  }
  
  static bool
! _equalColumnDef(ColumnDef *a, ColumnDef *b)
  {
  	COMPARE_STRING_FIELD(colname);
  	COMPARE_NODE_FIELD(typeName);
--- 2238,2244 ----
  }
  
  static bool
! _equalColumnDef(const ColumnDef *a, const ColumnDef *b)
  {
  	COMPARE_STRING_FIELD(colname);
  	COMPARE_NODE_FIELD(typeName);
***************
*** 2257,2263 **** _equalColumnDef(ColumnDef *a, ColumnDef *b)
  }
  
  static bool
! _equalConstraint(Constraint *a, Constraint *b)
  {
  	COMPARE_SCALAR_FIELD(contype);
  	COMPARE_STRING_FIELD(conname);
--- 2257,2263 ----
  }
  
  static bool
! _equalConstraint(const Constraint *a, const Constraint *b)
  {
  	COMPARE_SCALAR_FIELD(contype);
  	COMPARE_STRING_FIELD(conname);
***************
*** 2286,2292 **** _equalConstraint(Constraint *a, Constraint *b)
  }
  
  static bool
! _equalDefElem(DefElem *a, DefElem *b)
  {
  	COMPARE_STRING_FIELD(defnamespace);
  	COMPARE_STRING_FIELD(defname);
--- 2286,2292 ----
  }
  
  static bool
! _equalDefElem(const DefElem *a, const DefElem *b)
  {
  	COMPARE_STRING_FIELD(defnamespace);
  	COMPARE_STRING_FIELD(defname);
***************
*** 2297,2303 **** _equalDefElem(DefElem *a, DefElem *b)
  }
  
  static bool
! _equalLockingClause(LockingClause *a, LockingClause *b)
  {
  	COMPARE_NODE_FIELD(lockedRels);
  	COMPARE_SCALAR_FIELD(forUpdate);
--- 2297,2303 ----
  }
  
  static bool
! _equalLockingClause(const LockingClause *a, const LockingClause *b)
  {
  	COMPARE_NODE_FIELD(lockedRels);
  	COMPARE_SCALAR_FIELD(forUpdate);
***************
*** 2307,2313 **** _equalLockingClause(LockingClause *a, LockingClause *b)
  }
  
  static bool
! _equalRangeTblEntry(RangeTblEntry *a, RangeTblEntry *b)
  {
  	COMPARE_SCALAR_FIELD(rtekind);
  	COMPARE_SCALAR_FIELD(relid);
--- 2307,2313 ----
  }
  
  static bool
! _equalRangeTblEntry(const RangeTblEntry *a, const RangeTblEntry *b)
  {
  	COMPARE_SCALAR_FIELD(rtekind);
  	COMPARE_SCALAR_FIELD(relid);
***************
*** 2340,2346 **** _equalRangeTblEntry(RangeTblEntry *a, RangeTblEntry *b)
  }
  
  static bool
! _equalSortGroupClause(SortGroupClause *a, SortGroupClause *b)
  {
  	COMPARE_SCALAR_FIELD(tleSortGroupRef);
  	COMPARE_SCALAR_FIELD(eqop);
--- 2340,2346 ----
  }
  
  static bool
! _equalSortGroupClause(const SortGroupClause *a, const SortGroupClause *b)
  {
  	COMPARE_SCALAR_FIELD(tleSortGroupRef);
  	COMPARE_SCALAR_FIELD(eqop);
***************
*** 2352,2358 **** _equalSortGroupClause(SortGroupClause *a, SortGroupClause *b)
  }
  
  static bool
! _equalWindowClause(WindowClause *a, WindowClause *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_STRING_FIELD(refname);
--- 2352,2358 ----
  }
  
  static bool
! _equalWindowClause(const WindowClause *a, const WindowClause *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_STRING_FIELD(refname);
***************
*** 2368,2374 **** _equalWindowClause(WindowClause *a, WindowClause *b)
  }
  
  static bool
! _equalRowMarkClause(RowMarkClause *a, RowMarkClause *b)
  {
  	COMPARE_SCALAR_FIELD(rti);
  	COMPARE_SCALAR_FIELD(forUpdate);
--- 2368,2374 ----
  }
  
  static bool
! _equalRowMarkClause(const RowMarkClause *a, const RowMarkClause *b)
  {
  	COMPARE_SCALAR_FIELD(rti);
  	COMPARE_SCALAR_FIELD(forUpdate);
***************
*** 2379,2385 **** _equalRowMarkClause(RowMarkClause *a, RowMarkClause *b)
  }
  
  static bool
! _equalWithClause(WithClause *a, WithClause *b)
  {
  	COMPARE_NODE_FIELD(ctes);
  	COMPARE_SCALAR_FIELD(recursive);
--- 2379,2385 ----
  }
  
  static bool
! _equalWithClause(const WithClause *a, const WithClause *b)
  {
  	COMPARE_NODE_FIELD(ctes);
  	COMPARE_SCALAR_FIELD(recursive);
***************
*** 2389,2395 **** _equalWithClause(WithClause *a, WithClause *b)
  }
  
  static bool
! _equalCommonTableExpr(CommonTableExpr *a, CommonTableExpr *b)
  {
  	COMPARE_STRING_FIELD(ctename);
  	COMPARE_NODE_FIELD(aliascolnames);
--- 2389,2395 ----
  }
  
  static bool
! _equalCommonTableExpr(const CommonTableExpr *a, const CommonTableExpr *b)
  {
  	COMPARE_STRING_FIELD(ctename);
  	COMPARE_NODE_FIELD(aliascolnames);
***************
*** 2406,2412 **** _equalCommonTableExpr(CommonTableExpr *a, CommonTableExpr *b)
  }
  
  static bool
! _equalXmlSerialize(XmlSerialize *a, XmlSerialize *b)
  {
  	COMPARE_SCALAR_FIELD(xmloption);
  	COMPARE_NODE_FIELD(expr);
--- 2406,2412 ----
  }
  
  static bool
! _equalXmlSerialize(const XmlSerialize *a, const XmlSerialize *b)
  {
  	COMPARE_SCALAR_FIELD(xmloption);
  	COMPARE_NODE_FIELD(expr);
***************
*** 2423,2430 **** _equalXmlSerialize(XmlSerialize *a, XmlSerialize *b)
  static bool
  _equalList(List *a, List *b)
  {
! 	ListCell   *item_a;
! 	ListCell   *item_b;
  
  	/*
  	 * Try to reject by simple scalar checks before grovelling through all the
--- 2423,2430 ----
  static bool
  _equalList(List *a, List *b)
  {
! 	const ListCell   *item_a;
! 	const ListCell   *item_b;
  
  	/*
  	 * Try to reject by simple scalar checks before grovelling through all the
***************
*** 2480,2486 **** _equalList(List *a, List *b)
   */
  
  static bool
! _equalValue(Value *a, Value *b)
  {
  	COMPARE_SCALAR_FIELD(type);
  
--- 2480,2486 ----
   */
  
  static bool
! _equalValue(const Value *a, const Value *b)
  {
  	COMPARE_SCALAR_FIELD(type);
  
*** a/src/backend/nodes/list.c
--- b/src/backend/nodes/list.c
***************
*** 443,449 **** list_nth_oid(List *list, int n)
  bool
  list_member(List *list, void *datum)
  {
! 	ListCell   *cell;
  
  	Assert(IsPointerList(list));
  	check_list_invariants(list);
--- 443,449 ----
  bool
  list_member(List *list, void *datum)
  {
! 	const ListCell   *cell;
  
  	Assert(IsPointerList(list));
  	check_list_invariants(list);
***************
*** 462,470 **** list_member(List *list, void *datum)
   * determined by using simple pointer comparison.
   */
  bool
! list_member_ptr(List *list, void *datum)
  {
! 	ListCell   *cell;
  
  	Assert(IsPointerList(list));
  	check_list_invariants(list);
--- 462,470 ----
   * determined by using simple pointer comparison.
   */
  bool
! list_member_ptr(List *list, const void *datum)
  {
! 	const ListCell   *cell;
  
  	Assert(IsPointerList(list));
  	check_list_invariants(list);
***************
*** 484,490 **** list_member_ptr(List *list, void *datum)
  bool
  list_member_int(List *list, int datum)
  {
! 	ListCell   *cell;
  
  	Assert(IsIntegerList(list));
  	check_list_invariants(list);
--- 484,490 ----
  bool
  list_member_int(List *list, int datum)
  {
! 	const ListCell   *cell;
  
  	Assert(IsIntegerList(list));
  	check_list_invariants(list);
***************
*** 504,510 **** list_member_int(List *list, int datum)
  bool
  list_member_oid(List *list, Oid datum)
  {
! 	ListCell   *cell;
  
  	Assert(IsOidList(list));
  	check_list_invariants(list);
--- 504,510 ----
  bool
  list_member_oid(List *list, Oid datum)
  {
! 	const ListCell   *cell;
  
  	Assert(IsOidList(list));
  	check_list_invariants(list);
***************
*** 697,703 **** List *
  list_union(List *list1, List *list2)
  {
  	List	   *result;
! 	ListCell   *cell;
  
  	Assert(IsPointerList(list1));
  	Assert(IsPointerList(list2));
--- 697,703 ----
  list_union(List *list1, List *list2)
  {
  	List	   *result;
! 	const ListCell   *cell;
  
  	Assert(IsPointerList(list1));
  	Assert(IsPointerList(list2));
***************
*** 721,727 **** List *
  list_union_ptr(List *list1, List *list2)
  {
  	List	   *result;
! 	ListCell   *cell;
  
  	Assert(IsPointerList(list1));
  	Assert(IsPointerList(list2));
--- 721,727 ----
  list_union_ptr(List *list1, List *list2)
  {
  	List	   *result;
! 	const ListCell   *cell;
  
  	Assert(IsPointerList(list1));
  	Assert(IsPointerList(list2));
***************
*** 744,750 **** List *
  list_union_int(List *list1, List *list2)
  {
  	List	   *result;
! 	ListCell   *cell;
  
  	Assert(IsIntegerList(list1));
  	Assert(IsIntegerList(list2));
--- 744,750 ----
  list_union_int(List *list1, List *list2)
  {
  	List	   *result;
! 	const ListCell   *cell;
  
  	Assert(IsIntegerList(list1));
  	Assert(IsIntegerList(list2));
***************
*** 767,773 **** List *
  list_union_oid(List *list1, List *list2)
  {
  	List	   *result;
! 	ListCell   *cell;
  
  	Assert(IsOidList(list1));
  	Assert(IsOidList(list2));
--- 767,773 ----
  list_union_oid(List *list1, List *list2)
  {
  	List	   *result;
! 	const ListCell   *cell;
  
  	Assert(IsOidList(list1));
  	Assert(IsOidList(list2));
***************
*** 800,806 **** List *
  list_intersection(List *list1, List *list2)
  {
  	List	   *result;
! 	ListCell   *cell;
  
  	if (list1 == NIL || list2 == NIL)
  		return NIL;
--- 800,806 ----
  list_intersection(List *list1, List *list2)
  {
  	List	   *result;
! 	const ListCell   *cell;
  
  	if (list1 == NIL || list2 == NIL)
  		return NIL;
***************
*** 831,837 **** list_intersection(List *list1, List *list2)
  List *
  list_difference(List *list1, List *list2)
  {
! 	ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsPointerList(list1));
--- 831,837 ----
  List *
  list_difference(List *list1, List *list2)
  {
! 	const ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsPointerList(list1));
***************
*** 857,863 **** list_difference(List *list1, List *list2)
  List *
  list_difference_ptr(List *list1, List *list2)
  {
! 	ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsPointerList(list1));
--- 857,863 ----
  List *
  list_difference_ptr(List *list1, List *list2)
  {
! 	const ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsPointerList(list1));
***************
*** 882,888 **** list_difference_ptr(List *list1, List *list2)
  List *
  list_difference_int(List *list1, List *list2)
  {
! 	ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsIntegerList(list1));
--- 882,888 ----
  List *
  list_difference_int(List *list1, List *list2)
  {
! 	const ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsIntegerList(list1));
***************
*** 907,913 **** list_difference_int(List *list1, List *list2)
  List *
  list_difference_oid(List *list1, List *list2)
  {
! 	ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsOidList(list1));
--- 907,913 ----
  List *
  list_difference_oid(List *list1, List *list2)
  {
! 	const ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsOidList(list1));
*** a/src/backend/nodes/nodeFuncs.c
--- b/src/backend/nodes/nodeFuncs.c
***************
*** 32,38 **** static int	leftmostLoc(int loc1, int loc2);
   *	  returns the Oid of the type of the expression's result.
   */
  Oid
! exprType(Node *expr)
  {
  	Oid			type;
  
--- 32,38 ----
   *	  returns the Oid of the type of the expression's result.
   */
  Oid
! exprType(const Node *expr)
  {
  	Oid			type;
  
***************
*** 241,247 **** exprType(Node *expr)
   *	  if it can be determined.	In many cases, it can't and we return -1.
   */
  int32
! exprTypmod(Node *expr)
  {
  	if (!expr)
  		return -1;
--- 241,247 ----
   *	  if it can be determined.	In many cases, it can't and we return -1.
   */
  int32
! exprTypmod(const Node *expr)
  {
  	if (!expr)
  		return -1;
***************
*** 481,487 **** exprTypmod(Node *expr)
   * length coercion by this routine.
   */
  bool
! exprIsLengthCoercion(Node *expr, int32 *coercedTypmod)
  {
  	if (coercedTypmod != NULL)
  		*coercedTypmod = -1;	/* default result on failure */
--- 481,487 ----
   * length coercion by this routine.
   */
  bool
! exprIsLengthCoercion(const Node *expr, int32 *coercedTypmod)
  {
  	if (coercedTypmod != NULL)
  		*coercedTypmod = -1;	/* default result on failure */
***************
*** 632,638 **** expression_returns_set_walker(Node *node, void *context)
   * or vice versa, the two are different.
   */
  Oid
! exprCollation(Node *expr)
  {
  	Oid			coll;
  
--- 632,638 ----
   * or vice versa, the two are different.
   */
  Oid
! exprCollation(const Node *expr)
  {
  	Oid			coll;
  
***************
*** 822,828 **** exprCollation(Node *expr)
   * Result is InvalidOid if the node type doesn't store this information.
   */
  Oid
! exprInputCollation(Node *expr)
  {
  	Oid			coll;
  
--- 822,828 ----
   * Result is InvalidOid if the node type doesn't store this information.
   */
  Oid
! exprInputCollation(const Node *expr)
  {
  	Oid			coll;
  
***************
*** 1078,1084 **** exprSetInputCollation(Node *expr, Oid inputcollation)
   * known and unknown locations in a tree.
   */
  int
! exprLocation(Node *expr)
  {
  	int			loc;
  
--- 1078,1084 ----
   * known and unknown locations in a tree.
   */
  int
! exprLocation(const Node *expr)
  {
  	int			loc;
  
*** a/src/backend/nodes/outfuncs.c
--- b/src/backend/nodes/outfuncs.c
***************
*** 105,111 **** static void _outNode(StringInfo str, void *obj);
   *	  If a null or empty string is given, it is encoded as "<>".
   */
  static void
! _outToken(StringInfo str, char *s)
  {
  	if (s == NULL || *s == '\0')
  	{
--- 105,111 ----
   *	  If a null or empty string is given, it is encoded as "<>".
   */
  static void
! _outToken(StringInfo str, const char *s)
  {
  	if (s == NULL || *s == '\0')
  	{
***************
*** 139,145 **** _outToken(StringInfo str, char *s)
  static void
  _outList(StringInfo str, List *node)
  {
! 	ListCell   *lc;
  
  	appendStringInfoChar(str, '(');
  
--- 139,145 ----
  static void
  _outList(StringInfo str, List *node)
  {
! 	const ListCell   *lc;
  
  	appendStringInfoChar(str, '(');
  
***************
*** 180,186 **** _outList(StringInfo str, List *node)
   * Note: the output format is "(b int int ...)", similar to an integer List.
   */
  static void
! _outBitmapset(StringInfo str, Bitmapset *bms)
  {
  	Bitmapset  *tmpset;
  	int			x;
--- 180,186 ----
   * Note: the output format is "(b int int ...)", similar to an integer List.
   */
  static void
! _outBitmapset(StringInfo str, const Bitmapset *bms)
  {
  	Bitmapset  *tmpset;
  	int			x;
***************
*** 235,241 **** _outDatum(StringInfo str, Datum value, int typlen, bool typbyval)
   */
  
  static void
! _outPlannedStmt(StringInfo str, PlannedStmt *node)
  {
  	WRITE_NODE_TYPE("PLANNEDSTMT");
  
--- 235,241 ----
   */
  
  static void
! _outPlannedStmt(StringInfo str, const PlannedStmt *node)
  {
  	WRITE_NODE_TYPE("PLANNEDSTMT");
  
***************
*** 261,267 **** _outPlannedStmt(StringInfo str, PlannedStmt *node)
   * print the basic stuff of all nodes that inherit from Plan
   */
  static void
! _outPlanInfo(StringInfo str, Plan *node)
  {
  	WRITE_FLOAT_FIELD(startup_cost, "%.2f");
  	WRITE_FLOAT_FIELD(total_cost, "%.2f");
--- 261,267 ----
   * print the basic stuff of all nodes that inherit from Plan
   */
  static void
! _outPlanInfo(StringInfo str, const Plan *node)
  {
  	WRITE_FLOAT_FIELD(startup_cost, "%.2f");
  	WRITE_FLOAT_FIELD(total_cost, "%.2f");
***************
*** 280,288 **** _outPlanInfo(StringInfo str, Plan *node)
   * print the basic stuff of all nodes that inherit from Scan
   */
  static void
! _outScanInfo(StringInfo str, Scan *node)
  {
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_UINT_FIELD(scanrelid);
  }
--- 280,288 ----
   * print the basic stuff of all nodes that inherit from Scan
   */
  static void
! _outScanInfo(StringInfo str, const Scan *node)
  {
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_UINT_FIELD(scanrelid);
  }
***************
*** 291,299 **** _outScanInfo(StringInfo str, Scan *node)
   * print the basic stuff of all nodes that inherit from Join
   */
  static void
! _outJoinPlanInfo(StringInfo str, Join *node)
  {
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_ENUM_FIELD(jointype, JoinType);
  	WRITE_NODE_FIELD(joinqual);
--- 291,299 ----
   * print the basic stuff of all nodes that inherit from Join
   */
  static void
! _outJoinPlanInfo(StringInfo str, const Join *node)
  {
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_ENUM_FIELD(jointype, JoinType);
  	WRITE_NODE_FIELD(joinqual);
***************
*** 301,329 **** _outJoinPlanInfo(StringInfo str, Join *node)
  
  
  static void
! _outPlan(StringInfo str, Plan *node)
  {
  	WRITE_NODE_TYPE("PLAN");
  
! 	_outPlanInfo(str, (Plan *) node);
  }
  
  static void
! _outResult(StringInfo str, Result *node)
  {
  	WRITE_NODE_TYPE("RESULT");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(resconstantqual);
  }
  
  static void
! _outModifyTable(StringInfo str, ModifyTable *node)
  {
  	WRITE_NODE_TYPE("MODIFYTABLE");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_ENUM_FIELD(operation, CmdType);
  	WRITE_BOOL_FIELD(canSetTag);
--- 301,329 ----
  
  
  static void
! _outPlan(StringInfo str, const Plan *node)
  {
  	WRITE_NODE_TYPE("PLAN");
  
! 	_outPlanInfo(str, (const Plan *) node);
  }
  
  static void
! _outResult(StringInfo str, const Result *node)
  {
  	WRITE_NODE_TYPE("RESULT");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(resconstantqual);
  }
  
  static void
! _outModifyTable(StringInfo str, const ModifyTable *node)
  {
  	WRITE_NODE_TYPE("MODIFYTABLE");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_ENUM_FIELD(operation, CmdType);
  	WRITE_BOOL_FIELD(canSetTag);
***************
*** 336,358 **** _outModifyTable(StringInfo str, ModifyTable *node)
  }
  
  static void
! _outAppend(StringInfo str, Append *node)
  {
  	WRITE_NODE_TYPE("APPEND");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(appendplans);
  }
  
  static void
! _outMergeAppend(StringInfo str, MergeAppend *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("MERGEAPPEND");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(mergeplans);
  
--- 336,358 ----
  }
  
  static void
! _outAppend(StringInfo str, const Append *node)
  {
  	WRITE_NODE_TYPE("APPEND");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(appendplans);
  }
  
  static void
! _outMergeAppend(StringInfo str, const MergeAppend *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("MERGEAPPEND");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(mergeplans);
  
***************
*** 376,388 **** _outMergeAppend(StringInfo str, MergeAppend *node)
  }
  
  static void
! _outRecursiveUnion(StringInfo str, RecursiveUnion *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("RECURSIVEUNION");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_INT_FIELD(wtParam);
  	WRITE_INT_FIELD(numCols);
--- 376,388 ----
  }
  
  static void
! _outRecursiveUnion(StringInfo str, const RecursiveUnion *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("RECURSIVEUNION");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_INT_FIELD(wtParam);
  	WRITE_INT_FIELD(numCols);
***************
*** 399,445 **** _outRecursiveUnion(StringInfo str, RecursiveUnion *node)
  }
  
  static void
! _outBitmapAnd(StringInfo str, BitmapAnd *node)
  {
  	WRITE_NODE_TYPE("BITMAPAND");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(bitmapplans);
  }
  
  static void
! _outBitmapOr(StringInfo str, BitmapOr *node)
  {
  	WRITE_NODE_TYPE("BITMAPOR");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(bitmapplans);
  }
  
  static void
! _outScan(StringInfo str, Scan *node)
  {
  	WRITE_NODE_TYPE("SCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  }
  
  static void
! _outSeqScan(StringInfo str, SeqScan *node)
  {
  	WRITE_NODE_TYPE("SEQSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  }
  
  static void
! _outIndexScan(StringInfo str, IndexScan *node)
  {
  	WRITE_NODE_TYPE("INDEXSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
--- 399,445 ----
  }
  
  static void
! _outBitmapAnd(StringInfo str, const BitmapAnd *node)
  {
  	WRITE_NODE_TYPE("BITMAPAND");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(bitmapplans);
  }
  
  static void
! _outBitmapOr(StringInfo str, const BitmapOr *node)
  {
  	WRITE_NODE_TYPE("BITMAPOR");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(bitmapplans);
  }
  
  static void
! _outScan(StringInfo str, const Scan *node)
  {
  	WRITE_NODE_TYPE("SCAN");
  
! 	_outScanInfo(str, node);
  }
  
  static void
! _outSeqScan(StringInfo str, const SeqScan *node)
  {
  	WRITE_NODE_TYPE("SEQSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  }
  
  static void
! _outIndexScan(StringInfo str, const IndexScan *node)
  {
  	WRITE_NODE_TYPE("INDEXSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
***************
*** 450,460 **** _outIndexScan(StringInfo str, IndexScan *node)
  }
  
  static void
! _outIndexOnlyScan(StringInfo str, IndexOnlyScan *node)
  {
  	WRITE_NODE_TYPE("INDEXONLYSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
--- 450,460 ----
  }
  
  static void
! _outIndexOnlyScan(StringInfo str, const IndexOnlyScan *node)
  {
  	WRITE_NODE_TYPE("INDEXONLYSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
***************
*** 464,474 **** _outIndexOnlyScan(StringInfo str, IndexOnlyScan *node)
  }
  
  static void
! _outBitmapIndexScan(StringInfo str, BitmapIndexScan *node)
  {
  	WRITE_NODE_TYPE("BITMAPINDEXSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
--- 464,474 ----
  }
  
  static void
! _outBitmapIndexScan(StringInfo str, const BitmapIndexScan *node)
  {
  	WRITE_NODE_TYPE("BITMAPINDEXSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
***************
*** 476,516 **** _outBitmapIndexScan(StringInfo str, BitmapIndexScan *node)
  }
  
  static void
! _outBitmapHeapScan(StringInfo str, BitmapHeapScan *node)
  {
  	WRITE_NODE_TYPE("BITMAPHEAPSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_NODE_FIELD(bitmapqualorig);
  }
  
  static void
! _outTidScan(StringInfo str, TidScan *node)
  {
  	WRITE_NODE_TYPE("TIDSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_NODE_FIELD(tidquals);
  }
  
  static void
! _outSubqueryScan(StringInfo str, SubqueryScan *node)
  {
  	WRITE_NODE_TYPE("SUBQUERYSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_NODE_FIELD(subplan);
  }
  
  static void
! _outFunctionScan(StringInfo str, FunctionScan *node)
  {
  	WRITE_NODE_TYPE("FUNCTIONSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_NODE_FIELD(funcexpr);
  	WRITE_NODE_FIELD(funccolnames);
--- 476,516 ----
  }
  
  static void
! _outBitmapHeapScan(StringInfo str, const BitmapHeapScan *node)
  {
  	WRITE_NODE_TYPE("BITMAPHEAPSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_NODE_FIELD(bitmapqualorig);
  }
  
  static void
! _outTidScan(StringInfo str, const TidScan *node)
  {
  	WRITE_NODE_TYPE("TIDSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_NODE_FIELD(tidquals);
  }
  
  static void
! _outSubqueryScan(StringInfo str, const SubqueryScan *node)
  {
  	WRITE_NODE_TYPE("SUBQUERYSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_NODE_FIELD(subplan);
  }
  
  static void
! _outFunctionScan(StringInfo str, const FunctionScan *node)
  {
  	WRITE_NODE_TYPE("FUNCTIONSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_NODE_FIELD(funcexpr);
  	WRITE_NODE_FIELD(funccolnames);
***************
*** 520,568 **** _outFunctionScan(StringInfo str, FunctionScan *node)
  }
  
  static void
! _outValuesScan(StringInfo str, ValuesScan *node)
  {
  	WRITE_NODE_TYPE("VALUESSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_NODE_FIELD(values_lists);
  }
  
  static void
! _outCteScan(StringInfo str, CteScan *node)
  {
  	WRITE_NODE_TYPE("CTESCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_INT_FIELD(ctePlanId);
  	WRITE_INT_FIELD(cteParam);
  }
  
  static void
! _outWorkTableScan(StringInfo str, WorkTableScan *node)
  {
  	WRITE_NODE_TYPE("WORKTABLESCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_INT_FIELD(wtParam);
  }
  
  static void
! _outForeignScan(StringInfo str, ForeignScan *node)
  {
  	WRITE_NODE_TYPE("FOREIGNSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_BOOL_FIELD(fsSystemCol);
  	WRITE_NODE_FIELD(fdwplan);
  }
  
  static void
! _outFdwPlan(StringInfo str, FdwPlan *node)
  {
  	WRITE_NODE_TYPE("FDWPLAN");
  
--- 520,568 ----
  }
  
  static void
! _outValuesScan(StringInfo str, const ValuesScan *node)
  {
  	WRITE_NODE_TYPE("VALUESSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_NODE_FIELD(values_lists);
  }
  
  static void
! _outCteScan(StringInfo str, const CteScan *node)
  {
  	WRITE_NODE_TYPE("CTESCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_INT_FIELD(ctePlanId);
  	WRITE_INT_FIELD(cteParam);
  }
  
  static void
! _outWorkTableScan(StringInfo str, const WorkTableScan *node)
  {
  	WRITE_NODE_TYPE("WORKTABLESCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_INT_FIELD(wtParam);
  }
  
  static void
! _outForeignScan(StringInfo str, const ForeignScan *node)
  {
  	WRITE_NODE_TYPE("FOREIGNSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_BOOL_FIELD(fsSystemCol);
  	WRITE_NODE_FIELD(fdwplan);
  }
  
  static void
! _outFdwPlan(StringInfo str, const FdwPlan *node)
  {
  	WRITE_NODE_TYPE("FDWPLAN");
  
***************
*** 572,603 **** _outFdwPlan(StringInfo str, FdwPlan *node)
  }
  
  static void
! _outJoin(StringInfo str, Join *node)
  {
  	WRITE_NODE_TYPE("JOIN");
  
! 	_outJoinPlanInfo(str, (Join *) node);
  }
  
  static void
! _outNestLoop(StringInfo str, NestLoop *node)
  {
  	WRITE_NODE_TYPE("NESTLOOP");
  
! 	_outJoinPlanInfo(str, (Join *) node);
  
  	WRITE_NODE_FIELD(nestParams);
  }
  
  static void
! _outMergeJoin(StringInfo str, MergeJoin *node)
  {
  	int			numCols;
  	int			i;
  
  	WRITE_NODE_TYPE("MERGEJOIN");
  
! 	_outJoinPlanInfo(str, (Join *) node);
  
  	WRITE_NODE_FIELD(mergeclauses);
  
--- 572,603 ----
  }
  
  static void
! _outJoin(StringInfo str, const Join *node)
  {
  	WRITE_NODE_TYPE("JOIN");
  
! 	_outJoinPlanInfo(str, (const Join *) node);
  }
  
  static void
! _outNestLoop(StringInfo str, const NestLoop *node)
  {
  	WRITE_NODE_TYPE("NESTLOOP");
  
! 	_outJoinPlanInfo(str, (const Join *) node);
  
  	WRITE_NODE_FIELD(nestParams);
  }
  
  static void
! _outMergeJoin(StringInfo str, const MergeJoin *node)
  {
  	int			numCols;
  	int			i;
  
  	WRITE_NODE_TYPE("MERGEJOIN");
  
! 	_outJoinPlanInfo(str, (const Join *) node);
  
  	WRITE_NODE_FIELD(mergeclauses);
  
***************
*** 621,643 **** _outMergeJoin(StringInfo str, MergeJoin *node)
  }
  
  static void
! _outHashJoin(StringInfo str, HashJoin *node)
  {
  	WRITE_NODE_TYPE("HASHJOIN");
  
! 	_outJoinPlanInfo(str, (Join *) node);
  
  	WRITE_NODE_FIELD(hashclauses);
  }
  
  static void
! _outAgg(StringInfo str, Agg *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("AGG");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_ENUM_FIELD(aggstrategy, AggStrategy);
  	WRITE_INT_FIELD(numCols);
--- 621,643 ----
  }
  
  static void
! _outHashJoin(StringInfo str, const HashJoin *node)
  {
  	WRITE_NODE_TYPE("HASHJOIN");
  
! 	_outJoinPlanInfo(str, (const Join *) node);
  
  	WRITE_NODE_FIELD(hashclauses);
  }
  
  static void
! _outAgg(StringInfo str, const Agg *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("AGG");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_ENUM_FIELD(aggstrategy, AggStrategy);
  	WRITE_INT_FIELD(numCols);
***************
*** 654,666 **** _outAgg(StringInfo str, Agg *node)
  }
  
  static void
! _outWindowAgg(StringInfo str, WindowAgg *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("WINDOWAGG");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_UINT_FIELD(winref);
  	WRITE_INT_FIELD(partNumCols);
--- 654,666 ----
  }
  
  static void
! _outWindowAgg(StringInfo str, const WindowAgg *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("WINDOWAGG");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_UINT_FIELD(winref);
  	WRITE_INT_FIELD(partNumCols);
***************
*** 689,701 **** _outWindowAgg(StringInfo str, WindowAgg *node)
  }
  
  static void
! _outGroup(StringInfo str, Group *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("GROUP");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
--- 689,701 ----
  }
  
  static void
! _outGroup(StringInfo str, const Group *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("GROUP");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
***************
*** 709,729 **** _outGroup(StringInfo str, Group *node)
  }
  
  static void
! _outMaterial(StringInfo str, Material *node)
  {
  	WRITE_NODE_TYPE("MATERIAL");
  
! 	_outPlanInfo(str, (Plan *) node);
  }
  
  static void
! _outSort(StringInfo str, Sort *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("SORT");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
--- 709,729 ----
  }
  
  static void
! _outMaterial(StringInfo str, const Material *node)
  {
  	WRITE_NODE_TYPE("MATERIAL");
  
! 	_outPlanInfo(str, (const Plan *) node);
  }
  
  static void
! _outSort(StringInfo str, const Sort *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("SORT");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
***************
*** 745,757 **** _outSort(StringInfo str, Sort *node)
  }
  
  static void
! _outUnique(StringInfo str, Unique *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("UNIQUE");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
--- 745,757 ----
  }
  
  static void
! _outUnique(StringInfo str, const Unique *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("UNIQUE");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
***************
*** 765,775 **** _outUnique(StringInfo str, Unique *node)
  }
  
  static void
! _outHash(StringInfo str, Hash *node)
  {
  	WRITE_NODE_TYPE("HASH");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_OID_FIELD(skewTable);
  	WRITE_INT_FIELD(skewColumn);
--- 765,775 ----
  }
  
  static void
! _outHash(StringInfo str, const Hash *node)
  {
  	WRITE_NODE_TYPE("HASH");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_OID_FIELD(skewTable);
  	WRITE_INT_FIELD(skewColumn);
***************
*** 779,791 **** _outHash(StringInfo str, Hash *node)
  }
  
  static void
! _outSetOp(StringInfo str, SetOp *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("SETOP");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_ENUM_FIELD(cmd, SetOpCmd);
  	WRITE_ENUM_FIELD(strategy, SetOpStrategy);
--- 779,791 ----
  }
  
  static void
! _outSetOp(StringInfo str, const SetOp *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("SETOP");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_ENUM_FIELD(cmd, SetOpCmd);
  	WRITE_ENUM_FIELD(strategy, SetOpStrategy);
***************
*** 805,833 **** _outSetOp(StringInfo str, SetOp *node)
  }
  
  static void
! _outLockRows(StringInfo str, LockRows *node)
  {
  	WRITE_NODE_TYPE("LOCKROWS");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(rowMarks);
  	WRITE_INT_FIELD(epqParam);
  }
  
  static void
! _outLimit(StringInfo str, Limit *node)
  {
  	WRITE_NODE_TYPE("LIMIT");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(limitOffset);
  	WRITE_NODE_FIELD(limitCount);
  }
  
  static void
! _outNestLoopParam(StringInfo str, NestLoopParam *node)
  {
  	WRITE_NODE_TYPE("NESTLOOPPARAM");
  
--- 805,833 ----
  }
  
  static void
! _outLockRows(StringInfo str, const LockRows *node)
  {
  	WRITE_NODE_TYPE("LOCKROWS");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(rowMarks);
  	WRITE_INT_FIELD(epqParam);
  }
  
  static void
! _outLimit(StringInfo str, const Limit *node)
  {
  	WRITE_NODE_TYPE("LIMIT");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(limitOffset);
  	WRITE_NODE_FIELD(limitCount);
  }
  
  static void
! _outNestLoopParam(StringInfo str, const NestLoopParam *node)
  {
  	WRITE_NODE_TYPE("NESTLOOPPARAM");
  
***************
*** 836,842 **** _outNestLoopParam(StringInfo str, NestLoopParam *node)
  }
  
  static void
! _outPlanRowMark(StringInfo str, PlanRowMark *node)
  {
  	WRITE_NODE_TYPE("PLANROWMARK");
  
--- 836,842 ----
  }
  
  static void
! _outPlanRowMark(StringInfo str, const PlanRowMark *node)
  {
  	WRITE_NODE_TYPE("PLANROWMARK");
  
***************
*** 849,855 **** _outPlanRowMark(StringInfo str, PlanRowMark *node)
  }
  
  static void
! _outPlanInvalItem(StringInfo str, PlanInvalItem *node)
  {
  	WRITE_NODE_TYPE("PLANINVALITEM");
  
--- 849,855 ----
  }
  
  static void
! _outPlanInvalItem(StringInfo str, const PlanInvalItem *node)
  {
  	WRITE_NODE_TYPE("PLANINVALITEM");
  
***************
*** 864,870 **** _outPlanInvalItem(StringInfo str, PlanInvalItem *node)
   *****************************************************************************/
  
  static void
! _outAlias(StringInfo str, Alias *node)
  {
  	WRITE_NODE_TYPE("ALIAS");
  
--- 864,870 ----
   *****************************************************************************/
  
  static void
! _outAlias(StringInfo str, const Alias *node)
  {
  	WRITE_NODE_TYPE("ALIAS");
  
***************
*** 873,879 **** _outAlias(StringInfo str, Alias *node)
  }
  
  static void
! _outRangeVar(StringInfo str, RangeVar *node)
  {
  	WRITE_NODE_TYPE("RANGEVAR");
  
--- 873,879 ----
  }
  
  static void
! _outRangeVar(StringInfo str, const RangeVar *node)
  {
  	WRITE_NODE_TYPE("RANGEVAR");
  
***************
*** 890,896 **** _outRangeVar(StringInfo str, RangeVar *node)
  }
  
  static void
! _outIntoClause(StringInfo str, IntoClause *node)
  {
  	WRITE_NODE_TYPE("INTOCLAUSE");
  
--- 890,896 ----
  }
  
  static void
! _outIntoClause(StringInfo str, const IntoClause *node)
  {
  	WRITE_NODE_TYPE("INTOCLAUSE");
  
***************
*** 902,908 **** _outIntoClause(StringInfo str, IntoClause *node)
  }
  
  static void
! _outVar(StringInfo str, Var *node)
  {
  	WRITE_NODE_TYPE("VAR");
  
--- 902,908 ----
  }
  
  static void
! _outVar(StringInfo str, const Var *node)
  {
  	WRITE_NODE_TYPE("VAR");
  
***************
*** 918,924 **** _outVar(StringInfo str, Var *node)
  }
  
  static void
! _outConst(StringInfo str, Const *node)
  {
  	WRITE_NODE_TYPE("CONST");
  
--- 918,924 ----
  }
  
  static void
! _outConst(StringInfo str, const Const *node)
  {
  	WRITE_NODE_TYPE("CONST");
  
***************
*** 938,944 **** _outConst(StringInfo str, Const *node)
  }
  
  static void
! _outParam(StringInfo str, Param *node)
  {
  	WRITE_NODE_TYPE("PARAM");
  
--- 938,944 ----
  }
  
  static void
! _outParam(StringInfo str, const Param *node)
  {
  	WRITE_NODE_TYPE("PARAM");
  
***************
*** 951,957 **** _outParam(StringInfo str, Param *node)
  }
  
  static void
! _outAggref(StringInfo str, Aggref *node)
  {
  	WRITE_NODE_TYPE("AGGREF");
  
--- 951,957 ----
  }
  
  static void
! _outAggref(StringInfo str, const Aggref *node)
  {
  	WRITE_NODE_TYPE("AGGREF");
  
***************
*** 968,974 **** _outAggref(StringInfo str, Aggref *node)
  }
  
  static void
! _outWindowFunc(StringInfo str, WindowFunc *node)
  {
  	WRITE_NODE_TYPE("WINDOWFUNC");
  
--- 968,974 ----
  }
  
  static void
! _outWindowFunc(StringInfo str, const WindowFunc *node)
  {
  	WRITE_NODE_TYPE("WINDOWFUNC");
  
***************
*** 984,990 **** _outWindowFunc(StringInfo str, WindowFunc *node)
  }
  
  static void
! _outArrayRef(StringInfo str, ArrayRef *node)
  {
  	WRITE_NODE_TYPE("ARRAYREF");
  
--- 984,990 ----
  }
  
  static void
! _outArrayRef(StringInfo str, const ArrayRef *node)
  {
  	WRITE_NODE_TYPE("ARRAYREF");
  
***************
*** 999,1005 **** _outArrayRef(StringInfo str, ArrayRef *node)
  }
  
  static void
! _outFuncExpr(StringInfo str, FuncExpr *node)
  {
  	WRITE_NODE_TYPE("FUNCEXPR");
  
--- 999,1005 ----
  }
  
  static void
! _outFuncExpr(StringInfo str, const FuncExpr *node)
  {
  	WRITE_NODE_TYPE("FUNCEXPR");
  
***************
*** 1014,1020 **** _outFuncExpr(StringInfo str, FuncExpr *node)
  }
  
  static void
! _outNamedArgExpr(StringInfo str, NamedArgExpr *node)
  {
  	WRITE_NODE_TYPE("NAMEDARGEXPR");
  
--- 1014,1020 ----
  }
  
  static void
! _outNamedArgExpr(StringInfo str, const NamedArgExpr *node)
  {
  	WRITE_NODE_TYPE("NAMEDARGEXPR");
  
***************
*** 1025,1031 **** _outNamedArgExpr(StringInfo str, NamedArgExpr *node)
  }
  
  static void
! _outOpExpr(StringInfo str, OpExpr *node)
  {
  	WRITE_NODE_TYPE("OPEXPR");
  
--- 1025,1031 ----
  }
  
  static void
! _outOpExpr(StringInfo str, const OpExpr *node)
  {
  	WRITE_NODE_TYPE("OPEXPR");
  
***************
*** 1040,1046 **** _outOpExpr(StringInfo str, OpExpr *node)
  }
  
  static void
! _outDistinctExpr(StringInfo str, DistinctExpr *node)
  {
  	WRITE_NODE_TYPE("DISTINCTEXPR");
  
--- 1040,1046 ----
  }
  
  static void
! _outDistinctExpr(StringInfo str, const DistinctExpr *node)
  {
  	WRITE_NODE_TYPE("DISTINCTEXPR");
  
***************
*** 1055,1061 **** _outDistinctExpr(StringInfo str, DistinctExpr *node)
  }
  
  static void
! _outNullIfExpr(StringInfo str, NullIfExpr *node)
  {
  	WRITE_NODE_TYPE("NULLIFEXPR");
  
--- 1055,1061 ----
  }
  
  static void
! _outNullIfExpr(StringInfo str, const NullIfExpr *node)
  {
  	WRITE_NODE_TYPE("NULLIFEXPR");
  
***************
*** 1070,1076 **** _outNullIfExpr(StringInfo str, NullIfExpr *node)
  }
  
  static void
! _outScalarArrayOpExpr(StringInfo str, ScalarArrayOpExpr *node)
  {
  	WRITE_NODE_TYPE("SCALARARRAYOPEXPR");
  
--- 1070,1076 ----
  }
  
  static void
! _outScalarArrayOpExpr(StringInfo str, const ScalarArrayOpExpr *node)
  {
  	WRITE_NODE_TYPE("SCALARARRAYOPEXPR");
  
***************
*** 1083,1089 **** _outScalarArrayOpExpr(StringInfo str, ScalarArrayOpExpr *node)
  }
  
  static void
! _outBoolExpr(StringInfo str, BoolExpr *node)
  {
  	char	   *opstr = NULL;
  
--- 1083,1089 ----
  }
  
  static void
! _outBoolExpr(StringInfo str, const BoolExpr *node)
  {
  	char	   *opstr = NULL;
  
***************
*** 1110,1116 **** _outBoolExpr(StringInfo str, BoolExpr *node)
  }
  
  static void
! _outSubLink(StringInfo str, SubLink *node)
  {
  	WRITE_NODE_TYPE("SUBLINK");
  
--- 1110,1116 ----
  }
  
  static void
! _outSubLink(StringInfo str, const SubLink *node)
  {
  	WRITE_NODE_TYPE("SUBLINK");
  
***************
*** 1122,1128 **** _outSubLink(StringInfo str, SubLink *node)
  }
  
  static void
! _outSubPlan(StringInfo str, SubPlan *node)
  {
  	WRITE_NODE_TYPE("SUBPLAN");
  
--- 1122,1128 ----
  }
  
  static void
! _outSubPlan(StringInfo str, const SubPlan *node)
  {
  	WRITE_NODE_TYPE("SUBPLAN");
  
***************
*** 1144,1150 **** _outSubPlan(StringInfo str, SubPlan *node)
  }
  
  static void
! _outAlternativeSubPlan(StringInfo str, AlternativeSubPlan *node)
  {
  	WRITE_NODE_TYPE("ALTERNATIVESUBPLAN");
  
--- 1144,1150 ----
  }
  
  static void
! _outAlternativeSubPlan(StringInfo str, const AlternativeSubPlan *node)
  {
  	WRITE_NODE_TYPE("ALTERNATIVESUBPLAN");
  
***************
*** 1152,1158 **** _outAlternativeSubPlan(StringInfo str, AlternativeSubPlan *node)
  }
  
  static void
! _outFieldSelect(StringInfo str, FieldSelect *node)
  {
  	WRITE_NODE_TYPE("FIELDSELECT");
  
--- 1152,1158 ----
  }
  
  static void
! _outFieldSelect(StringInfo str, const FieldSelect *node)
  {
  	WRITE_NODE_TYPE("FIELDSELECT");
  
***************
*** 1164,1170 **** _outFieldSelect(StringInfo str, FieldSelect *node)
  }
  
  static void
! _outFieldStore(StringInfo str, FieldStore *node)
  {
  	WRITE_NODE_TYPE("FIELDSTORE");
  
--- 1164,1170 ----
  }
  
  static void
! _outFieldStore(StringInfo str, const FieldStore *node)
  {
  	WRITE_NODE_TYPE("FIELDSTORE");
  
***************
*** 1175,1181 **** _outFieldStore(StringInfo str, FieldStore *node)
  }
  
  static void
! _outRelabelType(StringInfo str, RelabelType *node)
  {
  	WRITE_NODE_TYPE("RELABELTYPE");
  
--- 1175,1181 ----
  }
  
  static void
! _outRelabelType(StringInfo str, const RelabelType *node)
  {
  	WRITE_NODE_TYPE("RELABELTYPE");
  
***************
*** 1188,1194 **** _outRelabelType(StringInfo str, RelabelType *node)
  }
  
  static void
! _outCoerceViaIO(StringInfo str, CoerceViaIO *node)
  {
  	WRITE_NODE_TYPE("COERCEVIAIO");
  
--- 1188,1194 ----
  }
  
  static void
! _outCoerceViaIO(StringInfo str, const CoerceViaIO *node)
  {
  	WRITE_NODE_TYPE("COERCEVIAIO");
  
***************
*** 1200,1206 **** _outCoerceViaIO(StringInfo str, CoerceViaIO *node)
  }
  
  static void
! _outArrayCoerceExpr(StringInfo str, ArrayCoerceExpr *node)
  {
  	WRITE_NODE_TYPE("ARRAYCOERCEEXPR");
  
--- 1200,1206 ----
  }
  
  static void
! _outArrayCoerceExpr(StringInfo str, const ArrayCoerceExpr *node)
  {
  	WRITE_NODE_TYPE("ARRAYCOERCEEXPR");
  
***************
*** 1215,1221 **** _outArrayCoerceExpr(StringInfo str, ArrayCoerceExpr *node)
  }
  
  static void
! _outConvertRowtypeExpr(StringInfo str, ConvertRowtypeExpr *node)
  {
  	WRITE_NODE_TYPE("CONVERTROWTYPEEXPR");
  
--- 1215,1221 ----
  }
  
  static void
! _outConvertRowtypeExpr(StringInfo str, const ConvertRowtypeExpr *node)
  {
  	WRITE_NODE_TYPE("CONVERTROWTYPEEXPR");
  
***************
*** 1226,1232 **** _outConvertRowtypeExpr(StringInfo str, ConvertRowtypeExpr *node)
  }
  
  static void
! _outCollateExpr(StringInfo str, CollateExpr *node)
  {
  	WRITE_NODE_TYPE("COLLATE");
  
--- 1226,1232 ----
  }
  
  static void
! _outCollateExpr(StringInfo str, const CollateExpr *node)
  {
  	WRITE_NODE_TYPE("COLLATE");
  
***************
*** 1236,1242 **** _outCollateExpr(StringInfo str, CollateExpr *node)
  }
  
  static void
! _outCaseExpr(StringInfo str, CaseExpr *node)
  {
  	WRITE_NODE_TYPE("CASE");
  
--- 1236,1242 ----
  }
  
  static void
! _outCaseExpr(StringInfo str, const CaseExpr *node)
  {
  	WRITE_NODE_TYPE("CASE");
  
***************
*** 1249,1255 **** _outCaseExpr(StringInfo str, CaseExpr *node)
  }
  
  static void
! _outCaseWhen(StringInfo str, CaseWhen *node)
  {
  	WRITE_NODE_TYPE("WHEN");
  
--- 1249,1255 ----
  }
  
  static void
! _outCaseWhen(StringInfo str, const CaseWhen *node)
  {
  	WRITE_NODE_TYPE("WHEN");
  
***************
*** 1259,1265 **** _outCaseWhen(StringInfo str, CaseWhen *node)
  }
  
  static void
! _outCaseTestExpr(StringInfo str, CaseTestExpr *node)
  {
  	WRITE_NODE_TYPE("CASETESTEXPR");
  
--- 1259,1265 ----
  }
  
  static void
! _outCaseTestExpr(StringInfo str, const CaseTestExpr *node)
  {
  	WRITE_NODE_TYPE("CASETESTEXPR");
  
***************
*** 1269,1275 **** _outCaseTestExpr(StringInfo str, CaseTestExpr *node)
  }
  
  static void
! _outArrayExpr(StringInfo str, ArrayExpr *node)
  {
  	WRITE_NODE_TYPE("ARRAY");
  
--- 1269,1275 ----
  }
  
  static void
! _outArrayExpr(StringInfo str, const ArrayExpr *node)
  {
  	WRITE_NODE_TYPE("ARRAY");
  
***************
*** 1282,1288 **** _outArrayExpr(StringInfo str, ArrayExpr *node)
  }
  
  static void
! _outRowExpr(StringInfo str, RowExpr *node)
  {
  	WRITE_NODE_TYPE("ROW");
  
--- 1282,1288 ----
  }
  
  static void
! _outRowExpr(StringInfo str, const RowExpr *node)
  {
  	WRITE_NODE_TYPE("ROW");
  
***************
*** 1294,1300 **** _outRowExpr(StringInfo str, RowExpr *node)
  }
  
  static void
! _outRowCompareExpr(StringInfo str, RowCompareExpr *node)
  {
  	WRITE_NODE_TYPE("ROWCOMPARE");
  
--- 1294,1300 ----
  }
  
  static void
! _outRowCompareExpr(StringInfo str, const RowCompareExpr *node)
  {
  	WRITE_NODE_TYPE("ROWCOMPARE");
  
***************
*** 1307,1313 **** _outRowCompareExpr(StringInfo str, RowCompareExpr *node)
  }
  
  static void
! _outCoalesceExpr(StringInfo str, CoalesceExpr *node)
  {
  	WRITE_NODE_TYPE("COALESCE");
  
--- 1307,1313 ----
  }
  
  static void
! _outCoalesceExpr(StringInfo str, const CoalesceExpr *node)
  {
  	WRITE_NODE_TYPE("COALESCE");
  
***************
*** 1318,1324 **** _outCoalesceExpr(StringInfo str, CoalesceExpr *node)
  }
  
  static void
! _outMinMaxExpr(StringInfo str, MinMaxExpr *node)
  {
  	WRITE_NODE_TYPE("MINMAX");
  
--- 1318,1324 ----
  }
  
  static void
! _outMinMaxExpr(StringInfo str, const MinMaxExpr *node)
  {
  	WRITE_NODE_TYPE("MINMAX");
  
***************
*** 1331,1337 **** _outMinMaxExpr(StringInfo str, MinMaxExpr *node)
  }
  
  static void
! _outXmlExpr(StringInfo str, XmlExpr *node)
  {
  	WRITE_NODE_TYPE("XMLEXPR");
  
--- 1331,1337 ----
  }
  
  static void
! _outXmlExpr(StringInfo str, const XmlExpr *node)
  {
  	WRITE_NODE_TYPE("XMLEXPR");
  
***************
*** 1347,1353 **** _outXmlExpr(StringInfo str, XmlExpr *node)
  }
  
  static void
! _outNullTest(StringInfo str, NullTest *node)
  {
  	WRITE_NODE_TYPE("NULLTEST");
  
--- 1347,1353 ----
  }
  
  static void
! _outNullTest(StringInfo str, const NullTest *node)
  {
  	WRITE_NODE_TYPE("NULLTEST");
  
***************
*** 1357,1363 **** _outNullTest(StringInfo str, NullTest *node)
  }
  
  static void
! _outBooleanTest(StringInfo str, BooleanTest *node)
  {
  	WRITE_NODE_TYPE("BOOLEANTEST");
  
--- 1357,1363 ----
  }
  
  static void
! _outBooleanTest(StringInfo str, const BooleanTest *node)
  {
  	WRITE_NODE_TYPE("BOOLEANTEST");
  
***************
*** 1366,1372 **** _outBooleanTest(StringInfo str, BooleanTest *node)
  }
  
  static void
! _outCoerceToDomain(StringInfo str, CoerceToDomain *node)
  {
  	WRITE_NODE_TYPE("COERCETODOMAIN");
  
--- 1366,1372 ----
  }
  
  static void
! _outCoerceToDomain(StringInfo str, const CoerceToDomain *node)
  {
  	WRITE_NODE_TYPE("COERCETODOMAIN");
  
***************
*** 1379,1385 **** _outCoerceToDomain(StringInfo str, CoerceToDomain *node)
  }
  
  static void
! _outCoerceToDomainValue(StringInfo str, CoerceToDomainValue *node)
  {
  	WRITE_NODE_TYPE("COERCETODOMAINVALUE");
  
--- 1379,1385 ----
  }
  
  static void
! _outCoerceToDomainValue(StringInfo str, const CoerceToDomainValue *node)
  {
  	WRITE_NODE_TYPE("COERCETODOMAINVALUE");
  
***************
*** 1390,1396 **** _outCoerceToDomainValue(StringInfo str, CoerceToDomainValue *node)
  }
  
  static void
! _outSetToDefault(StringInfo str, SetToDefault *node)
  {
  	WRITE_NODE_TYPE("SETTODEFAULT");
  
--- 1390,1396 ----
  }
  
  static void
! _outSetToDefault(StringInfo str, const SetToDefault *node)
  {
  	WRITE_NODE_TYPE("SETTODEFAULT");
  
***************
*** 1401,1407 **** _outSetToDefault(StringInfo str, SetToDefault *node)
  }
  
  static void
! _outCurrentOfExpr(StringInfo str, CurrentOfExpr *node)
  {
  	WRITE_NODE_TYPE("CURRENTOFEXPR");
  
--- 1401,1407 ----
  }
  
  static void
! _outCurrentOfExpr(StringInfo str, const CurrentOfExpr *node)
  {
  	WRITE_NODE_TYPE("CURRENTOFEXPR");
  
***************
*** 1411,1417 **** _outCurrentOfExpr(StringInfo str, CurrentOfExpr *node)
  }
  
  static void
! _outTargetEntry(StringInfo str, TargetEntry *node)
  {
  	WRITE_NODE_TYPE("TARGETENTRY");
  
--- 1411,1417 ----
  }
  
  static void
! _outTargetEntry(StringInfo str, const TargetEntry *node)
  {
  	WRITE_NODE_TYPE("TARGETENTRY");
  
***************
*** 1425,1431 **** _outTargetEntry(StringInfo str, TargetEntry *node)
  }
  
  static void
! _outRangeTblRef(StringInfo str, RangeTblRef *node)
  {
  	WRITE_NODE_TYPE("RANGETBLREF");
  
--- 1425,1431 ----
  }
  
  static void
! _outRangeTblRef(StringInfo str, const RangeTblRef *node)
  {
  	WRITE_NODE_TYPE("RANGETBLREF");
  
***************
*** 1433,1439 **** _outRangeTblRef(StringInfo str, RangeTblRef *node)
  }
  
  static void
! _outJoinExpr(StringInfo str, JoinExpr *node)
  {
  	WRITE_NODE_TYPE("JOINEXPR");
  
--- 1433,1439 ----
  }
  
  static void
! _outJoinExpr(StringInfo str, const JoinExpr *node)
  {
  	WRITE_NODE_TYPE("JOINEXPR");
  
***************
*** 1448,1454 **** _outJoinExpr(StringInfo str, JoinExpr *node)
  }
  
  static void
! _outFromExpr(StringInfo str, FromExpr *node)
  {
  	WRITE_NODE_TYPE("FROMEXPR");
  
--- 1448,1454 ----
  }
  
  static void
! _outFromExpr(StringInfo str, const FromExpr *node)
  {
  	WRITE_NODE_TYPE("FROMEXPR");
  
***************
*** 1469,1475 **** _outFromExpr(StringInfo str, FromExpr *node)
   * We can print the parent's relids for identification purposes, though.
   */
  static void
! _outPathInfo(StringInfo str, Path *node)
  {
  	WRITE_ENUM_FIELD(pathtype, NodeTag);
  	appendStringInfo(str, " :parent_relids ");
--- 1469,1475 ----
   * We can print the parent's relids for identification purposes, though.
   */
  static void
! _outPathInfo(StringInfo str, const Path *node)
  {
  	WRITE_ENUM_FIELD(pathtype, NodeTag);
  	appendStringInfo(str, " :parent_relids ");
***************
*** 1483,1491 **** _outPathInfo(StringInfo str, Path *node)
   * print the basic stuff of all nodes that inherit from JoinPath
   */
  static void
! _outJoinPathInfo(StringInfo str, JoinPath *node)
  {
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_ENUM_FIELD(jointype, JoinType);
  	WRITE_NODE_FIELD(outerjoinpath);
--- 1483,1491 ----
   * print the basic stuff of all nodes that inherit from JoinPath
   */
  static void
! _outJoinPathInfo(StringInfo str, const JoinPath *node)
  {
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_ENUM_FIELD(jointype, JoinType);
  	WRITE_NODE_FIELD(outerjoinpath);
***************
*** 1494,1512 **** _outJoinPathInfo(StringInfo str, JoinPath *node)
  }
  
  static void
! _outPath(StringInfo str, Path *node)
  {
  	WRITE_NODE_TYPE("PATH");
  
! 	_outPathInfo(str, (Path *) node);
  }
  
  static void
! _outIndexPath(StringInfo str, IndexPath *node)
  {
  	WRITE_NODE_TYPE("INDEXPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(indexinfo);
  	WRITE_NODE_FIELD(indexclauses);
--- 1494,1512 ----
  }
  
  static void
! _outPath(StringInfo str, const Path *node)
  {
  	WRITE_NODE_TYPE("PATH");
  
! 	_outPathInfo(str, (const Path *) node);
  }
  
  static void
! _outIndexPath(StringInfo str, const IndexPath *node)
  {
  	WRITE_NODE_TYPE("INDEXPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(indexinfo);
  	WRITE_NODE_FIELD(indexclauses);
***************
*** 1520,1530 **** _outIndexPath(StringInfo str, IndexPath *node)
  }
  
  static void
! _outBitmapHeapPath(StringInfo str, BitmapHeapPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPHEAPPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(bitmapqual);
  	WRITE_BOOL_FIELD(isjoininner);
--- 1520,1530 ----
  }
  
  static void
! _outBitmapHeapPath(StringInfo str, const BitmapHeapPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPHEAPPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(bitmapqual);
  	WRITE_BOOL_FIELD(isjoininner);
***************
*** 1532,1538 **** _outBitmapHeapPath(StringInfo str, BitmapHeapPath *node)
  }
  
  static void
! _outBitmapAndPath(StringInfo str, BitmapAndPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPANDPATH");
  
--- 1532,1538 ----
  }
  
  static void
! _outBitmapAndPath(StringInfo str, const BitmapAndPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPANDPATH");
  
***************
*** 1543,1580 **** _outBitmapAndPath(StringInfo str, BitmapAndPath *node)
  }
  
  static void
! _outBitmapOrPath(StringInfo str, BitmapOrPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPORPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(bitmapquals);
  	WRITE_FLOAT_FIELD(bitmapselectivity, "%.4f");
  }
  
  static void
! _outTidPath(StringInfo str, TidPath *node)
  {
  	WRITE_NODE_TYPE("TIDPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(tidquals);
  }
  
  static void
! _outForeignPath(StringInfo str, ForeignPath *node)
  {
  	WRITE_NODE_TYPE("FOREIGNPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(fdwplan);
  }
  
  static void
! _outAppendPath(StringInfo str, AppendPath *node)
  {
  	WRITE_NODE_TYPE("APPENDPATH");
  
--- 1543,1580 ----
  }
  
  static void
! _outBitmapOrPath(StringInfo str, const BitmapOrPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPORPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(bitmapquals);
  	WRITE_FLOAT_FIELD(bitmapselectivity, "%.4f");
  }
  
  static void
! _outTidPath(StringInfo str, const TidPath *node)
  {
  	WRITE_NODE_TYPE("TIDPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(tidquals);
  }
  
  static void
! _outForeignPath(StringInfo str, const ForeignPath *node)
  {
  	WRITE_NODE_TYPE("FOREIGNPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(fdwplan);
  }
  
  static void
! _outAppendPath(StringInfo str, const AppendPath *node)
  {
  	WRITE_NODE_TYPE("APPENDPATH");
  
***************
*** 1584,1625 **** _outAppendPath(StringInfo str, AppendPath *node)
  }
  
  static void
! _outMergeAppendPath(StringInfo str, MergeAppendPath *node)
  {
  	WRITE_NODE_TYPE("MERGEAPPENDPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(subpaths);
  	WRITE_FLOAT_FIELD(limit_tuples, "%.0f");
  }
  
  static void
! _outResultPath(StringInfo str, ResultPath *node)
  {
  	WRITE_NODE_TYPE("RESULTPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(quals);
  }
  
  static void
! _outMaterialPath(StringInfo str, MaterialPath *node)
  {
  	WRITE_NODE_TYPE("MATERIALPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(subpath);
  }
  
  static void
! _outUniquePath(StringInfo str, UniquePath *node)
  {
  	WRITE_NODE_TYPE("UNIQUEPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(subpath);
  	WRITE_ENUM_FIELD(umethod, UniquePathMethod);
--- 1584,1625 ----
  }
  
  static void
! _outMergeAppendPath(StringInfo str, const MergeAppendPath *node)
  {
  	WRITE_NODE_TYPE("MERGEAPPENDPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(subpaths);
  	WRITE_FLOAT_FIELD(limit_tuples, "%.0f");
  }
  
  static void
! _outResultPath(StringInfo str, const ResultPath *node)
  {
  	WRITE_NODE_TYPE("RESULTPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(quals);
  }
  
  static void
! _outMaterialPath(StringInfo str, const MaterialPath *node)
  {
  	WRITE_NODE_TYPE("MATERIALPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(subpath);
  }
  
  static void
! _outUniquePath(StringInfo str, const UniquePath *node)
  {
  	WRITE_NODE_TYPE("UNIQUEPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(subpath);
  	WRITE_ENUM_FIELD(umethod, UniquePathMethod);
***************
*** 1629,1647 **** _outUniquePath(StringInfo str, UniquePath *node)
  }
  
  static void
! _outNestPath(StringInfo str, NestPath *node)
  {
  	WRITE_NODE_TYPE("NESTPATH");
  
! 	_outJoinPathInfo(str, (JoinPath *) node);
  }
  
  static void
! _outMergePath(StringInfo str, MergePath *node)
  {
  	WRITE_NODE_TYPE("MERGEPATH");
  
! 	_outJoinPathInfo(str, (JoinPath *) node);
  
  	WRITE_NODE_FIELD(path_mergeclauses);
  	WRITE_NODE_FIELD(outersortkeys);
--- 1629,1647 ----
  }
  
  static void
! _outNestPath(StringInfo str, const NestPath *node)
  {
  	WRITE_NODE_TYPE("NESTPATH");
  
! 	_outJoinPathInfo(str, (const JoinPath *) node);
  }
  
  static void
! _outMergePath(StringInfo str, const MergePath *node)
  {
  	WRITE_NODE_TYPE("MERGEPATH");
  
! 	_outJoinPathInfo(str, (const JoinPath *) node);
  
  	WRITE_NODE_FIELD(path_mergeclauses);
  	WRITE_NODE_FIELD(outersortkeys);
***************
*** 1650,1667 **** _outMergePath(StringInfo str, MergePath *node)
  }
  
  static void
! _outHashPath(StringInfo str, HashPath *node)
  {
  	WRITE_NODE_TYPE("HASHPATH");
  
! 	_outJoinPathInfo(str, (JoinPath *) node);
  
  	WRITE_NODE_FIELD(path_hashclauses);
  	WRITE_INT_FIELD(num_batches);
  }
  
  static void
! _outPlannerGlobal(StringInfo str, PlannerGlobal *node)
  {
  	WRITE_NODE_TYPE("PLANNERGLOBAL");
  
--- 1650,1667 ----
  }
  
  static void
! _outHashPath(StringInfo str, const HashPath *node)
  {
  	WRITE_NODE_TYPE("HASHPATH");
  
! 	_outJoinPathInfo(str, (const JoinPath *) node);
  
  	WRITE_NODE_FIELD(path_hashclauses);
  	WRITE_INT_FIELD(num_batches);
  }
  
  static void
! _outPlannerGlobal(StringInfo str, const PlannerGlobal *node)
  {
  	WRITE_NODE_TYPE("PLANNERGLOBAL");
  
***************
*** 1680,1686 **** _outPlannerGlobal(StringInfo str, PlannerGlobal *node)
  }
  
  static void
! _outPlannerInfo(StringInfo str, PlannerInfo *node)
  {
  	WRITE_NODE_TYPE("PLANNERINFO");
  
--- 1680,1686 ----
  }
  
  static void
! _outPlannerInfo(StringInfo str, const PlannerInfo *node)
  {
  	WRITE_NODE_TYPE("PLANNERINFO");
  
***************
*** 1721,1727 **** _outPlannerInfo(StringInfo str, PlannerInfo *node)
  }
  
  static void
! _outRelOptInfo(StringInfo str, RelOptInfo *node)
  {
  	WRITE_NODE_TYPE("RELOPTINFO");
  
--- 1721,1727 ----
  }
  
  static void
! _outRelOptInfo(StringInfo str, const RelOptInfo *node)
  {
  	WRITE_NODE_TYPE("RELOPTINFO");
  
***************
*** 1754,1760 **** _outRelOptInfo(StringInfo str, RelOptInfo *node)
  }
  
  static void
! _outIndexOptInfo(StringInfo str, IndexOptInfo *node)
  {
  	WRITE_NODE_TYPE("INDEXOPTINFO");
  
--- 1754,1760 ----
  }
  
  static void
! _outIndexOptInfo(StringInfo str, const IndexOptInfo *node)
  {
  	WRITE_NODE_TYPE("INDEXOPTINFO");
  
***************
*** 1775,1781 **** _outIndexOptInfo(StringInfo str, IndexOptInfo *node)
  }
  
  static void
! _outEquivalenceClass(StringInfo str, EquivalenceClass *node)
  {
  	/*
  	 * To simplify reading, we just chase up to the topmost merged EC and
--- 1775,1781 ----
  }
  
  static void
! _outEquivalenceClass(StringInfo str, const EquivalenceClass *node)
  {
  	/*
  	 * To simplify reading, we just chase up to the topmost merged EC and
***************
*** 1800,1806 **** _outEquivalenceClass(StringInfo str, EquivalenceClass *node)
  }
  
  static void
! _outEquivalenceMember(StringInfo str, EquivalenceMember *node)
  {
  	WRITE_NODE_TYPE("EQUIVALENCEMEMBER");
  
--- 1800,1806 ----
  }
  
  static void
! _outEquivalenceMember(StringInfo str, const EquivalenceMember *node)
  {
  	WRITE_NODE_TYPE("EQUIVALENCEMEMBER");
  
***************
*** 1812,1818 **** _outEquivalenceMember(StringInfo str, EquivalenceMember *node)
  }
  
  static void
! _outPathKey(StringInfo str, PathKey *node)
  {
  	WRITE_NODE_TYPE("PATHKEY");
  
--- 1812,1818 ----
  }
  
  static void
! _outPathKey(StringInfo str, const PathKey *node)
  {
  	WRITE_NODE_TYPE("PATHKEY");
  
***************
*** 1823,1829 **** _outPathKey(StringInfo str, PathKey *node)
  }
  
  static void
! _outRestrictInfo(StringInfo str, RestrictInfo *node)
  {
  	WRITE_NODE_TYPE("RESTRICTINFO");
  
--- 1823,1829 ----
  }
  
  static void
! _outRestrictInfo(StringInfo str, const RestrictInfo *node)
  {
  	WRITE_NODE_TYPE("RESTRICTINFO");
  
***************
*** 1852,1858 **** _outRestrictInfo(StringInfo str, RestrictInfo *node)
  }
  
  static void
! _outInnerIndexscanInfo(StringInfo str, InnerIndexscanInfo *node)
  {
  	WRITE_NODE_TYPE("INNERINDEXSCANINFO");
  	WRITE_BITMAPSET_FIELD(other_relids);
--- 1852,1858 ----
  }
  
  static void
! _outInnerIndexscanInfo(StringInfo str, const InnerIndexscanInfo *node)
  {
  	WRITE_NODE_TYPE("INNERINDEXSCANINFO");
  	WRITE_BITMAPSET_FIELD(other_relids);
***************
*** 1862,1868 **** _outInnerIndexscanInfo(StringInfo str, InnerIndexscanInfo *node)
  }
  
  static void
! _outPlaceHolderVar(StringInfo str, PlaceHolderVar *node)
  {
  	WRITE_NODE_TYPE("PLACEHOLDERVAR");
  
--- 1862,1868 ----
  }
  
  static void
! _outPlaceHolderVar(StringInfo str, const PlaceHolderVar *node)
  {
  	WRITE_NODE_TYPE("PLACEHOLDERVAR");
  
***************
*** 1873,1879 **** _outPlaceHolderVar(StringInfo str, PlaceHolderVar *node)
  }
  
  static void
! _outSpecialJoinInfo(StringInfo str, SpecialJoinInfo *node)
  {
  	WRITE_NODE_TYPE("SPECIALJOININFO");
  
--- 1873,1879 ----
  }
  
  static void
! _outSpecialJoinInfo(StringInfo str, const SpecialJoinInfo *node)
  {
  	WRITE_NODE_TYPE("SPECIALJOININFO");
  
***************
*** 1888,1894 **** _outSpecialJoinInfo(StringInfo str, SpecialJoinInfo *node)
  }
  
  static void
! _outAppendRelInfo(StringInfo str, AppendRelInfo *node)
  {
  	WRITE_NODE_TYPE("APPENDRELINFO");
  
--- 1888,1894 ----
  }
  
  static void
! _outAppendRelInfo(StringInfo str, const AppendRelInfo *node)
  {
  	WRITE_NODE_TYPE("APPENDRELINFO");
  
***************
*** 1901,1907 **** _outAppendRelInfo(StringInfo str, AppendRelInfo *node)
  }
  
  static void
! _outPlaceHolderInfo(StringInfo str, PlaceHolderInfo *node)
  {
  	WRITE_NODE_TYPE("PLACEHOLDERINFO");
  
--- 1901,1907 ----
  }
  
  static void
! _outPlaceHolderInfo(StringInfo str, const PlaceHolderInfo *node)
  {
  	WRITE_NODE_TYPE("PLACEHOLDERINFO");
  
***************
*** 1914,1920 **** _outPlaceHolderInfo(StringInfo str, PlaceHolderInfo *node)
  }
  
  static void
! _outMinMaxAggInfo(StringInfo str, MinMaxAggInfo *node)
  {
  	WRITE_NODE_TYPE("MINMAXAGGINFO");
  
--- 1914,1920 ----
  }
  
  static void
! _outMinMaxAggInfo(StringInfo str, const MinMaxAggInfo *node)
  {
  	WRITE_NODE_TYPE("MINMAXAGGINFO");
  
***************
*** 1928,1934 **** _outMinMaxAggInfo(StringInfo str, MinMaxAggInfo *node)
  }
  
  static void
! _outPlannerParamItem(StringInfo str, PlannerParamItem *node)
  {
  	WRITE_NODE_TYPE("PLANNERPARAMITEM");
  
--- 1928,1934 ----
  }
  
  static void
! _outPlannerParamItem(StringInfo str, const PlannerParamItem *node)
  {
  	WRITE_NODE_TYPE("PLANNERPARAMITEM");
  
***************
*** 1943,1949 **** _outPlannerParamItem(StringInfo str, PlannerParamItem *node)
   *****************************************************************************/
  
  static void
! _outCreateStmt(StringInfo str, CreateStmt *node)
  {
  	WRITE_NODE_TYPE("CREATESTMT");
  
--- 1943,1949 ----
   *****************************************************************************/
  
  static void
! _outCreateStmt(StringInfo str, const CreateStmt *node)
  {
  	WRITE_NODE_TYPE("CREATESTMT");
  
***************
*** 1959,1965 **** _outCreateStmt(StringInfo str, CreateStmt *node)
  }
  
  static void
! _outCreateForeignTableStmt(StringInfo str, CreateForeignTableStmt *node)
  {
  	WRITE_NODE_TYPE("CREATEFOREIGNTABLESTMT");
  
--- 1959,1965 ----
  }
  
  static void
! _outCreateForeignTableStmt(StringInfo str, const CreateForeignTableStmt *node)
  {
  	WRITE_NODE_TYPE("CREATEFOREIGNTABLESTMT");
  
***************
*** 1970,1976 **** _outCreateForeignTableStmt(StringInfo str, CreateForeignTableStmt *node)
  }
  
  static void
! _outIndexStmt(StringInfo str, IndexStmt *node)
  {
  	WRITE_NODE_TYPE("INDEXSTMT");
  
--- 1970,1976 ----
  }
  
  static void
! _outIndexStmt(StringInfo str, const IndexStmt *node)
  {
  	WRITE_NODE_TYPE("INDEXSTMT");
  
***************
*** 1993,1999 **** _outIndexStmt(StringInfo str, IndexStmt *node)
  }
  
  static void
! _outNotifyStmt(StringInfo str, NotifyStmt *node)
  {
  	WRITE_NODE_TYPE("NOTIFY");
  
--- 1993,1999 ----
  }
  
  static void
! _outNotifyStmt(StringInfo str, const NotifyStmt *node)
  {
  	WRITE_NODE_TYPE("NOTIFY");
  
***************
*** 2002,2008 **** _outNotifyStmt(StringInfo str, NotifyStmt *node)
  }
  
  static void
! _outDeclareCursorStmt(StringInfo str, DeclareCursorStmt *node)
  {
  	WRITE_NODE_TYPE("DECLARECURSOR");
  
--- 2002,2008 ----
  }
  
  static void
! _outDeclareCursorStmt(StringInfo str, const DeclareCursorStmt *node)
  {
  	WRITE_NODE_TYPE("DECLARECURSOR");
  
***************
*** 2012,2018 **** _outDeclareCursorStmt(StringInfo str, DeclareCursorStmt *node)
  }
  
  static void
! _outSelectStmt(StringInfo str, SelectStmt *node)
  {
  	WRITE_NODE_TYPE("SELECT");
  
--- 2012,2018 ----
  }
  
  static void
! _outSelectStmt(StringInfo str, const SelectStmt *node)
  {
  	WRITE_NODE_TYPE("SELECT");
  
***************
*** 2037,2043 **** _outSelectStmt(StringInfo str, SelectStmt *node)
  }
  
  static void
! _outFuncCall(StringInfo str, FuncCall *node)
  {
  	WRITE_NODE_TYPE("FUNCCALL");
  
--- 2037,2043 ----
  }
  
  static void
! _outFuncCall(StringInfo str, const FuncCall *node)
  {
  	WRITE_NODE_TYPE("FUNCCALL");
  
***************
*** 2052,2058 **** _outFuncCall(StringInfo str, FuncCall *node)
  }
  
  static void
! _outDefElem(StringInfo str, DefElem *node)
  {
  	WRITE_NODE_TYPE("DEFELEM");
  
--- 2052,2058 ----
  }
  
  static void
! _outDefElem(StringInfo str, const DefElem *node)
  {
  	WRITE_NODE_TYPE("DEFELEM");
  
***************
*** 2063,2069 **** _outDefElem(StringInfo str, DefElem *node)
  }
  
  static void
! _outInhRelation(StringInfo str, InhRelation *node)
  {
  	WRITE_NODE_TYPE("INHRELATION");
  
--- 2063,2069 ----
  }
  
  static void
! _outInhRelation(StringInfo str, const InhRelation *node)
  {
  	WRITE_NODE_TYPE("INHRELATION");
  
***************
*** 2072,2078 **** _outInhRelation(StringInfo str, InhRelation *node)
  }
  
  static void
! _outLockingClause(StringInfo str, LockingClause *node)
  {
  	WRITE_NODE_TYPE("LOCKINGCLAUSE");
  
--- 2072,2078 ----
  }
  
  static void
! _outLockingClause(StringInfo str, const LockingClause *node)
  {
  	WRITE_NODE_TYPE("LOCKINGCLAUSE");
  
***************
*** 2082,2088 **** _outLockingClause(StringInfo str, LockingClause *node)
  }
  
  static void
! _outXmlSerialize(StringInfo str, XmlSerialize *node)
  {
  	WRITE_NODE_TYPE("XMLSERIALIZE");
  
--- 2082,2088 ----
  }
  
  static void
! _outXmlSerialize(StringInfo str, const XmlSerialize *node)
  {
  	WRITE_NODE_TYPE("XMLSERIALIZE");
  
***************
*** 2093,2099 **** _outXmlSerialize(StringInfo str, XmlSerialize *node)
  }
  
  static void
! _outColumnDef(StringInfo str, ColumnDef *node)
  {
  	WRITE_NODE_TYPE("COLUMNDEF");
  
--- 2093,2099 ----
  }
  
  static void
! _outColumnDef(StringInfo str, const ColumnDef *node)
  {
  	WRITE_NODE_TYPE("COLUMNDEF");
  
***************
*** 2113,2119 **** _outColumnDef(StringInfo str, ColumnDef *node)
  }
  
  static void
! _outTypeName(StringInfo str, TypeName *node)
  {
  	WRITE_NODE_TYPE("TYPENAME");
  
--- 2113,2119 ----
  }
  
  static void
! _outTypeName(StringInfo str, const TypeName *node)
  {
  	WRITE_NODE_TYPE("TYPENAME");
  
***************
*** 2128,2134 **** _outTypeName(StringInfo str, TypeName *node)
  }
  
  static void
! _outTypeCast(StringInfo str, TypeCast *node)
  {
  	WRITE_NODE_TYPE("TYPECAST");
  
--- 2128,2134 ----
  }
  
  static void
! _outTypeCast(StringInfo str, const TypeCast *node)
  {
  	WRITE_NODE_TYPE("TYPECAST");
  
***************
*** 2138,2144 **** _outTypeCast(StringInfo str, TypeCast *node)
  }
  
  static void
! _outCollateClause(StringInfo str, CollateClause *node)
  {
  	WRITE_NODE_TYPE("COLLATECLAUSE");
  
--- 2138,2144 ----
  }
  
  static void
! _outCollateClause(StringInfo str, const CollateClause *node)
  {
  	WRITE_NODE_TYPE("COLLATECLAUSE");
  
***************
*** 2148,2154 **** _outCollateClause(StringInfo str, CollateClause *node)
  }
  
  static void
! _outIndexElem(StringInfo str, IndexElem *node)
  {
  	WRITE_NODE_TYPE("INDEXELEM");
  
--- 2148,2154 ----
  }
  
  static void
! _outIndexElem(StringInfo str, const IndexElem *node)
  {
  	WRITE_NODE_TYPE("INDEXELEM");
  
***************
*** 2162,2168 **** _outIndexElem(StringInfo str, IndexElem *node)
  }
  
  static void
! _outQuery(StringInfo str, Query *node)
  {
  	WRITE_NODE_TYPE("QUERY");
  
--- 2162,2168 ----
  }
  
  static void
! _outQuery(StringInfo str, const Query *node)
  {
  	WRITE_NODE_TYPE("QUERY");
  
***************
*** 2222,2228 **** _outQuery(StringInfo str, Query *node)
  }
  
  static void
! _outSortGroupClause(StringInfo str, SortGroupClause *node)
  {
  	WRITE_NODE_TYPE("SORTGROUPCLAUSE");
  
--- 2222,2228 ----
  }
  
  static void
! _outSortGroupClause(StringInfo str, const SortGroupClause *node)
  {
  	WRITE_NODE_TYPE("SORTGROUPCLAUSE");
  
***************
*** 2234,2240 **** _outSortGroupClause(StringInfo str, SortGroupClause *node)
  }
  
  static void
! _outWindowClause(StringInfo str, WindowClause *node)
  {
  	WRITE_NODE_TYPE("WINDOWCLAUSE");
  
--- 2234,2240 ----
  }
  
  static void
! _outWindowClause(StringInfo str, const WindowClause *node)
  {
  	WRITE_NODE_TYPE("WINDOWCLAUSE");
  
***************
*** 2250,2256 **** _outWindowClause(StringInfo str, WindowClause *node)
  }
  
  static void
! _outRowMarkClause(StringInfo str, RowMarkClause *node)
  {
  	WRITE_NODE_TYPE("ROWMARKCLAUSE");
  
--- 2250,2256 ----
  }
  
  static void
! _outRowMarkClause(StringInfo str, const RowMarkClause *node)
  {
  	WRITE_NODE_TYPE("ROWMARKCLAUSE");
  
***************
*** 2261,2267 **** _outRowMarkClause(StringInfo str, RowMarkClause *node)
  }
  
  static void
! _outWithClause(StringInfo str, WithClause *node)
  {
  	WRITE_NODE_TYPE("WITHCLAUSE");
  
--- 2261,2267 ----
  }
  
  static void
! _outWithClause(StringInfo str, const WithClause *node)
  {
  	WRITE_NODE_TYPE("WITHCLAUSE");
  
***************
*** 2271,2277 **** _outWithClause(StringInfo str, WithClause *node)
  }
  
  static void
! _outCommonTableExpr(StringInfo str, CommonTableExpr *node)
  {
  	WRITE_NODE_TYPE("COMMONTABLEEXPR");
  
--- 2271,2277 ----
  }
  
  static void
! _outCommonTableExpr(StringInfo str, const CommonTableExpr *node)
  {
  	WRITE_NODE_TYPE("COMMONTABLEEXPR");
  
***************
*** 2288,2294 **** _outCommonTableExpr(StringInfo str, CommonTableExpr *node)
  }
  
  static void
! _outSetOperationStmt(StringInfo str, SetOperationStmt *node)
  {
  	WRITE_NODE_TYPE("SETOPERATIONSTMT");
  
--- 2288,2294 ----
  }
  
  static void
! _outSetOperationStmt(StringInfo str, const SetOperationStmt *node)
  {
  	WRITE_NODE_TYPE("SETOPERATIONSTMT");
  
***************
*** 2303,2309 **** _outSetOperationStmt(StringInfo str, SetOperationStmt *node)
  }
  
  static void
! _outRangeTblEntry(StringInfo str, RangeTblEntry *node)
  {
  	WRITE_NODE_TYPE("RTE");
  
--- 2303,2309 ----
  }
  
  static void
! _outRangeTblEntry(StringInfo str, const RangeTblEntry *node)
  {
  	WRITE_NODE_TYPE("RTE");
  
***************
*** 2357,2363 **** _outRangeTblEntry(StringInfo str, RangeTblEntry *node)
  }
  
  static void
! _outAExpr(StringInfo str, A_Expr *node)
  {
  	WRITE_NODE_TYPE("AEXPR");
  
--- 2357,2363 ----
  }
  
  static void
! _outAExpr(StringInfo str, const A_Expr *node)
  {
  	WRITE_NODE_TYPE("AEXPR");
  
***************
*** 2413,2419 **** _outAExpr(StringInfo str, A_Expr *node)
  }
  
  static void
! _outValue(StringInfo str, Value *value)
  {
  	switch (value->type)
  	{
--- 2413,2419 ----
  }
  
  static void
! _outValue(StringInfo str, const Value *value)
  {
  	switch (value->type)
  	{
***************
*** 2448,2454 **** _outValue(StringInfo str, Value *value)
  }
  
  static void
! _outColumnRef(StringInfo str, ColumnRef *node)
  {
  	WRITE_NODE_TYPE("COLUMNREF");
  
--- 2448,2454 ----
  }
  
  static void
! _outColumnRef(StringInfo str, const ColumnRef *node)
  {
  	WRITE_NODE_TYPE("COLUMNREF");
  
***************
*** 2457,2463 **** _outColumnRef(StringInfo str, ColumnRef *node)
  }
  
  static void
! _outParamRef(StringInfo str, ParamRef *node)
  {
  	WRITE_NODE_TYPE("PARAMREF");
  
--- 2457,2463 ----
  }
  
  static void
! _outParamRef(StringInfo str, const ParamRef *node)
  {
  	WRITE_NODE_TYPE("PARAMREF");
  
***************
*** 2466,2472 **** _outParamRef(StringInfo str, ParamRef *node)
  }
  
  static void
! _outAConst(StringInfo str, A_Const *node)
  {
  	WRITE_NODE_TYPE("A_CONST");
  
--- 2466,2472 ----
  }
  
  static void
! _outAConst(StringInfo str, const A_Const *node)
  {
  	WRITE_NODE_TYPE("A_CONST");
  
***************
*** 2476,2488 **** _outAConst(StringInfo str, A_Const *node)
  }
  
  static void
! _outA_Star(StringInfo str, A_Star *node)
  {
  	WRITE_NODE_TYPE("A_STAR");
  }
  
  static void
! _outA_Indices(StringInfo str, A_Indices *node)
  {
  	WRITE_NODE_TYPE("A_INDICES");
  
--- 2476,2488 ----
  }
  
  static void
! _outA_Star(StringInfo str, const A_Star *node)
  {
  	WRITE_NODE_TYPE("A_STAR");
  }
  
  static void
! _outA_Indices(StringInfo str, const A_Indices *node)
  {
  	WRITE_NODE_TYPE("A_INDICES");
  
***************
*** 2491,2497 **** _outA_Indices(StringInfo str, A_Indices *node)
  }
  
  static void
! _outA_Indirection(StringInfo str, A_Indirection *node)
  {
  	WRITE_NODE_TYPE("A_INDIRECTION");
  
--- 2491,2497 ----
  }
  
  static void
! _outA_Indirection(StringInfo str, const A_Indirection *node)
  {
  	WRITE_NODE_TYPE("A_INDIRECTION");
  
***************
*** 2500,2506 **** _outA_Indirection(StringInfo str, A_Indirection *node)
  }
  
  static void
! _outA_ArrayExpr(StringInfo str, A_ArrayExpr *node)
  {
  	WRITE_NODE_TYPE("A_ARRAYEXPR");
  
--- 2500,2506 ----
  }
  
  static void
! _outA_ArrayExpr(StringInfo str, const A_ArrayExpr *node)
  {
  	WRITE_NODE_TYPE("A_ARRAYEXPR");
  
***************
*** 2509,2515 **** _outA_ArrayExpr(StringInfo str, A_ArrayExpr *node)
  }
  
  static void
! _outResTarget(StringInfo str, ResTarget *node)
  {
  	WRITE_NODE_TYPE("RESTARGET");
  
--- 2509,2515 ----
  }
  
  static void
! _outResTarget(StringInfo str, const ResTarget *node)
  {
  	WRITE_NODE_TYPE("RESTARGET");
  
***************
*** 2520,2526 **** _outResTarget(StringInfo str, ResTarget *node)
  }
  
  static void
! _outSortBy(StringInfo str, SortBy *node)
  {
  	WRITE_NODE_TYPE("SORTBY");
  
--- 2520,2526 ----
  }
  
  static void
! _outSortBy(StringInfo str, const SortBy *node)
  {
  	WRITE_NODE_TYPE("SORTBY");
  
***************
*** 2532,2538 **** _outSortBy(StringInfo str, SortBy *node)
  }
  
  static void
! _outWindowDef(StringInfo str, WindowDef *node)
  {
  	WRITE_NODE_TYPE("WINDOWDEF");
  
--- 2532,2538 ----
  }
  
  static void
! _outWindowDef(StringInfo str, const WindowDef *node)
  {
  	WRITE_NODE_TYPE("WINDOWDEF");
  
***************
*** 2547,2553 **** _outWindowDef(StringInfo str, WindowDef *node)
  }
  
  static void
! _outRangeSubselect(StringInfo str, RangeSubselect *node)
  {
  	WRITE_NODE_TYPE("RANGESUBSELECT");
  
--- 2547,2553 ----
  }
  
  static void
! _outRangeSubselect(StringInfo str, const RangeSubselect *node)
  {
  	WRITE_NODE_TYPE("RANGESUBSELECT");
  
***************
*** 2556,2562 **** _outRangeSubselect(StringInfo str, RangeSubselect *node)
  }
  
  static void
! _outRangeFunction(StringInfo str, RangeFunction *node)
  {
  	WRITE_NODE_TYPE("RANGEFUNCTION");
  
--- 2556,2562 ----
  }
  
  static void
! _outRangeFunction(StringInfo str, const RangeFunction *node)
  {
  	WRITE_NODE_TYPE("RANGEFUNCTION");
  
***************
*** 2566,2572 **** _outRangeFunction(StringInfo str, RangeFunction *node)
  }
  
  static void
! _outConstraint(StringInfo str, Constraint *node)
  {
  	WRITE_NODE_TYPE("CONSTRAINT");
  
--- 2566,2572 ----
  }
  
  static void
! _outConstraint(StringInfo str, const Constraint *node)
  {
  	WRITE_NODE_TYPE("CONSTRAINT");
  
*** a/src/backend/nodes/print.c
--- b/src/backend/nodes/print.c
***************
*** 251,257 **** pretty_format_node_dump(const char *dump)
  void
  print_rt(List *rtable)
  {
! 	ListCell   *l;
  	int			i = 1;
  
  	printf("resno\trefname  \trelid\tinFromCl\n");
--- 251,257 ----
  void
  print_rt(List *rtable)
  {
! 	const ListCell   *l;
  	int			i = 1;
  
  	printf("resno\trefname  \trelid\tinFromCl\n");
***************
*** 304,310 **** print_rt(List *rtable)
   *	  print an expression
   */
  void
! print_expr(Node *expr, List *rtable)
  {
  	if (expr == NULL)
  	{
--- 304,310 ----
   *	  print an expression
   */
  void
! print_expr(const Node *expr, List *rtable)
  {
  	if (expr == NULL)
  	{
***************
*** 412,418 **** print_expr(Node *expr, List *rtable)
  void
  print_pathkeys(List *pathkeys, List *rtable)
  {
! 	ListCell   *i;
  
  	printf("(");
  	foreach(i, pathkeys)
--- 412,418 ----
  void
  print_pathkeys(List *pathkeys, List *rtable)
  {
! 	const ListCell   *i;
  
  	printf("(");
  	foreach(i, pathkeys)
***************
*** 452,458 **** print_pathkeys(List *pathkeys, List *rtable)
  void
  print_tl(List *tlist, List *rtable)
  {
! 	ListCell   *tl;
  
  	printf("(\n");
  	foreach(tl, tlist)
--- 452,458 ----
  void
  print_tl(List *tlist, List *rtable)
  {
! 	const ListCell   *tl;
  
  	printf("(\n");
  	foreach(tl, tlist)
*** a/src/include/nodes/nodeFuncs.h
--- b/src/include/nodes/nodeFuncs.h
***************
*** 26,42 ****
  #define QTW_DONT_COPY_QUERY			0x20		/* do not copy top Query */
  
  
! extern Oid	exprType(Node *expr);
! extern int32 exprTypmod(Node *expr);
! extern bool exprIsLengthCoercion(Node *expr, int32 *coercedTypmod);
  extern bool expression_returns_set(Node *clause);
  
! extern Oid	exprCollation(Node *expr);
! extern Oid	exprInputCollation(Node *expr);
  extern void exprSetCollation(Node *expr, Oid collation);
  extern void exprSetInputCollation(Node *expr, Oid inputcollation);
  
! extern int	exprLocation(Node *expr);
  
  extern bool expression_tree_walker(Node *node, bool (*walker) (),
  											   void *context);
--- 26,42 ----
  #define QTW_DONT_COPY_QUERY			0x20		/* do not copy top Query */
  
  
! extern Oid	exprType(const Node *expr);
! extern int32 exprTypmod(const Node *expr);
! extern bool exprIsLengthCoercion(const Node *expr, int32 *coercedTypmod);
  extern bool expression_returns_set(Node *clause);
  
! extern Oid	exprCollation(const Node *expr);
! extern Oid	exprInputCollation(const Node *expr);
  extern void exprSetCollation(Node *expr, Oid collation);
  extern void exprSetInputCollation(Node *expr, Oid inputcollation);
  
! extern int	exprLocation(const Node *expr);
  
  extern bool expression_tree_walker(Node *node, bool (*walker) (),
  											   void *context);
*** a/src/include/nodes/pg_list.h
--- b/src/include/nodes/pg_list.h
***************
*** 211,217 **** extern int	list_nth_int(List *list, int n);
  extern Oid	list_nth_oid(List *list, int n);
  
  extern bool list_member(List *list, void *datum);
! extern bool list_member_ptr(List *list, void *datum);
  extern bool list_member_int(List *list, int datum);
  extern bool list_member_oid(List *list, Oid datum);
  
--- 211,217 ----
  extern Oid	list_nth_oid(List *list, int n);
  
  extern bool list_member(List *list, void *datum);
! extern bool list_member_ptr(List *list, const void *datum);
  extern bool list_member_int(List *list, int datum);
  extern bool list_member_oid(List *list, Oid datum);
  
*** a/src/include/nodes/print.h
--- b/src/include/nodes/print.h
***************
*** 26,32 **** extern void elog_node_display(int lev, const char *title,
  extern char *format_node_dump(const char *dump);
  extern char *pretty_format_node_dump(const char *dump);
  extern void print_rt(List *rtable);
! extern void print_expr(Node *expr, List *rtable);
  extern void print_pathkeys(List *pathkeys, List *rtable);
  extern void print_tl(List *tlist, List *rtable);
  extern void print_slot(TupleTableSlot *slot);
--- 26,32 ----
  extern char *format_node_dump(const char *dump);
  extern char *pretty_format_node_dump(const char *dump);
  extern void print_rt(List *rtable);
! extern void print_expr(const Node *expr, List *rtable);
  extern void print_pathkeys(List *pathkeys, List *rtable);
  extern void print_tl(List *tlist, List *rtable);
  extern void print_slot(TupleTableSlot *slot);
#12Robert Haas
robertmhaas@gmail.com
In reply to: Kevin Grittner (#11)
Re: const correctness

On Wed, Nov 9, 2011 at 2:35 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:

Robert Haas <robertmhaas@gmail.com> wrote:

If it doesn't uglify the code, there aren't any negatives.  I'm
just saying we may not be able to get very far before we run up
against that issue.  For example, in the OP, Thomas wrote:

7.  I made a list_head_const function, which can be used used to
    get a pointer to the head cell when you have a pointer to
    const List; I needed that so I could make foreach_const and
    forboth_const; they were needed to be able to make
    list_member, _equalList and various other list-visiting
    functions work with const List objects.

So that's already duplicating list_head, foreach, and forboth.

OK, I failed to pick up on that properly.  With that stripped out,
you get the attached patch, which does nothing but add "const" to
661 lines.  It still applies cleanly, builds with no warnings, and
passes regression tests.

So what happens when someone wants to use list_nth in one of the
outfuncs? Would we then rip all these back out? Or would we then
bite the bullet and duplicate the code?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#13Thomas Munro
munro@ip9.org
In reply to: Kevin Grittner (#11)
1 attachment(s)
Re: const correctness

On 9 November 2011 19:35, Kevin Grittner <Kevin.Grittner@wicourts.gov> wrote:

Robert Haas <robertmhaas@gmail.com> wrote:

So that's already duplicating list_head, foreach, and forboth.

OK, I failed to pick up on that properly.  With that stripped out,
you get the attached patch, which does nothing but add "const" to
661 lines.  It still applies cleanly, builds with no warnings, and
passes regression tests.

It is a bit disappointing that without creating two flavors of the
list_head function and the foreach and forboth macros, there are a
number of functions which aren't intended to modify their inputs
which can't be declared with const parameters; but unless there is
some demonstrable performance benefit from those changes, I agree
that the argument for having the two flavors is thin.

There is another option: if list_head is changed to take a pointer to
const List and return a pointer to non-const ListCell (something I was
trying to avoid before), then no XXX_const functions/macros are
necessary, and all of the functions from the first patch can keep
their 'const', adding const to 930 lines.

I've attached a new patch, which simply adds the keyword 'const' in
lots of places, no new functions etc. This version generates no
warnings under -Wcast-qual (now that I've read Peter E's thread and
been inspired to fix up some places that previously cast away const)
for all code under backend/nodes. To achieve that I had to stray
outside backend/nodes and change get_leftop and get_rightop (from
clauses.h).

Attachments:

constify-2.patchtext/x-patch; charset=US-ASCII; name=constify-2.patchDownload
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
new file mode 100644
index 63958c3..fb7b764
*** a/src/backend/nodes/copyfuncs.c
--- b/src/backend/nodes/copyfuncs.c
***************
*** 72,78 ****
   * _copyPlannedStmt
   */
  static PlannedStmt *
! _copyPlannedStmt(PlannedStmt *from)
  {
  	PlannedStmt *newnode = makeNode(PlannedStmt);
  
--- 72,78 ----
   * _copyPlannedStmt
   */
  static PlannedStmt *
! _copyPlannedStmt(const PlannedStmt *from)
  {
  	PlannedStmt *newnode = makeNode(PlannedStmt);
  
*************** _copyPlannedStmt(PlannedStmt *from)
*** 103,109 ****
   *		all the copy functions for classes which inherit from Plan.
   */
  static void
! CopyPlanFields(Plan *from, Plan *newnode)
  {
  	COPY_SCALAR_FIELD(startup_cost);
  	COPY_SCALAR_FIELD(total_cost);
--- 103,109 ----
   *		all the copy functions for classes which inherit from Plan.
   */
  static void
! CopyPlanFields(const Plan *from, Plan *newnode)
  {
  	COPY_SCALAR_FIELD(startup_cost);
  	COPY_SCALAR_FIELD(total_cost);
*************** CopyPlanFields(Plan *from, Plan *newnode
*** 122,128 ****
   * _copyPlan
   */
  static Plan *
! _copyPlan(Plan *from)
  {
  	Plan	   *newnode = makeNode(Plan);
  
--- 122,128 ----
   * _copyPlan
   */
  static Plan *
! _copyPlan(const Plan *from)
  {
  	Plan	   *newnode = makeNode(Plan);
  
*************** _copyPlan(Plan *from)
*** 139,152 ****
   * _copyResult
   */
  static Result *
! _copyResult(Result *from)
  {
  	Result	   *newnode = makeNode(Result);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 139,152 ----
   * _copyResult
   */
  static Result *
! _copyResult(const Result *from)
  {
  	Result	   *newnode = makeNode(Result);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyResult(Result *from)
*** 160,173 ****
   * _copyModifyTable
   */
  static ModifyTable *
! _copyModifyTable(ModifyTable *from)
  {
  	ModifyTable *newnode = makeNode(ModifyTable);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 160,173 ----
   * _copyModifyTable
   */
  static ModifyTable *
! _copyModifyTable(const ModifyTable *from)
  {
  	ModifyTable *newnode = makeNode(ModifyTable);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyModifyTable(ModifyTable *from)
*** 188,201 ****
   * _copyAppend
   */
  static Append *
! _copyAppend(Append *from)
  {
  	Append	   *newnode = makeNode(Append);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 188,201 ----
   * _copyAppend
   */
  static Append *
! _copyAppend(const Append *from)
  {
  	Append	   *newnode = makeNode(Append);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyAppend(Append *from)
*** 209,222 ****
   * _copyMergeAppend
   */
  static MergeAppend *
! _copyMergeAppend(MergeAppend *from)
  {
  	MergeAppend *newnode = makeNode(MergeAppend);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 209,222 ----
   * _copyMergeAppend
   */
  static MergeAppend *
! _copyMergeAppend(const MergeAppend *from)
  {
  	MergeAppend *newnode = makeNode(MergeAppend);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyMergeAppend(MergeAppend *from)
*** 235,248 ****
   * _copyRecursiveUnion
   */
  static RecursiveUnion *
! _copyRecursiveUnion(RecursiveUnion *from)
  {
  	RecursiveUnion *newnode = makeNode(RecursiveUnion);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 235,248 ----
   * _copyRecursiveUnion
   */
  static RecursiveUnion *
! _copyRecursiveUnion(const RecursiveUnion *from)
  {
  	RecursiveUnion *newnode = makeNode(RecursiveUnion);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyRecursiveUnion(RecursiveUnion *from
*** 263,276 ****
   * _copyBitmapAnd
   */
  static BitmapAnd *
! _copyBitmapAnd(BitmapAnd *from)
  {
  	BitmapAnd  *newnode = makeNode(BitmapAnd);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 263,276 ----
   * _copyBitmapAnd
   */
  static BitmapAnd *
! _copyBitmapAnd(const BitmapAnd *from)
  {
  	BitmapAnd  *newnode = makeNode(BitmapAnd);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyBitmapAnd(BitmapAnd *from)
*** 284,297 ****
   * _copyBitmapOr
   */
  static BitmapOr *
! _copyBitmapOr(BitmapOr *from)
  {
  	BitmapOr   *newnode = makeNode(BitmapOr);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 284,297 ----
   * _copyBitmapOr
   */
  static BitmapOr *
! _copyBitmapOr(const BitmapOr *from)
  {
  	BitmapOr   *newnode = makeNode(BitmapOr);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyBitmapOr(BitmapOr *from)
*** 309,317 ****
   *		all the copy functions for classes which inherit from Scan.
   */
  static void
! CopyScanFields(Scan *from, Scan *newnode)
  {
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	COPY_SCALAR_FIELD(scanrelid);
  }
--- 309,317 ----
   *		all the copy functions for classes which inherit from Scan.
   */
  static void
! CopyScanFields(const Scan *from, Scan *newnode)
  {
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	COPY_SCALAR_FIELD(scanrelid);
  }
*************** CopyScanFields(Scan *from, Scan *newnode
*** 320,333 ****
   * _copyScan
   */
  static Scan *
! _copyScan(Scan *from)
  {
  	Scan	   *newnode = makeNode(Scan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((Scan *) from, (Scan *) newnode);
  
  	return newnode;
  }
--- 320,333 ----
   * _copyScan
   */
  static Scan *
! _copyScan(const Scan *from)
  {
  	Scan	   *newnode = makeNode(Scan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((const Scan *) from, (Scan *) newnode);
  
  	return newnode;
  }
*************** _copyScan(Scan *from)
*** 336,349 ****
   * _copySeqScan
   */
  static SeqScan *
! _copySeqScan(SeqScan *from)
  {
  	SeqScan    *newnode = makeNode(SeqScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((Scan *) from, (Scan *) newnode);
  
  	return newnode;
  }
--- 336,349 ----
   * _copySeqScan
   */
  static SeqScan *
! _copySeqScan(const SeqScan *from)
  {
  	SeqScan    *newnode = makeNode(SeqScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((const Scan *) from, (Scan *) newnode);
  
  	return newnode;
  }
*************** _copySeqScan(SeqScan *from)
*** 352,365 ****
   * _copyIndexScan
   */
  static IndexScan *
! _copyIndexScan(IndexScan *from)
  {
  	IndexScan  *newnode = makeNode(IndexScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 352,365 ----
   * _copyIndexScan
   */
  static IndexScan *
! _copyIndexScan(const IndexScan *from)
  {
  	IndexScan  *newnode = makeNode(IndexScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((const Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyIndexScan(IndexScan *from)
*** 378,391 ****
   * _copyIndexOnlyScan
   */
  static IndexOnlyScan *
! _copyIndexOnlyScan(IndexOnlyScan *from)
  {
  	IndexOnlyScan  *newnode = makeNode(IndexOnlyScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 378,391 ----
   * _copyIndexOnlyScan
   */
  static IndexOnlyScan *
! _copyIndexOnlyScan(const IndexOnlyScan *from)
  {
  	IndexOnlyScan  *newnode = makeNode(IndexOnlyScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((const Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyIndexOnlyScan(IndexOnlyScan *from)
*** 403,416 ****
   * _copyBitmapIndexScan
   */
  static BitmapIndexScan *
! _copyBitmapIndexScan(BitmapIndexScan *from)
  {
  	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 403,416 ----
   * _copyBitmapIndexScan
   */
  static BitmapIndexScan *
! _copyBitmapIndexScan(const BitmapIndexScan *from)
  {
  	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((const Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyBitmapIndexScan(BitmapIndexScan *fr
*** 426,439 ****
   * _copyBitmapHeapScan
   */
  static BitmapHeapScan *
! _copyBitmapHeapScan(BitmapHeapScan *from)
  {
  	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 426,439 ----
   * _copyBitmapHeapScan
   */
  static BitmapHeapScan *
! _copyBitmapHeapScan(const BitmapHeapScan *from)
  {
  	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((const Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyBitmapHeapScan(BitmapHeapScan *from
*** 447,460 ****
   * _copyTidScan
   */
  static TidScan *
! _copyTidScan(TidScan *from)
  {
  	TidScan    *newnode = makeNode(TidScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 447,460 ----
   * _copyTidScan
   */
  static TidScan *
! _copyTidScan(const TidScan *from)
  {
  	TidScan    *newnode = makeNode(TidScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((const Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyTidScan(TidScan *from)
*** 468,481 ****
   * _copySubqueryScan
   */
  static SubqueryScan *
! _copySubqueryScan(SubqueryScan *from)
  {
  	SubqueryScan *newnode = makeNode(SubqueryScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 468,481 ----
   * _copySubqueryScan
   */
  static SubqueryScan *
! _copySubqueryScan(const SubqueryScan *from)
  {
  	SubqueryScan *newnode = makeNode(SubqueryScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((const Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copySubqueryScan(SubqueryScan *from)
*** 489,502 ****
   * _copyFunctionScan
   */
  static FunctionScan *
! _copyFunctionScan(FunctionScan *from)
  {
  	FunctionScan *newnode = makeNode(FunctionScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 489,502 ----
   * _copyFunctionScan
   */
  static FunctionScan *
! _copyFunctionScan(const FunctionScan *from)
  {
  	FunctionScan *newnode = makeNode(FunctionScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((const Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyFunctionScan(FunctionScan *from)
*** 514,527 ****
   * _copyValuesScan
   */
  static ValuesScan *
! _copyValuesScan(ValuesScan *from)
  {
  	ValuesScan *newnode = makeNode(ValuesScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 514,527 ----
   * _copyValuesScan
   */
  static ValuesScan *
! _copyValuesScan(const ValuesScan *from)
  {
  	ValuesScan *newnode = makeNode(ValuesScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((const Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyValuesScan(ValuesScan *from)
*** 535,548 ****
   * _copyCteScan
   */
  static CteScan *
! _copyCteScan(CteScan *from)
  {
  	CteScan    *newnode = makeNode(CteScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 535,548 ----
   * _copyCteScan
   */
  static CteScan *
! _copyCteScan(const CteScan *from)
  {
  	CteScan    *newnode = makeNode(CteScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((const Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyCteScan(CteScan *from)
*** 557,570 ****
   * _copyWorkTableScan
   */
  static WorkTableScan *
! _copyWorkTableScan(WorkTableScan *from)
  {
  	WorkTableScan *newnode = makeNode(WorkTableScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 557,570 ----
   * _copyWorkTableScan
   */
  static WorkTableScan *
! _copyWorkTableScan(const WorkTableScan *from)
  {
  	WorkTableScan *newnode = makeNode(WorkTableScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((const Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyWorkTableScan(WorkTableScan *from)
*** 578,591 ****
   * _copyForeignScan
   */
  static ForeignScan *
! _copyForeignScan(ForeignScan *from)
  {
  	ForeignScan *newnode = makeNode(ForeignScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 578,591 ----
   * _copyForeignScan
   */
  static ForeignScan *
! _copyForeignScan(const ForeignScan *from)
  {
  	ForeignScan *newnode = makeNode(ForeignScan);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyScanFields((const Scan *) from, (Scan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyForeignScan(ForeignScan *from)
*** 600,606 ****
   * _copyFdwPlan
   */
  static FdwPlan *
! _copyFdwPlan(FdwPlan *from)
  {
  	FdwPlan    *newnode = makeNode(FdwPlan);
  
--- 600,606 ----
   * _copyFdwPlan
   */
  static FdwPlan *
! _copyFdwPlan(const FdwPlan *from)
  {
  	FdwPlan    *newnode = makeNode(FdwPlan);
  
*************** _copyFdwPlan(FdwPlan *from)
*** 618,626 ****
   *		all the copy functions for classes which inherit from Join.
   */
  static void
! CopyJoinFields(Join *from, Join *newnode)
  {
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	COPY_SCALAR_FIELD(jointype);
  	COPY_NODE_FIELD(joinqual);
--- 618,626 ----
   *		all the copy functions for classes which inherit from Join.
   */
  static void
! CopyJoinFields(const Join *from, Join *newnode)
  {
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	COPY_SCALAR_FIELD(jointype);
  	COPY_NODE_FIELD(joinqual);
*************** CopyJoinFields(Join *from, Join *newnode
*** 631,637 ****
   * _copyJoin
   */
  static Join *
! _copyJoin(Join *from)
  {
  	Join	   *newnode = makeNode(Join);
  
--- 631,637 ----
   * _copyJoin
   */
  static Join *
! _copyJoin(const Join *from)
  {
  	Join	   *newnode = makeNode(Join);
  
*************** _copyJoin(Join *from)
*** 648,661 ****
   * _copyNestLoop
   */
  static NestLoop *
! _copyNestLoop(NestLoop *from)
  {
  	NestLoop   *newnode = makeNode(NestLoop);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyJoinFields((Join *) from, (Join *) newnode);
  
  	/*
  	 * copy remainder of node
--- 648,661 ----
   * _copyNestLoop
   */
  static NestLoop *
! _copyNestLoop(const NestLoop *from)
  {
  	NestLoop   *newnode = makeNode(NestLoop);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyJoinFields((const Join *) from, (Join *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyNestLoop(NestLoop *from)
*** 670,676 ****
   * _copyMergeJoin
   */
  static MergeJoin *
! _copyMergeJoin(MergeJoin *from)
  {
  	MergeJoin  *newnode = makeNode(MergeJoin);
  	int			numCols;
--- 670,676 ----
   * _copyMergeJoin
   */
  static MergeJoin *
! _copyMergeJoin(const MergeJoin *from)
  {
  	MergeJoin  *newnode = makeNode(MergeJoin);
  	int			numCols;
*************** _copyMergeJoin(MergeJoin *from)
*** 678,684 ****
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyJoinFields((Join *) from, (Join *) newnode);
  
  	/*
  	 * copy remainder of node
--- 678,684 ----
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyJoinFields((const Join *) from, (Join *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyMergeJoin(MergeJoin *from)
*** 697,710 ****
   * _copyHashJoin
   */
  static HashJoin *
! _copyHashJoin(HashJoin *from)
  {
  	HashJoin   *newnode = makeNode(HashJoin);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyJoinFields((Join *) from, (Join *) newnode);
  
  	/*
  	 * copy remainder of node
--- 697,710 ----
   * _copyHashJoin
   */
  static HashJoin *
! _copyHashJoin(const HashJoin *from)
  {
  	HashJoin   *newnode = makeNode(HashJoin);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyJoinFields((const Join *) from, (Join *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyHashJoin(HashJoin *from)
*** 719,732 ****
   * _copyMaterial
   */
  static Material *
! _copyMaterial(Material *from)
  {
  	Material   *newnode = makeNode(Material);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	return newnode;
  }
--- 719,732 ----
   * _copyMaterial
   */
  static Material *
! _copyMaterial(const Material *from)
  {
  	Material   *newnode = makeNode(Material);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	return newnode;
  }
*************** _copyMaterial(Material *from)
*** 736,749 ****
   * _copySort
   */
  static Sort *
! _copySort(Sort *from)
  {
  	Sort	   *newnode = makeNode(Sort);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	COPY_SCALAR_FIELD(numCols);
  	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
--- 736,749 ----
   * _copySort
   */
  static Sort *
! _copySort(const Sort *from)
  {
  	Sort	   *newnode = makeNode(Sort);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	COPY_SCALAR_FIELD(numCols);
  	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
*************** _copySort(Sort *from)
*** 759,769 ****
   * _copyGroup
   */
  static Group *
! _copyGroup(Group *from)
  {
  	Group	   *newnode = makeNode(Group);
  
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	COPY_SCALAR_FIELD(numCols);
  	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
--- 759,769 ----
   * _copyGroup
   */
  static Group *
! _copyGroup(const Group *from)
  {
  	Group	   *newnode = makeNode(Group);
  
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	COPY_SCALAR_FIELD(numCols);
  	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
*************** _copyGroup(Group *from)
*** 776,786 ****
   * _copyAgg
   */
  static Agg *
! _copyAgg(Agg *from)
  {
  	Agg		   *newnode = makeNode(Agg);
  
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	COPY_SCALAR_FIELD(aggstrategy);
  	COPY_SCALAR_FIELD(numCols);
--- 776,786 ----
   * _copyAgg
   */
  static Agg *
! _copyAgg(const Agg *from)
  {
  	Agg		   *newnode = makeNode(Agg);
  
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	COPY_SCALAR_FIELD(aggstrategy);
  	COPY_SCALAR_FIELD(numCols);
*************** _copyAgg(Agg *from)
*** 798,808 ****
   * _copyWindowAgg
   */
  static WindowAgg *
! _copyWindowAgg(WindowAgg *from)
  {
  	WindowAgg  *newnode = makeNode(WindowAgg);
  
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	COPY_SCALAR_FIELD(winref);
  	COPY_SCALAR_FIELD(partNumCols);
--- 798,808 ----
   * _copyWindowAgg
   */
  static WindowAgg *
! _copyWindowAgg(const WindowAgg *from)
  {
  	WindowAgg  *newnode = makeNode(WindowAgg);
  
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	COPY_SCALAR_FIELD(winref);
  	COPY_SCALAR_FIELD(partNumCols);
*************** _copyWindowAgg(WindowAgg *from)
*** 828,841 ****
   * _copyUnique
   */
  static Unique *
! _copyUnique(Unique *from)
  {
  	Unique	   *newnode = makeNode(Unique);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 828,841 ----
   * _copyUnique
   */
  static Unique *
! _copyUnique(const Unique *from)
  {
  	Unique	   *newnode = makeNode(Unique);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyUnique(Unique *from)
*** 851,864 ****
   * _copyHash
   */
  static Hash *
! _copyHash(Hash *from)
  {
  	Hash	   *newnode = makeNode(Hash);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 851,864 ----
   * _copyHash
   */
  static Hash *
! _copyHash(const Hash *from)
  {
  	Hash	   *newnode = makeNode(Hash);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyHash(Hash *from)
*** 876,889 ****
   * _copySetOp
   */
  static SetOp *
! _copySetOp(SetOp *from)
  {
  	SetOp	   *newnode = makeNode(SetOp);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 876,889 ----
   * _copySetOp
   */
  static SetOp *
! _copySetOp(const SetOp *from)
  {
  	SetOp	   *newnode = makeNode(SetOp);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copySetOp(SetOp *from)
*** 904,917 ****
   * _copyLockRows
   */
  static LockRows *
! _copyLockRows(LockRows *from)
  {
  	LockRows   *newnode = makeNode(LockRows);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 904,917 ----
   * _copyLockRows
   */
  static LockRows *
! _copyLockRows(const LockRows *from)
  {
  	LockRows   *newnode = makeNode(LockRows);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyLockRows(LockRows *from)
*** 926,939 ****
   * _copyLimit
   */
  static Limit *
! _copyLimit(Limit *from)
  {
  	Limit	   *newnode = makeNode(Limit);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
--- 926,939 ----
   * _copyLimit
   */
  static Limit *
! _copyLimit(const Limit *from)
  {
  	Limit	   *newnode = makeNode(Limit);
  
  	/*
  	 * copy node superclass fields
  	 */
! 	CopyPlanFields((const Plan *) from, (Plan *) newnode);
  
  	/*
  	 * copy remainder of node
*************** _copyLimit(Limit *from)
*** 948,954 ****
   * _copyNestLoopParam
   */
  static NestLoopParam *
! _copyNestLoopParam(NestLoopParam *from)
  {
  	NestLoopParam *newnode = makeNode(NestLoopParam);
  
--- 948,954 ----
   * _copyNestLoopParam
   */
  static NestLoopParam *
! _copyNestLoopParam(const NestLoopParam *from)
  {
  	NestLoopParam *newnode = makeNode(NestLoopParam);
  
*************** _copyNestLoopParam(NestLoopParam *from)
*** 962,968 ****
   * _copyPlanRowMark
   */
  static PlanRowMark *
! _copyPlanRowMark(PlanRowMark *from)
  {
  	PlanRowMark *newnode = makeNode(PlanRowMark);
  
--- 962,968 ----
   * _copyPlanRowMark
   */
  static PlanRowMark *
! _copyPlanRowMark(const PlanRowMark *from)
  {
  	PlanRowMark *newnode = makeNode(PlanRowMark);
  
*************** _copyPlanRowMark(PlanRowMark *from)
*** 980,986 ****
   * _copyPlanInvalItem
   */
  static PlanInvalItem *
! _copyPlanInvalItem(PlanInvalItem *from)
  {
  	PlanInvalItem *newnode = makeNode(PlanInvalItem);
  
--- 980,986 ----
   * _copyPlanInvalItem
   */
  static PlanInvalItem *
! _copyPlanInvalItem(const PlanInvalItem *from)
  {
  	PlanInvalItem *newnode = makeNode(PlanInvalItem);
  
*************** _copyPlanInvalItem(PlanInvalItem *from)
*** 999,1005 ****
   * _copyAlias
   */
  static Alias *
! _copyAlias(Alias *from)
  {
  	Alias	   *newnode = makeNode(Alias);
  
--- 999,1005 ----
   * _copyAlias
   */
  static Alias *
! _copyAlias(const Alias *from)
  {
  	Alias	   *newnode = makeNode(Alias);
  
*************** _copyAlias(Alias *from)
*** 1013,1019 ****
   * _copyRangeVar
   */
  static RangeVar *
! _copyRangeVar(RangeVar *from)
  {
  	RangeVar   *newnode = makeNode(RangeVar);
  
--- 1013,1019 ----
   * _copyRangeVar
   */
  static RangeVar *
! _copyRangeVar(const RangeVar *from)
  {
  	RangeVar   *newnode = makeNode(RangeVar);
  
*************** _copyRangeVar(RangeVar *from)
*** 1032,1038 ****
   * _copyIntoClause
   */
  static IntoClause *
! _copyIntoClause(IntoClause *from)
  {
  	IntoClause *newnode = makeNode(IntoClause);
  
--- 1032,1038 ----
   * _copyIntoClause
   */
  static IntoClause *
! _copyIntoClause(const IntoClause *from)
  {
  	IntoClause *newnode = makeNode(IntoClause);
  
*************** _copyIntoClause(IntoClause *from)
*** 1056,1062 ****
   * _copyVar
   */
  static Var *
! _copyVar(Var *from)
  {
  	Var		   *newnode = makeNode(Var);
  
--- 1056,1062 ----
   * _copyVar
   */
  static Var *
! _copyVar(const Var *from)
  {
  	Var		   *newnode = makeNode(Var);
  
*************** _copyVar(Var *from)
*** 1077,1083 ****
   * _copyConst
   */
  static Const *
! _copyConst(Const *from)
  {
  	Const	   *newnode = makeNode(Const);
  
--- 1077,1083 ----
   * _copyConst
   */
  static Const *
! _copyConst(const Const *from)
  {
  	Const	   *newnode = makeNode(Const);
  
*************** _copyConst(Const *from)
*** 1115,1121 ****
   * _copyParam
   */
  static Param *
! _copyParam(Param *from)
  {
  	Param	   *newnode = makeNode(Param);
  
--- 1115,1121 ----
   * _copyParam
   */
  static Param *
! _copyParam(const Param *from)
  {
  	Param	   *newnode = makeNode(Param);
  
*************** _copyParam(Param *from)
*** 1133,1139 ****
   * _copyAggref
   */
  static Aggref *
! _copyAggref(Aggref *from)
  {
  	Aggref	   *newnode = makeNode(Aggref);
  
--- 1133,1139 ----
   * _copyAggref
   */
  static Aggref *
! _copyAggref(const Aggref *from)
  {
  	Aggref	   *newnode = makeNode(Aggref);
  
*************** _copyAggref(Aggref *from)
*** 1155,1161 ****
   * _copyWindowFunc
   */
  static WindowFunc *
! _copyWindowFunc(WindowFunc *from)
  {
  	WindowFunc *newnode = makeNode(WindowFunc);
  
--- 1155,1161 ----
   * _copyWindowFunc
   */
  static WindowFunc *
! _copyWindowFunc(const WindowFunc *from)
  {
  	WindowFunc *newnode = makeNode(WindowFunc);
  
*************** _copyWindowFunc(WindowFunc *from)
*** 1176,1182 ****
   * _copyArrayRef
   */
  static ArrayRef *
! _copyArrayRef(ArrayRef *from)
  {
  	ArrayRef   *newnode = makeNode(ArrayRef);
  
--- 1176,1182 ----
   * _copyArrayRef
   */
  static ArrayRef *
! _copyArrayRef(const ArrayRef *from)
  {
  	ArrayRef   *newnode = makeNode(ArrayRef);
  
*************** _copyArrayRef(ArrayRef *from)
*** 1196,1202 ****
   * _copyFuncExpr
   */
  static FuncExpr *
! _copyFuncExpr(FuncExpr *from)
  {
  	FuncExpr   *newnode = makeNode(FuncExpr);
  
--- 1196,1202 ----
   * _copyFuncExpr
   */
  static FuncExpr *
! _copyFuncExpr(const FuncExpr *from)
  {
  	FuncExpr   *newnode = makeNode(FuncExpr);
  
*************** _copyFuncExpr(FuncExpr *from)
*** 1216,1222 ****
   * _copyNamedArgExpr *
   */
  static NamedArgExpr *
! _copyNamedArgExpr(NamedArgExpr *from)
  {
  	NamedArgExpr *newnode = makeNode(NamedArgExpr);
  
--- 1216,1222 ----
   * _copyNamedArgExpr *
   */
  static NamedArgExpr *
! _copyNamedArgExpr(const NamedArgExpr *from)
  {
  	NamedArgExpr *newnode = makeNode(NamedArgExpr);
  
*************** _copyNamedArgExpr(NamedArgExpr *from)
*** 1232,1238 ****
   * _copyOpExpr
   */
  static OpExpr *
! _copyOpExpr(OpExpr *from)
  {
  	OpExpr	   *newnode = makeNode(OpExpr);
  
--- 1232,1238 ----
   * _copyOpExpr
   */
  static OpExpr *
! _copyOpExpr(const OpExpr *from)
  {
  	OpExpr	   *newnode = makeNode(OpExpr);
  
*************** _copyOpExpr(OpExpr *from)
*** 1252,1258 ****
   * _copyDistinctExpr (same as OpExpr)
   */
  static DistinctExpr *
! _copyDistinctExpr(DistinctExpr *from)
  {
  	DistinctExpr *newnode = makeNode(DistinctExpr);
  
--- 1252,1258 ----
   * _copyDistinctExpr (same as OpExpr)
   */
  static DistinctExpr *
! _copyDistinctExpr(const DistinctExpr *from)
  {
  	DistinctExpr *newnode = makeNode(DistinctExpr);
  
*************** _copyDistinctExpr(DistinctExpr *from)
*** 1272,1278 ****
   * _copyNullIfExpr (same as OpExpr)
   */
  static NullIfExpr *
! _copyNullIfExpr(NullIfExpr *from)
  {
  	NullIfExpr *newnode = makeNode(NullIfExpr);
  
--- 1272,1278 ----
   * _copyNullIfExpr (same as OpExpr)
   */
  static NullIfExpr *
! _copyNullIfExpr(const NullIfExpr *from)
  {
  	NullIfExpr *newnode = makeNode(NullIfExpr);
  
*************** _copyNullIfExpr(NullIfExpr *from)
*** 1292,1298 ****
   * _copyScalarArrayOpExpr
   */
  static ScalarArrayOpExpr *
! _copyScalarArrayOpExpr(ScalarArrayOpExpr *from)
  {
  	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
  
--- 1292,1298 ----
   * _copyScalarArrayOpExpr
   */
  static ScalarArrayOpExpr *
! _copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
  {
  	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
  
*************** _copyScalarArrayOpExpr(ScalarArrayOpExpr
*** 1310,1316 ****
   * _copyBoolExpr
   */
  static BoolExpr *
! _copyBoolExpr(BoolExpr *from)
  {
  	BoolExpr   *newnode = makeNode(BoolExpr);
  
--- 1310,1316 ----
   * _copyBoolExpr
   */
  static BoolExpr *
! _copyBoolExpr(const BoolExpr *from)
  {
  	BoolExpr   *newnode = makeNode(BoolExpr);
  
*************** _copyBoolExpr(BoolExpr *from)
*** 1325,1331 ****
   * _copySubLink
   */
  static SubLink *
! _copySubLink(SubLink *from)
  {
  	SubLink    *newnode = makeNode(SubLink);
  
--- 1325,1331 ----
   * _copySubLink
   */
  static SubLink *
! _copySubLink(const SubLink *from)
  {
  	SubLink    *newnode = makeNode(SubLink);
  
*************** _copySubLink(SubLink *from)
*** 1342,1348 ****
   * _copySubPlan
   */
  static SubPlan *
! _copySubPlan(SubPlan *from)
  {
  	SubPlan    *newnode = makeNode(SubPlan);
  
--- 1342,1348 ----
   * _copySubPlan
   */
  static SubPlan *
! _copySubPlan(const SubPlan *from)
  {
  	SubPlan    *newnode = makeNode(SubPlan);
  
*************** _copySubPlan(SubPlan *from)
*** 1369,1375 ****
   * _copyAlternativeSubPlan
   */
  static AlternativeSubPlan *
! _copyAlternativeSubPlan(AlternativeSubPlan *from)
  {
  	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
  
--- 1369,1375 ----
   * _copyAlternativeSubPlan
   */
  static AlternativeSubPlan *
! _copyAlternativeSubPlan(const AlternativeSubPlan *from)
  {
  	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
  
*************** _copyAlternativeSubPlan(AlternativeSubPl
*** 1382,1388 ****
   * _copyFieldSelect
   */
  static FieldSelect *
! _copyFieldSelect(FieldSelect *from)
  {
  	FieldSelect *newnode = makeNode(FieldSelect);
  
--- 1382,1388 ----
   * _copyFieldSelect
   */
  static FieldSelect *
! _copyFieldSelect(const FieldSelect *from)
  {
  	FieldSelect *newnode = makeNode(FieldSelect);
  
*************** _copyFieldSelect(FieldSelect *from)
*** 1399,1405 ****
   * _copyFieldStore
   */
  static FieldStore *
! _copyFieldStore(FieldStore *from)
  {
  	FieldStore *newnode = makeNode(FieldStore);
  
--- 1399,1405 ----
   * _copyFieldStore
   */
  static FieldStore *
! _copyFieldStore(const FieldStore *from)
  {
  	FieldStore *newnode = makeNode(FieldStore);
  
*************** _copyFieldStore(FieldStore *from)
*** 1415,1421 ****
   * _copyRelabelType
   */
  static RelabelType *
! _copyRelabelType(RelabelType *from)
  {
  	RelabelType *newnode = makeNode(RelabelType);
  
--- 1415,1421 ----
   * _copyRelabelType
   */
  static RelabelType *
! _copyRelabelType(const RelabelType *from)
  {
  	RelabelType *newnode = makeNode(RelabelType);
  
*************** _copyRelabelType(RelabelType *from)
*** 1433,1439 ****
   * _copyCoerceViaIO
   */
  static CoerceViaIO *
! _copyCoerceViaIO(CoerceViaIO *from)
  {
  	CoerceViaIO *newnode = makeNode(CoerceViaIO);
  
--- 1433,1439 ----
   * _copyCoerceViaIO
   */
  static CoerceViaIO *
! _copyCoerceViaIO(const CoerceViaIO *from)
  {
  	CoerceViaIO *newnode = makeNode(CoerceViaIO);
  
*************** _copyCoerceViaIO(CoerceViaIO *from)
*** 1450,1456 ****
   * _copyArrayCoerceExpr
   */
  static ArrayCoerceExpr *
! _copyArrayCoerceExpr(ArrayCoerceExpr *from)
  {
  	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
  
--- 1450,1456 ----
   * _copyArrayCoerceExpr
   */
  static ArrayCoerceExpr *
! _copyArrayCoerceExpr(const ArrayCoerceExpr *from)
  {
  	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
  
*************** _copyArrayCoerceExpr(ArrayCoerceExpr *fr
*** 1470,1476 ****
   * _copyConvertRowtypeExpr
   */
  static ConvertRowtypeExpr *
! _copyConvertRowtypeExpr(ConvertRowtypeExpr *from)
  {
  	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
  
--- 1470,1476 ----
   * _copyConvertRowtypeExpr
   */
  static ConvertRowtypeExpr *
! _copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
  {
  	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
  
*************** _copyConvertRowtypeExpr(ConvertRowtypeEx
*** 1486,1492 ****
   * _copyCollateExpr
   */
  static CollateExpr *
! _copyCollateExpr(CollateExpr *from)
  {
  	CollateExpr *newnode = makeNode(CollateExpr);
  
--- 1486,1492 ----
   * _copyCollateExpr
   */
  static CollateExpr *
! _copyCollateExpr(const CollateExpr *from)
  {
  	CollateExpr *newnode = makeNode(CollateExpr);
  
*************** _copyCollateExpr(CollateExpr *from)
*** 1501,1507 ****
   * _copyCaseExpr
   */
  static CaseExpr *
! _copyCaseExpr(CaseExpr *from)
  {
  	CaseExpr   *newnode = makeNode(CaseExpr);
  
--- 1501,1507 ----
   * _copyCaseExpr
   */
  static CaseExpr *
! _copyCaseExpr(const CaseExpr *from)
  {
  	CaseExpr   *newnode = makeNode(CaseExpr);
  
*************** _copyCaseExpr(CaseExpr *from)
*** 1519,1525 ****
   * _copyCaseWhen
   */
  static CaseWhen *
! _copyCaseWhen(CaseWhen *from)
  {
  	CaseWhen   *newnode = makeNode(CaseWhen);
  
--- 1519,1525 ----
   * _copyCaseWhen
   */
  static CaseWhen *
! _copyCaseWhen(const CaseWhen *from)
  {
  	CaseWhen   *newnode = makeNode(CaseWhen);
  
*************** _copyCaseWhen(CaseWhen *from)
*** 1534,1540 ****
   * _copyCaseTestExpr
   */
  static CaseTestExpr *
! _copyCaseTestExpr(CaseTestExpr *from)
  {
  	CaseTestExpr *newnode = makeNode(CaseTestExpr);
  
--- 1534,1540 ----
   * _copyCaseTestExpr
   */
  static CaseTestExpr *
! _copyCaseTestExpr(const CaseTestExpr *from)
  {
  	CaseTestExpr *newnode = makeNode(CaseTestExpr);
  
*************** _copyCaseTestExpr(CaseTestExpr *from)
*** 1549,1555 ****
   * _copyArrayExpr
   */
  static ArrayExpr *
! _copyArrayExpr(ArrayExpr *from)
  {
  	ArrayExpr  *newnode = makeNode(ArrayExpr);
  
--- 1549,1555 ----
   * _copyArrayExpr
   */
  static ArrayExpr *
! _copyArrayExpr(const ArrayExpr *from)
  {
  	ArrayExpr  *newnode = makeNode(ArrayExpr);
  
*************** _copyArrayExpr(ArrayExpr *from)
*** 1567,1573 ****
   * _copyRowExpr
   */
  static RowExpr *
! _copyRowExpr(RowExpr *from)
  {
  	RowExpr    *newnode = makeNode(RowExpr);
  
--- 1567,1573 ----
   * _copyRowExpr
   */
  static RowExpr *
! _copyRowExpr(const RowExpr *from)
  {
  	RowExpr    *newnode = makeNode(RowExpr);
  
*************** _copyRowExpr(RowExpr *from)
*** 1584,1590 ****
   * _copyRowCompareExpr
   */
  static RowCompareExpr *
! _copyRowCompareExpr(RowCompareExpr *from)
  {
  	RowCompareExpr *newnode = makeNode(RowCompareExpr);
  
--- 1584,1590 ----
   * _copyRowCompareExpr
   */
  static RowCompareExpr *
! _copyRowCompareExpr(const RowCompareExpr *from)
  {
  	RowCompareExpr *newnode = makeNode(RowCompareExpr);
  
*************** _copyRowCompareExpr(RowCompareExpr *from
*** 1602,1608 ****
   * _copyCoalesceExpr
   */
  static CoalesceExpr *
! _copyCoalesceExpr(CoalesceExpr *from)
  {
  	CoalesceExpr *newnode = makeNode(CoalesceExpr);
  
--- 1602,1608 ----
   * _copyCoalesceExpr
   */
  static CoalesceExpr *
! _copyCoalesceExpr(const CoalesceExpr *from)
  {
  	CoalesceExpr *newnode = makeNode(CoalesceExpr);
  
*************** _copyCoalesceExpr(CoalesceExpr *from)
*** 1618,1624 ****
   * _copyMinMaxExpr
   */
  static MinMaxExpr *
! _copyMinMaxExpr(MinMaxExpr *from)
  {
  	MinMaxExpr *newnode = makeNode(MinMaxExpr);
  
--- 1618,1624 ----
   * _copyMinMaxExpr
   */
  static MinMaxExpr *
! _copyMinMaxExpr(const MinMaxExpr *from)
  {
  	MinMaxExpr *newnode = makeNode(MinMaxExpr);
  
*************** _copyMinMaxExpr(MinMaxExpr *from)
*** 1636,1642 ****
   * _copyXmlExpr
   */
  static XmlExpr *
! _copyXmlExpr(XmlExpr *from)
  {
  	XmlExpr    *newnode = makeNode(XmlExpr);
  
--- 1636,1642 ----
   * _copyXmlExpr
   */
  static XmlExpr *
! _copyXmlExpr(const XmlExpr *from)
  {
  	XmlExpr    *newnode = makeNode(XmlExpr);
  
*************** _copyXmlExpr(XmlExpr *from)
*** 1657,1663 ****
   * _copyNullTest
   */
  static NullTest *
! _copyNullTest(NullTest *from)
  {
  	NullTest   *newnode = makeNode(NullTest);
  
--- 1657,1663 ----
   * _copyNullTest
   */
  static NullTest *
! _copyNullTest(const NullTest *from)
  {
  	NullTest   *newnode = makeNode(NullTest);
  
*************** _copyNullTest(NullTest *from)
*** 1672,1678 ****
   * _copyBooleanTest
   */
  static BooleanTest *
! _copyBooleanTest(BooleanTest *from)
  {
  	BooleanTest *newnode = makeNode(BooleanTest);
  
--- 1672,1678 ----
   * _copyBooleanTest
   */
  static BooleanTest *
! _copyBooleanTest(const BooleanTest *from)
  {
  	BooleanTest *newnode = makeNode(BooleanTest);
  
*************** _copyBooleanTest(BooleanTest *from)
*** 1686,1692 ****
   * _copyCoerceToDomain
   */
  static CoerceToDomain *
! _copyCoerceToDomain(CoerceToDomain *from)
  {
  	CoerceToDomain *newnode = makeNode(CoerceToDomain);
  
--- 1686,1692 ----
   * _copyCoerceToDomain
   */
  static CoerceToDomain *
! _copyCoerceToDomain(const CoerceToDomain *from)
  {
  	CoerceToDomain *newnode = makeNode(CoerceToDomain);
  
*************** _copyCoerceToDomain(CoerceToDomain *from
*** 1704,1710 ****
   * _copyCoerceToDomainValue
   */
  static CoerceToDomainValue *
! _copyCoerceToDomainValue(CoerceToDomainValue *from)
  {
  	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
  
--- 1704,1710 ----
   * _copyCoerceToDomainValue
   */
  static CoerceToDomainValue *
! _copyCoerceToDomainValue(const CoerceToDomainValue *from)
  {
  	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
  
*************** _copyCoerceToDomainValue(CoerceToDomainV
*** 1720,1726 ****
   * _copySetToDefault
   */
  static SetToDefault *
! _copySetToDefault(SetToDefault *from)
  {
  	SetToDefault *newnode = makeNode(SetToDefault);
  
--- 1720,1726 ----
   * _copySetToDefault
   */
  static SetToDefault *
! _copySetToDefault(const SetToDefault *from)
  {
  	SetToDefault *newnode = makeNode(SetToDefault);
  
*************** _copySetToDefault(SetToDefault *from)
*** 1736,1742 ****
   * _copyCurrentOfExpr
   */
  static CurrentOfExpr *
! _copyCurrentOfExpr(CurrentOfExpr *from)
  {
  	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
  
--- 1736,1742 ----
   * _copyCurrentOfExpr
   */
  static CurrentOfExpr *
! _copyCurrentOfExpr(const CurrentOfExpr *from)
  {
  	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
  
*************** _copyCurrentOfExpr(CurrentOfExpr *from)
*** 1751,1757 ****
   * _copyTargetEntry
   */
  static TargetEntry *
! _copyTargetEntry(TargetEntry *from)
  {
  	TargetEntry *newnode = makeNode(TargetEntry);
  
--- 1751,1757 ----
   * _copyTargetEntry
   */
  static TargetEntry *
! _copyTargetEntry(const TargetEntry *from)
  {
  	TargetEntry *newnode = makeNode(TargetEntry);
  
*************** _copyTargetEntry(TargetEntry *from)
*** 1770,1776 ****
   * _copyRangeTblRef
   */
  static RangeTblRef *
! _copyRangeTblRef(RangeTblRef *from)
  {
  	RangeTblRef *newnode = makeNode(RangeTblRef);
  
--- 1770,1776 ----
   * _copyRangeTblRef
   */
  static RangeTblRef *
! _copyRangeTblRef(const RangeTblRef *from)
  {
  	RangeTblRef *newnode = makeNode(RangeTblRef);
  
*************** _copyRangeTblRef(RangeTblRef *from)
*** 1783,1789 ****
   * _copyJoinExpr
   */
  static JoinExpr *
! _copyJoinExpr(JoinExpr *from)
  {
  	JoinExpr   *newnode = makeNode(JoinExpr);
  
--- 1783,1789 ----
   * _copyJoinExpr
   */
  static JoinExpr *
! _copyJoinExpr(const JoinExpr *from)
  {
  	JoinExpr   *newnode = makeNode(JoinExpr);
  
*************** _copyJoinExpr(JoinExpr *from)
*** 1803,1809 ****
   * _copyFromExpr
   */
  static FromExpr *
! _copyFromExpr(FromExpr *from)
  {
  	FromExpr   *newnode = makeNode(FromExpr);
  
--- 1803,1809 ----
   * _copyFromExpr
   */
  static FromExpr *
! _copyFromExpr(const FromExpr *from)
  {
  	FromExpr   *newnode = makeNode(FromExpr);
  
*************** _copyFromExpr(FromExpr *from)
*** 1825,1831 ****
   * _copyPathKey
   */
  static PathKey *
! _copyPathKey(PathKey *from)
  {
  	PathKey    *newnode = makeNode(PathKey);
  
--- 1825,1831 ----
   * _copyPathKey
   */
  static PathKey *
! _copyPathKey(const PathKey *from)
  {
  	PathKey    *newnode = makeNode(PathKey);
  
*************** _copyPathKey(PathKey *from)
*** 1842,1848 ****
   * _copyRestrictInfo
   */
  static RestrictInfo *
! _copyRestrictInfo(RestrictInfo *from)
  {
  	RestrictInfo *newnode = makeNode(RestrictInfo);
  
--- 1842,1848 ----
   * _copyRestrictInfo
   */
  static RestrictInfo *
! _copyRestrictInfo(const RestrictInfo *from)
  {
  	RestrictInfo *newnode = makeNode(RestrictInfo);
  
*************** _copyRestrictInfo(RestrictInfo *from)
*** 1882,1888 ****
   * _copyPlaceHolderVar
   */
  static PlaceHolderVar *
! _copyPlaceHolderVar(PlaceHolderVar *from)
  {
  	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
  
--- 1882,1888 ----
   * _copyPlaceHolderVar
   */
  static PlaceHolderVar *
! _copyPlaceHolderVar(const PlaceHolderVar *from)
  {
  	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
  
*************** _copyPlaceHolderVar(PlaceHolderVar *from
*** 1898,1904 ****
   * _copySpecialJoinInfo
   */
  static SpecialJoinInfo *
! _copySpecialJoinInfo(SpecialJoinInfo *from)
  {
  	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
  
--- 1898,1904 ----
   * _copySpecialJoinInfo
   */
  static SpecialJoinInfo *
! _copySpecialJoinInfo(const SpecialJoinInfo *from)
  {
  	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
  
*************** _copySpecialJoinInfo(SpecialJoinInfo *fr
*** 1918,1924 ****
   * _copyAppendRelInfo
   */
  static AppendRelInfo *
! _copyAppendRelInfo(AppendRelInfo *from)
  {
  	AppendRelInfo *newnode = makeNode(AppendRelInfo);
  
--- 1918,1924 ----
   * _copyAppendRelInfo
   */
  static AppendRelInfo *
! _copyAppendRelInfo(const AppendRelInfo *from)
  {
  	AppendRelInfo *newnode = makeNode(AppendRelInfo);
  
*************** _copyAppendRelInfo(AppendRelInfo *from)
*** 1936,1942 ****
   * _copyPlaceHolderInfo
   */
  static PlaceHolderInfo *
! _copyPlaceHolderInfo(PlaceHolderInfo *from)
  {
  	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
  
--- 1936,1942 ----
   * _copyPlaceHolderInfo
   */
  static PlaceHolderInfo *
! _copyPlaceHolderInfo(const PlaceHolderInfo *from)
  {
  	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
  
*************** _copyPlaceHolderInfo(PlaceHolderInfo *fr
*** 1956,1962 ****
   */
  
  static RangeTblEntry *
! _copyRangeTblEntry(RangeTblEntry *from)
  {
  	RangeTblEntry *newnode = makeNode(RangeTblEntry);
  
--- 1956,1962 ----
   */
  
  static RangeTblEntry *
! _copyRangeTblEntry(const RangeTblEntry *from)
  {
  	RangeTblEntry *newnode = makeNode(RangeTblEntry);
  
*************** _copyRangeTblEntry(RangeTblEntry *from)
*** 1991,1997 ****
  }
  
  static SortGroupClause *
! _copySortGroupClause(SortGroupClause *from)
  {
  	SortGroupClause *newnode = makeNode(SortGroupClause);
  
--- 1991,1997 ----
  }
  
  static SortGroupClause *
! _copySortGroupClause(const SortGroupClause *from)
  {
  	SortGroupClause *newnode = makeNode(SortGroupClause);
  
*************** _copySortGroupClause(SortGroupClause *fr
*** 2005,2011 ****
  }
  
  static WindowClause *
! _copyWindowClause(WindowClause *from)
  {
  	WindowClause *newnode = makeNode(WindowClause);
  
--- 2005,2011 ----
  }
  
  static WindowClause *
! _copyWindowClause(const WindowClause *from)
  {
  	WindowClause *newnode = makeNode(WindowClause);
  
*************** _copyWindowClause(WindowClause *from)
*** 2023,2029 ****
  }
  
  static RowMarkClause *
! _copyRowMarkClause(RowMarkClause *from)
  {
  	RowMarkClause *newnode = makeNode(RowMarkClause);
  
--- 2023,2029 ----
  }
  
  static RowMarkClause *
! _copyRowMarkClause(const RowMarkClause *from)
  {
  	RowMarkClause *newnode = makeNode(RowMarkClause);
  
*************** _copyRowMarkClause(RowMarkClause *from)
*** 2036,2042 ****
  }
  
  static WithClause *
! _copyWithClause(WithClause *from)
  {
  	WithClause *newnode = makeNode(WithClause);
  
--- 2036,2042 ----
  }
  
  static WithClause *
! _copyWithClause(const WithClause *from)
  {
  	WithClause *newnode = makeNode(WithClause);
  
*************** _copyWithClause(WithClause *from)
*** 2048,2054 ****
  }
  
  static CommonTableExpr *
! _copyCommonTableExpr(CommonTableExpr *from)
  {
  	CommonTableExpr *newnode = makeNode(CommonTableExpr);
  
--- 2048,2054 ----
  }
  
  static CommonTableExpr *
! _copyCommonTableExpr(const CommonTableExpr *from)
  {
  	CommonTableExpr *newnode = makeNode(CommonTableExpr);
  
*************** _copyCommonTableExpr(CommonTableExpr *fr
*** 2067,2073 ****
  }
  
  static A_Expr *
! _copyAExpr(A_Expr *from)
  {
  	A_Expr	   *newnode = makeNode(A_Expr);
  
--- 2067,2073 ----
  }
  
  static A_Expr *
! _copyAExpr(const A_Expr *from)
  {
  	A_Expr	   *newnode = makeNode(A_Expr);
  
*************** _copyAExpr(A_Expr *from)
*** 2081,2087 ****
  }
  
  static ColumnRef *
! _copyColumnRef(ColumnRef *from)
  {
  	ColumnRef  *newnode = makeNode(ColumnRef);
  
--- 2081,2087 ----
  }
  
  static ColumnRef *
! _copyColumnRef(const ColumnRef *from)
  {
  	ColumnRef  *newnode = makeNode(ColumnRef);
  
*************** _copyColumnRef(ColumnRef *from)
*** 2092,2098 ****
  }
  
  static ParamRef *
! _copyParamRef(ParamRef *from)
  {
  	ParamRef   *newnode = makeNode(ParamRef);
  
--- 2092,2098 ----
  }
  
  static ParamRef *
! _copyParamRef(const ParamRef *from)
  {
  	ParamRef   *newnode = makeNode(ParamRef);
  
*************** _copyParamRef(ParamRef *from)
*** 2103,2109 ****
  }
  
  static A_Const *
! _copyAConst(A_Const *from)
  {
  	A_Const    *newnode = makeNode(A_Const);
  
--- 2103,2109 ----
  }
  
  static A_Const *
! _copyAConst(const A_Const *from)
  {
  	A_Const    *newnode = makeNode(A_Const);
  
*************** _copyAConst(A_Const *from)
*** 2134,2140 ****
  }
  
  static FuncCall *
! _copyFuncCall(FuncCall *from)
  {
  	FuncCall   *newnode = makeNode(FuncCall);
  
--- 2134,2140 ----
  }
  
  static FuncCall *
! _copyFuncCall(const FuncCall *from)
  {
  	FuncCall   *newnode = makeNode(FuncCall);
  
*************** _copyFuncCall(FuncCall *from)
*** 2151,2157 ****
  }
  
  static A_Star *
! _copyAStar(A_Star *from)
  {
  	A_Star	   *newnode = makeNode(A_Star);
  
--- 2151,2157 ----
  }
  
  static A_Star *
! _copyAStar(const A_Star *from)
  {
  	A_Star	   *newnode = makeNode(A_Star);
  
*************** _copyAStar(A_Star *from)
*** 2159,2165 ****
  }
  
  static A_Indices *
! _copyAIndices(A_Indices *from)
  {
  	A_Indices  *newnode = makeNode(A_Indices);
  
--- 2159,2165 ----
  }
  
  static A_Indices *
! _copyAIndices(const A_Indices *from)
  {
  	A_Indices  *newnode = makeNode(A_Indices);
  
*************** _copyAIndices(A_Indices *from)
*** 2170,2176 ****
  }
  
  static A_Indirection *
! _copyA_Indirection(A_Indirection *from)
  {
  	A_Indirection *newnode = makeNode(A_Indirection);
  
--- 2170,2176 ----
  }
  
  static A_Indirection *
! _copyA_Indirection(const A_Indirection *from)
  {
  	A_Indirection *newnode = makeNode(A_Indirection);
  
*************** _copyA_Indirection(A_Indirection *from)
*** 2181,2187 ****
  }
  
  static A_ArrayExpr *
! _copyA_ArrayExpr(A_ArrayExpr *from)
  {
  	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
  
--- 2181,2187 ----
  }
  
  static A_ArrayExpr *
! _copyA_ArrayExpr(const A_ArrayExpr *from)
  {
  	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
  
*************** _copyA_ArrayExpr(A_ArrayExpr *from)
*** 2192,2198 ****
  }
  
  static ResTarget *
! _copyResTarget(ResTarget *from)
  {
  	ResTarget  *newnode = makeNode(ResTarget);
  
--- 2192,2198 ----
  }
  
  static ResTarget *
! _copyResTarget(const ResTarget *from)
  {
  	ResTarget  *newnode = makeNode(ResTarget);
  
*************** _copyResTarget(ResTarget *from)
*** 2205,2211 ****
  }
  
  static TypeName *
! _copyTypeName(TypeName *from)
  {
  	TypeName   *newnode = makeNode(TypeName);
  
--- 2205,2211 ----
  }
  
  static TypeName *
! _copyTypeName(const TypeName *from)
  {
  	TypeName   *newnode = makeNode(TypeName);
  
*************** _copyTypeName(TypeName *from)
*** 2222,2228 ****
  }
  
  static SortBy *
! _copySortBy(SortBy *from)
  {
  	SortBy	   *newnode = makeNode(SortBy);
  
--- 2222,2228 ----
  }
  
  static SortBy *
! _copySortBy(const SortBy *from)
  {
  	SortBy	   *newnode = makeNode(SortBy);
  
*************** _copySortBy(SortBy *from)
*** 2236,2242 ****
  }
  
  static WindowDef *
! _copyWindowDef(WindowDef *from)
  {
  	WindowDef  *newnode = makeNode(WindowDef);
  
--- 2236,2242 ----
  }
  
  static WindowDef *
! _copyWindowDef(const WindowDef *from)
  {
  	WindowDef  *newnode = makeNode(WindowDef);
  
*************** _copyWindowDef(WindowDef *from)
*** 2253,2259 ****
  }
  
  static RangeSubselect *
! _copyRangeSubselect(RangeSubselect *from)
  {
  	RangeSubselect *newnode = makeNode(RangeSubselect);
  
--- 2253,2259 ----
  }
  
  static RangeSubselect *
! _copyRangeSubselect(const RangeSubselect *from)
  {
  	RangeSubselect *newnode = makeNode(RangeSubselect);
  
*************** _copyRangeSubselect(RangeSubselect *from
*** 2264,2270 ****
  }
  
  static RangeFunction *
! _copyRangeFunction(RangeFunction *from)
  {
  	RangeFunction *newnode = makeNode(RangeFunction);
  
--- 2264,2270 ----
  }
  
  static RangeFunction *
! _copyRangeFunction(const RangeFunction *from)
  {
  	RangeFunction *newnode = makeNode(RangeFunction);
  
*************** _copyRangeFunction(RangeFunction *from)
*** 2276,2282 ****
  }
  
  static TypeCast *
! _copyTypeCast(TypeCast *from)
  {
  	TypeCast   *newnode = makeNode(TypeCast);
  
--- 2276,2282 ----
  }
  
  static TypeCast *
! _copyTypeCast(const TypeCast *from)
  {
  	TypeCast   *newnode = makeNode(TypeCast);
  
*************** _copyTypeCast(TypeCast *from)
*** 2288,2294 ****
  }
  
  static CollateClause *
! _copyCollateClause(CollateClause *from)
  {
  	CollateClause *newnode = makeNode(CollateClause);
  
--- 2288,2294 ----
  }
  
  static CollateClause *
! _copyCollateClause(const CollateClause *from)
  {
  	CollateClause *newnode = makeNode(CollateClause);
  
*************** _copyCollateClause(CollateClause *from)
*** 2300,2306 ****
  }
  
  static IndexElem *
! _copyIndexElem(IndexElem *from)
  {
  	IndexElem  *newnode = makeNode(IndexElem);
  
--- 2300,2306 ----
  }
  
  static IndexElem *
! _copyIndexElem(const IndexElem *from)
  {
  	IndexElem  *newnode = makeNode(IndexElem);
  
*************** _copyIndexElem(IndexElem *from)
*** 2316,2322 ****
  }
  
  static ColumnDef *
! _copyColumnDef(ColumnDef *from)
  {
  	ColumnDef  *newnode = makeNode(ColumnDef);
  
--- 2316,2322 ----
  }
  
  static ColumnDef *
! _copyColumnDef(const ColumnDef *from)
  {
  	ColumnDef  *newnode = makeNode(ColumnDef);
  
*************** _copyColumnDef(ColumnDef *from)
*** 2338,2344 ****
  }
  
  static Constraint *
! _copyConstraint(Constraint *from)
  {
  	Constraint *newnode = makeNode(Constraint);
  
--- 2338,2344 ----
  }
  
  static Constraint *
! _copyConstraint(const Constraint *from)
  {
  	Constraint *newnode = makeNode(Constraint);
  
*************** _copyConstraint(Constraint *from)
*** 2369,2375 ****
  }
  
  static DefElem *
! _copyDefElem(DefElem *from)
  {
  	DefElem    *newnode = makeNode(DefElem);
  
--- 2369,2375 ----
  }
  
  static DefElem *
! _copyDefElem(const DefElem *from)
  {
  	DefElem    *newnode = makeNode(DefElem);
  
*************** _copyDefElem(DefElem *from)
*** 2382,2388 ****
  }
  
  static LockingClause *
! _copyLockingClause(LockingClause *from)
  {
  	LockingClause *newnode = makeNode(LockingClause);
  
--- 2382,2388 ----
  }
  
  static LockingClause *
! _copyLockingClause(const LockingClause *from)
  {
  	LockingClause *newnode = makeNode(LockingClause);
  
*************** _copyLockingClause(LockingClause *from)
*** 2394,2400 ****
  }
  
  static XmlSerialize *
! _copyXmlSerialize(XmlSerialize *from)
  {
  	XmlSerialize *newnode = makeNode(XmlSerialize);
  
--- 2394,2400 ----
  }
  
  static XmlSerialize *
! _copyXmlSerialize(const XmlSerialize *from)
  {
  	XmlSerialize *newnode = makeNode(XmlSerialize);
  
*************** _copyXmlSerialize(XmlSerialize *from)
*** 2407,2413 ****
  }
  
  static Query *
! _copyQuery(Query *from)
  {
  	Query	   *newnode = makeNode(Query);
  
--- 2407,2413 ----
  }
  
  static Query *
! _copyQuery(const Query *from)
  {
  	Query	   *newnode = makeNode(Query);
  
*************** _copyQuery(Query *from)
*** 2444,2450 ****
  }
  
  static InsertStmt *
! _copyInsertStmt(InsertStmt *from)
  {
  	InsertStmt *newnode = makeNode(InsertStmt);
  
--- 2444,2450 ----
  }
  
  static InsertStmt *
! _copyInsertStmt(const InsertStmt *from)
  {
  	InsertStmt *newnode = makeNode(InsertStmt);
  
*************** _copyInsertStmt(InsertStmt *from)
*** 2458,2464 ****
  }
  
  static DeleteStmt *
! _copyDeleteStmt(DeleteStmt *from)
  {
  	DeleteStmt *newnode = makeNode(DeleteStmt);
  
--- 2458,2464 ----
  }
  
  static DeleteStmt *
! _copyDeleteStmt(const DeleteStmt *from)
  {
  	DeleteStmt *newnode = makeNode(DeleteStmt);
  
*************** _copyDeleteStmt(DeleteStmt *from)
*** 2472,2478 ****
  }
  
  static UpdateStmt *
! _copyUpdateStmt(UpdateStmt *from)
  {
  	UpdateStmt *newnode = makeNode(UpdateStmt);
  
--- 2472,2478 ----
  }
  
  static UpdateStmt *
! _copyUpdateStmt(const UpdateStmt *from)
  {
  	UpdateStmt *newnode = makeNode(UpdateStmt);
  
*************** _copyUpdateStmt(UpdateStmt *from)
*** 2487,2493 ****
  }
  
  static SelectStmt *
! _copySelectStmt(SelectStmt *from)
  {
  	SelectStmt *newnode = makeNode(SelectStmt);
  
--- 2487,2493 ----
  }
  
  static SelectStmt *
! _copySelectStmt(const SelectStmt *from)
  {
  	SelectStmt *newnode = makeNode(SelectStmt);
  
*************** _copySelectStmt(SelectStmt *from)
*** 2514,2520 ****
  }
  
  static SetOperationStmt *
! _copySetOperationStmt(SetOperationStmt *from)
  {
  	SetOperationStmt *newnode = makeNode(SetOperationStmt);
  
--- 2514,2520 ----
  }
  
  static SetOperationStmt *
! _copySetOperationStmt(const SetOperationStmt *from)
  {
  	SetOperationStmt *newnode = makeNode(SetOperationStmt);
  
*************** _copySetOperationStmt(SetOperationStmt *
*** 2531,2537 ****
  }
  
  static AlterTableStmt *
! _copyAlterTableStmt(AlterTableStmt *from)
  {
  	AlterTableStmt *newnode = makeNode(AlterTableStmt);
  
--- 2531,2537 ----
  }
  
  static AlterTableStmt *
! _copyAlterTableStmt(const AlterTableStmt *from)
  {
  	AlterTableStmt *newnode = makeNode(AlterTableStmt);
  
*************** _copyAlterTableStmt(AlterTableStmt *from
*** 2543,2549 ****
  }
  
  static AlterTableCmd *
! _copyAlterTableCmd(AlterTableCmd *from)
  {
  	AlterTableCmd *newnode = makeNode(AlterTableCmd);
  
--- 2543,2549 ----
  }
  
  static AlterTableCmd *
! _copyAlterTableCmd(const AlterTableCmd *from)
  {
  	AlterTableCmd *newnode = makeNode(AlterTableCmd);
  
*************** _copyAlterTableCmd(AlterTableCmd *from)
*** 2557,2563 ****
  }
  
  static AlterDomainStmt *
! _copyAlterDomainStmt(AlterDomainStmt *from)
  {
  	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
  
--- 2557,2563 ----
  }
  
  static AlterDomainStmt *
! _copyAlterDomainStmt(const AlterDomainStmt *from)
  {
  	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
  
*************** _copyAlterDomainStmt(AlterDomainStmt *fr
*** 2571,2577 ****
  }
  
  static GrantStmt *
! _copyGrantStmt(GrantStmt *from)
  {
  	GrantStmt  *newnode = makeNode(GrantStmt);
  
--- 2571,2577 ----
  }
  
  static GrantStmt *
! _copyGrantStmt(const GrantStmt *from)
  {
  	GrantStmt  *newnode = makeNode(GrantStmt);
  
*************** _copyGrantStmt(GrantStmt *from)
*** 2588,2594 ****
  }
  
  static PrivGrantee *
! _copyPrivGrantee(PrivGrantee *from)
  {
  	PrivGrantee *newnode = makeNode(PrivGrantee);
  
--- 2588,2594 ----
  }
  
  static PrivGrantee *
! _copyPrivGrantee(const PrivGrantee *from)
  {
  	PrivGrantee *newnode = makeNode(PrivGrantee);
  
*************** _copyPrivGrantee(PrivGrantee *from)
*** 2598,2604 ****
  }
  
  static FuncWithArgs *
! _copyFuncWithArgs(FuncWithArgs *from)
  {
  	FuncWithArgs *newnode = makeNode(FuncWithArgs);
  
--- 2598,2604 ----
  }
  
  static FuncWithArgs *
! _copyFuncWithArgs(const FuncWithArgs *from)
  {
  	FuncWithArgs *newnode = makeNode(FuncWithArgs);
  
*************** _copyFuncWithArgs(FuncWithArgs *from)
*** 2609,2615 ****
  }
  
  static AccessPriv *
! _copyAccessPriv(AccessPriv *from)
  {
  	AccessPriv *newnode = makeNode(AccessPriv);
  
--- 2609,2615 ----
  }
  
  static AccessPriv *
! _copyAccessPriv(const AccessPriv *from)
  {
  	AccessPriv *newnode = makeNode(AccessPriv);
  
*************** _copyAccessPriv(AccessPriv *from)
*** 2620,2626 ****
  }
  
  static GrantRoleStmt *
! _copyGrantRoleStmt(GrantRoleStmt *from)
  {
  	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
  
--- 2620,2626 ----
  }
  
  static GrantRoleStmt *
! _copyGrantRoleStmt(const GrantRoleStmt *from)
  {
  	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
  
*************** _copyGrantRoleStmt(GrantRoleStmt *from)
*** 2635,2641 ****
  }
  
  static AlterDefaultPrivilegesStmt *
! _copyAlterDefaultPrivilegesStmt(AlterDefaultPrivilegesStmt *from)
  {
  	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
  
--- 2635,2641 ----
  }
  
  static AlterDefaultPrivilegesStmt *
! _copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
  {
  	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
  
*************** _copyAlterDefaultPrivilegesStmt(AlterDef
*** 2646,2652 ****
  }
  
  static DeclareCursorStmt *
! _copyDeclareCursorStmt(DeclareCursorStmt *from)
  {
  	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
  
--- 2646,2652 ----
  }
  
  static DeclareCursorStmt *
! _copyDeclareCursorStmt(const DeclareCursorStmt *from)
  {
  	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
  
*************** _copyDeclareCursorStmt(DeclareCursorStmt
*** 2658,2664 ****
  }
  
  static ClosePortalStmt *
! _copyClosePortalStmt(ClosePortalStmt *from)
  {
  	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
  
--- 2658,2664 ----
  }
  
  static ClosePortalStmt *
! _copyClosePortalStmt(const ClosePortalStmt *from)
  {
  	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
  
*************** _copyClosePortalStmt(ClosePortalStmt *fr
*** 2668,2674 ****
  }
  
  static ClusterStmt *
! _copyClusterStmt(ClusterStmt *from)
  {
  	ClusterStmt *newnode = makeNode(ClusterStmt);
  
--- 2668,2674 ----
  }
  
  static ClusterStmt *
! _copyClusterStmt(const ClusterStmt *from)
  {
  	ClusterStmt *newnode = makeNode(ClusterStmt);
  
*************** _copyClusterStmt(ClusterStmt *from)
*** 2680,2686 ****
  }
  
  static CopyStmt *
! _copyCopyStmt(CopyStmt *from)
  {
  	CopyStmt   *newnode = makeNode(CopyStmt);
  
--- 2680,2686 ----
  }
  
  static CopyStmt *
! _copyCopyStmt(const CopyStmt *from)
  {
  	CopyStmt   *newnode = makeNode(CopyStmt);
  
*************** _copyCopyStmt(CopyStmt *from)
*** 2701,2707 ****
   *		copy functions for classes which inherit from CreateStmt.
   */
  static void
! CopyCreateStmtFields(CreateStmt *from, CreateStmt *newnode)
  {
  	COPY_NODE_FIELD(relation);
  	COPY_NODE_FIELD(tableElts);
--- 2701,2707 ----
   *		copy functions for classes which inherit from CreateStmt.
   */
  static void
! CopyCreateStmtFields(const CreateStmt *from, CreateStmt *newnode)
  {
  	COPY_NODE_FIELD(relation);
  	COPY_NODE_FIELD(tableElts);
*************** CopyCreateStmtFields(CreateStmt *from, C
*** 2715,2721 ****
  }
  
  static CreateStmt *
! _copyCreateStmt(CreateStmt *from)
  {
  	CreateStmt *newnode = makeNode(CreateStmt);
  
--- 2715,2721 ----
  }
  
  static CreateStmt *
! _copyCreateStmt(const CreateStmt *from)
  {
  	CreateStmt *newnode = makeNode(CreateStmt);
  
*************** _copyCreateStmt(CreateStmt *from)
*** 2725,2731 ****
  }
  
  static InhRelation *
! _copyInhRelation(InhRelation *from)
  {
  	InhRelation *newnode = makeNode(InhRelation);
  
--- 2725,2731 ----
  }
  
  static InhRelation *
! _copyInhRelation(const InhRelation *from)
  {
  	InhRelation *newnode = makeNode(InhRelation);
  
*************** _copyInhRelation(InhRelation *from)
*** 2736,2742 ****
  }
  
  static DefineStmt *
! _copyDefineStmt(DefineStmt *from)
  {
  	DefineStmt *newnode = makeNode(DefineStmt);
  
--- 2736,2742 ----
  }
  
  static DefineStmt *
! _copyDefineStmt(const DefineStmt *from)
  {
  	DefineStmt *newnode = makeNode(DefineStmt);
  
*************** _copyDefineStmt(DefineStmt *from)
*** 2750,2756 ****
  }
  
  static DropStmt *
! _copyDropStmt(DropStmt *from)
  {
  	DropStmt   *newnode = makeNode(DropStmt);
  
--- 2750,2756 ----
  }
  
  static DropStmt *
! _copyDropStmt(const DropStmt *from)
  {
  	DropStmt   *newnode = makeNode(DropStmt);
  
*************** _copyDropStmt(DropStmt *from)
*** 2763,2769 ****
  }
  
  static TruncateStmt *
! _copyTruncateStmt(TruncateStmt *from)
  {
  	TruncateStmt *newnode = makeNode(TruncateStmt);
  
--- 2763,2769 ----
  }
  
  static TruncateStmt *
! _copyTruncateStmt(const TruncateStmt *from)
  {
  	TruncateStmt *newnode = makeNode(TruncateStmt);
  
*************** _copyTruncateStmt(TruncateStmt *from)
*** 2775,2781 ****
  }
  
  static CommentStmt *
! _copyCommentStmt(CommentStmt *from)
  {
  	CommentStmt *newnode = makeNode(CommentStmt);
  
--- 2775,2781 ----
  }
  
  static CommentStmt *
! _copyCommentStmt(const CommentStmt *from)
  {
  	CommentStmt *newnode = makeNode(CommentStmt);
  
*************** _copyCommentStmt(CommentStmt *from)
*** 2788,2794 ****
  }
  
  static SecLabelStmt *
! _copySecLabelStmt(SecLabelStmt *from)
  {
  	SecLabelStmt *newnode = makeNode(SecLabelStmt);
  
--- 2788,2794 ----
  }
  
  static SecLabelStmt *
! _copySecLabelStmt(const SecLabelStmt *from)
  {
  	SecLabelStmt *newnode = makeNode(SecLabelStmt);
  
*************** _copySecLabelStmt(SecLabelStmt *from)
*** 2802,2808 ****
  }
  
  static FetchStmt *
! _copyFetchStmt(FetchStmt *from)
  {
  	FetchStmt  *newnode = makeNode(FetchStmt);
  
--- 2802,2808 ----
  }
  
  static FetchStmt *
! _copyFetchStmt(const FetchStmt *from)
  {
  	FetchStmt  *newnode = makeNode(FetchStmt);
  
*************** _copyFetchStmt(FetchStmt *from)
*** 2815,2821 ****
  }
  
  static IndexStmt *
! _copyIndexStmt(IndexStmt *from)
  {
  	IndexStmt  *newnode = makeNode(IndexStmt);
  
--- 2815,2821 ----
  }
  
  static IndexStmt *
! _copyIndexStmt(const IndexStmt *from)
  {
  	IndexStmt  *newnode = makeNode(IndexStmt);
  
*************** _copyIndexStmt(IndexStmt *from)
*** 2840,2846 ****
  }
  
  static CreateFunctionStmt *
! _copyCreateFunctionStmt(CreateFunctionStmt *from)
  {
  	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
  
--- 2840,2846 ----
  }
  
  static CreateFunctionStmt *
! _copyCreateFunctionStmt(const CreateFunctionStmt *from)
  {
  	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
  
*************** _copyCreateFunctionStmt(CreateFunctionSt
*** 2855,2861 ****
  }
  
  static FunctionParameter *
! _copyFunctionParameter(FunctionParameter *from)
  {
  	FunctionParameter *newnode = makeNode(FunctionParameter);
  
--- 2855,2861 ----
  }
  
  static FunctionParameter *
! _copyFunctionParameter(const FunctionParameter *from)
  {
  	FunctionParameter *newnode = makeNode(FunctionParameter);
  
*************** _copyFunctionParameter(FunctionParameter
*** 2868,2874 ****
  }
  
  static AlterFunctionStmt *
! _copyAlterFunctionStmt(AlterFunctionStmt *from)
  {
  	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
  
--- 2868,2874 ----
  }
  
  static AlterFunctionStmt *
! _copyAlterFunctionStmt(const AlterFunctionStmt *from)
  {
  	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
  
*************** _copyAlterFunctionStmt(AlterFunctionStmt
*** 2879,2885 ****
  }
  
  static RemoveFuncStmt *
! _copyRemoveFuncStmt(RemoveFuncStmt *from)
  {
  	RemoveFuncStmt *newnode = makeNode(RemoveFuncStmt);
  
--- 2879,2885 ----
  }
  
  static RemoveFuncStmt *
! _copyRemoveFuncStmt(const RemoveFuncStmt *from)
  {
  	RemoveFuncStmt *newnode = makeNode(RemoveFuncStmt);
  
*************** _copyRemoveFuncStmt(RemoveFuncStmt *from
*** 2893,2899 ****
  }
  
  static DoStmt *
! _copyDoStmt(DoStmt *from)
  {
  	DoStmt	   *newnode = makeNode(DoStmt);
  
--- 2893,2899 ----
  }
  
  static DoStmt *
! _copyDoStmt(const DoStmt *from)
  {
  	DoStmt	   *newnode = makeNode(DoStmt);
  
*************** _copyDoStmt(DoStmt *from)
*** 2903,2909 ****
  }
  
  static RemoveOpClassStmt *
! _copyRemoveOpClassStmt(RemoveOpClassStmt *from)
  {
  	RemoveOpClassStmt *newnode = makeNode(RemoveOpClassStmt);
  
--- 2903,2909 ----
  }
  
  static RemoveOpClassStmt *
! _copyRemoveOpClassStmt(const RemoveOpClassStmt *from)
  {
  	RemoveOpClassStmt *newnode = makeNode(RemoveOpClassStmt);
  
*************** _copyRemoveOpClassStmt(RemoveOpClassStmt
*** 2916,2922 ****
  }
  
  static RemoveOpFamilyStmt *
! _copyRemoveOpFamilyStmt(RemoveOpFamilyStmt *from)
  {
  	RemoveOpFamilyStmt *newnode = makeNode(RemoveOpFamilyStmt);
  
--- 2916,2922 ----
  }
  
  static RemoveOpFamilyStmt *
! _copyRemoveOpFamilyStmt(const RemoveOpFamilyStmt *from)
  {
  	RemoveOpFamilyStmt *newnode = makeNode(RemoveOpFamilyStmt);
  
*************** _copyRemoveOpFamilyStmt(RemoveOpFamilySt
*** 2929,2935 ****
  }
  
  static RenameStmt *
! _copyRenameStmt(RenameStmt *from)
  {
  	RenameStmt *newnode = makeNode(RenameStmt);
  
--- 2929,2935 ----
  }
  
  static RenameStmt *
! _copyRenameStmt(const RenameStmt *from)
  {
  	RenameStmt *newnode = makeNode(RenameStmt);
  
*************** _copyRenameStmt(RenameStmt *from)
*** 2945,2951 ****
  }
  
  static AlterObjectSchemaStmt *
! _copyAlterObjectSchemaStmt(AlterObjectSchemaStmt *from)
  {
  	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
  
--- 2945,2951 ----
  }
  
  static AlterObjectSchemaStmt *
! _copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
  {
  	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
  
*************** _copyAlterObjectSchemaStmt(AlterObjectSc
*** 2960,2966 ****
  }
  
  static AlterOwnerStmt *
! _copyAlterOwnerStmt(AlterOwnerStmt *from)
  {
  	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
  
--- 2960,2966 ----
  }
  
  static AlterOwnerStmt *
! _copyAlterOwnerStmt(const AlterOwnerStmt *from)
  {
  	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
  
*************** _copyAlterOwnerStmt(AlterOwnerStmt *from
*** 2975,2981 ****
  }
  
  static RuleStmt *
! _copyRuleStmt(RuleStmt *from)
  {
  	RuleStmt   *newnode = makeNode(RuleStmt);
  
--- 2975,2981 ----
  }
  
  static RuleStmt *
! _copyRuleStmt(const RuleStmt *from)
  {
  	RuleStmt   *newnode = makeNode(RuleStmt);
  
*************** _copyRuleStmt(RuleStmt *from)
*** 2991,2997 ****
  }
  
  static NotifyStmt *
! _copyNotifyStmt(NotifyStmt *from)
  {
  	NotifyStmt *newnode = makeNode(NotifyStmt);
  
--- 2991,2997 ----
  }
  
  static NotifyStmt *
! _copyNotifyStmt(const NotifyStmt *from)
  {
  	NotifyStmt *newnode = makeNode(NotifyStmt);
  
*************** _copyNotifyStmt(NotifyStmt *from)
*** 3002,3008 ****
  }
  
  static ListenStmt *
! _copyListenStmt(ListenStmt *from)
  {
  	ListenStmt *newnode = makeNode(ListenStmt);
  
--- 3002,3008 ----
  }
  
  static ListenStmt *
! _copyListenStmt(const ListenStmt *from)
  {
  	ListenStmt *newnode = makeNode(ListenStmt);
  
*************** _copyListenStmt(ListenStmt *from)
*** 3012,3018 ****
  }
  
  static UnlistenStmt *
! _copyUnlistenStmt(UnlistenStmt *from)
  {
  	UnlistenStmt *newnode = makeNode(UnlistenStmt);
  
--- 3012,3018 ----
  }
  
  static UnlistenStmt *
! _copyUnlistenStmt(const UnlistenStmt *from)
  {
  	UnlistenStmt *newnode = makeNode(UnlistenStmt);
  
*************** _copyUnlistenStmt(UnlistenStmt *from)
*** 3022,3028 ****
  }
  
  static TransactionStmt *
! _copyTransactionStmt(TransactionStmt *from)
  {
  	TransactionStmt *newnode = makeNode(TransactionStmt);
  
--- 3022,3028 ----
  }
  
  static TransactionStmt *
! _copyTransactionStmt(const TransactionStmt *from)
  {
  	TransactionStmt *newnode = makeNode(TransactionStmt);
  
*************** _copyTransactionStmt(TransactionStmt *fr
*** 3034,3040 ****
  }
  
  static CompositeTypeStmt *
! _copyCompositeTypeStmt(CompositeTypeStmt *from)
  {
  	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
  
--- 3034,3040 ----
  }
  
  static CompositeTypeStmt *
! _copyCompositeTypeStmt(const CompositeTypeStmt *from)
  {
  	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
  
*************** _copyCompositeTypeStmt(CompositeTypeStmt
*** 3045,3051 ****
  }
  
  static CreateEnumStmt *
! _copyCreateEnumStmt(CreateEnumStmt *from)
  {
  	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
  
--- 3045,3051 ----
  }
  
  static CreateEnumStmt *
! _copyCreateEnumStmt(const CreateEnumStmt *from)
  {
  	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
  
*************** _copyCreateEnumStmt(CreateEnumStmt *from
*** 3056,3062 ****
  }
  
  static CreateRangeStmt *
! _copyCreateRangeStmt(CreateRangeStmt *from)
  {
  	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
  
--- 3056,3062 ----
  }
  
  static CreateRangeStmt *
! _copyCreateRangeStmt(const CreateRangeStmt *from)
  {
  	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
  
*************** _copyCreateRangeStmt(CreateRangeStmt *fr
*** 3067,3073 ****
  }
  
  static AlterEnumStmt *
! _copyAlterEnumStmt(AlterEnumStmt *from)
  {
  	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
  
--- 3067,3073 ----
  }
  
  static AlterEnumStmt *
! _copyAlterEnumStmt(const AlterEnumStmt *from)
  {
  	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
  
*************** _copyAlterEnumStmt(AlterEnumStmt *from)
*** 3080,3086 ****
  }
  
  static ViewStmt *
! _copyViewStmt(ViewStmt *from)
  {
  	ViewStmt   *newnode = makeNode(ViewStmt);
  
--- 3080,3086 ----
  }
  
  static ViewStmt *
! _copyViewStmt(const ViewStmt *from)
  {
  	ViewStmt   *newnode = makeNode(ViewStmt);
  
*************** _copyViewStmt(ViewStmt *from)
*** 3093,3099 ****
  }
  
  static LoadStmt *
! _copyLoadStmt(LoadStmt *from)
  {
  	LoadStmt   *newnode = makeNode(LoadStmt);
  
--- 3093,3099 ----
  }
  
  static LoadStmt *
! _copyLoadStmt(const LoadStmt *from)
  {
  	LoadStmt   *newnode = makeNode(LoadStmt);
  
*************** _copyLoadStmt(LoadStmt *from)
*** 3103,3109 ****
  }
  
  static CreateDomainStmt *
! _copyCreateDomainStmt(CreateDomainStmt *from)
  {
  	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
  
--- 3103,3109 ----
  }
  
  static CreateDomainStmt *
! _copyCreateDomainStmt(const CreateDomainStmt *from)
  {
  	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
  
*************** _copyCreateDomainStmt(CreateDomainStmt *
*** 3116,3122 ****
  }
  
  static CreateOpClassStmt *
! _copyCreateOpClassStmt(CreateOpClassStmt *from)
  {
  	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
  
--- 3116,3122 ----
  }
  
  static CreateOpClassStmt *
! _copyCreateOpClassStmt(const CreateOpClassStmt *from)
  {
  	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
  
*************** _copyCreateOpClassStmt(CreateOpClassStmt
*** 3131,3137 ****
  }
  
  static CreateOpClassItem *
! _copyCreateOpClassItem(CreateOpClassItem *from)
  {
  	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
  
--- 3131,3137 ----
  }
  
  static CreateOpClassItem *
! _copyCreateOpClassItem(const CreateOpClassItem *from)
  {
  	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
  
*************** _copyCreateOpClassItem(CreateOpClassItem
*** 3147,3153 ****
  }
  
  static CreateOpFamilyStmt *
! _copyCreateOpFamilyStmt(CreateOpFamilyStmt *from)
  {
  	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
  
--- 3147,3153 ----
  }
  
  static CreateOpFamilyStmt *
! _copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
  {
  	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
  
*************** _copyCreateOpFamilyStmt(CreateOpFamilySt
*** 3158,3164 ****
  }
  
  static AlterOpFamilyStmt *
! _copyAlterOpFamilyStmt(AlterOpFamilyStmt *from)
  {
  	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
  
--- 3158,3164 ----
  }
  
  static AlterOpFamilyStmt *
! _copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
  {
  	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
  
*************** _copyAlterOpFamilyStmt(AlterOpFamilyStmt
*** 3171,3177 ****
  }
  
  static CreatedbStmt *
! _copyCreatedbStmt(CreatedbStmt *from)
  {
  	CreatedbStmt *newnode = makeNode(CreatedbStmt);
  
--- 3171,3177 ----
  }
  
  static CreatedbStmt *
! _copyCreatedbStmt(const CreatedbStmt *from)
  {
  	CreatedbStmt *newnode = makeNode(CreatedbStmt);
  
*************** _copyCreatedbStmt(CreatedbStmt *from)
*** 3182,3188 ****
  }
  
  static AlterDatabaseStmt *
! _copyAlterDatabaseStmt(AlterDatabaseStmt *from)
  {
  	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
  
--- 3182,3188 ----
  }
  
  static AlterDatabaseStmt *
! _copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
  {
  	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
  
*************** _copyAlterDatabaseStmt(AlterDatabaseStmt
*** 3193,3199 ****
  }
  
  static AlterDatabaseSetStmt *
! _copyAlterDatabaseSetStmt(AlterDatabaseSetStmt *from)
  {
  	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
  
--- 3193,3199 ----
  }
  
  static AlterDatabaseSetStmt *
! _copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
  {
  	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
  
*************** _copyAlterDatabaseSetStmt(AlterDatabaseS
*** 3204,3210 ****
  }
  
  static DropdbStmt *
! _copyDropdbStmt(DropdbStmt *from)
  {
  	DropdbStmt *newnode = makeNode(DropdbStmt);
  
--- 3204,3210 ----
  }
  
  static DropdbStmt *
! _copyDropdbStmt(const DropdbStmt *from)
  {
  	DropdbStmt *newnode = makeNode(DropdbStmt);
  
*************** _copyDropdbStmt(DropdbStmt *from)
*** 3215,3221 ****
  }
  
  static VacuumStmt *
! _copyVacuumStmt(VacuumStmt *from)
  {
  	VacuumStmt *newnode = makeNode(VacuumStmt);
  
--- 3215,3221 ----
  }
  
  static VacuumStmt *
! _copyVacuumStmt(const VacuumStmt *from)
  {
  	VacuumStmt *newnode = makeNode(VacuumStmt);
  
*************** _copyVacuumStmt(VacuumStmt *from)
*** 3229,3235 ****
  }
  
  static ExplainStmt *
! _copyExplainStmt(ExplainStmt *from)
  {
  	ExplainStmt *newnode = makeNode(ExplainStmt);
  
--- 3229,3235 ----
  }
  
  static ExplainStmt *
! _copyExplainStmt(const ExplainStmt *from)
  {
  	ExplainStmt *newnode = makeNode(ExplainStmt);
  
*************** _copyExplainStmt(ExplainStmt *from)
*** 3240,3246 ****
  }
  
  static CreateSeqStmt *
! _copyCreateSeqStmt(CreateSeqStmt *from)
  {
  	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
  
--- 3240,3246 ----
  }
  
  static CreateSeqStmt *
! _copyCreateSeqStmt(const CreateSeqStmt *from)
  {
  	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
  
*************** _copyCreateSeqStmt(CreateSeqStmt *from)
*** 3252,3258 ****
  }
  
  static AlterSeqStmt *
! _copyAlterSeqStmt(AlterSeqStmt *from)
  {
  	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
  
--- 3252,3258 ----
  }
  
  static AlterSeqStmt *
! _copyAlterSeqStmt(const AlterSeqStmt *from)
  {
  	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
  
*************** _copyAlterSeqStmt(AlterSeqStmt *from)
*** 3263,3269 ****
  }
  
  static VariableSetStmt *
! _copyVariableSetStmt(VariableSetStmt *from)
  {
  	VariableSetStmt *newnode = makeNode(VariableSetStmt);
  
--- 3263,3269 ----
  }
  
  static VariableSetStmt *
! _copyVariableSetStmt(const VariableSetStmt *from)
  {
  	VariableSetStmt *newnode = makeNode(VariableSetStmt);
  
*************** _copyVariableSetStmt(VariableSetStmt *fr
*** 3276,3282 ****
  }
  
  static VariableShowStmt *
! _copyVariableShowStmt(VariableShowStmt *from)
  {
  	VariableShowStmt *newnode = makeNode(VariableShowStmt);
  
--- 3276,3282 ----
  }
  
  static VariableShowStmt *
! _copyVariableShowStmt(const VariableShowStmt *from)
  {
  	VariableShowStmt *newnode = makeNode(VariableShowStmt);
  
*************** _copyVariableShowStmt(VariableShowStmt *
*** 3286,3292 ****
  }
  
  static DiscardStmt *
! _copyDiscardStmt(DiscardStmt *from)
  {
  	DiscardStmt *newnode = makeNode(DiscardStmt);
  
--- 3286,3292 ----
  }
  
  static DiscardStmt *
! _copyDiscardStmt(const DiscardStmt *from)
  {
  	DiscardStmt *newnode = makeNode(DiscardStmt);
  
*************** _copyDiscardStmt(DiscardStmt *from)
*** 3296,3302 ****
  }
  
  static CreateTableSpaceStmt *
! _copyCreateTableSpaceStmt(CreateTableSpaceStmt *from)
  {
  	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
  
--- 3296,3302 ----
  }
  
  static CreateTableSpaceStmt *
! _copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
  {
  	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
  
*************** _copyCreateTableSpaceStmt(CreateTableSpa
*** 3308,3314 ****
  }
  
  static DropTableSpaceStmt *
! _copyDropTableSpaceStmt(DropTableSpaceStmt *from)
  {
  	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
  
--- 3308,3314 ----
  }
  
  static DropTableSpaceStmt *
! _copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
  {
  	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
  
*************** _copyDropTableSpaceStmt(DropTableSpaceSt
*** 3319,3325 ****
  }
  
  static AlterTableSpaceOptionsStmt *
! _copyAlterTableSpaceOptionsStmt(AlterTableSpaceOptionsStmt *from)
  {
  	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
  
--- 3319,3325 ----
  }
  
  static AlterTableSpaceOptionsStmt *
! _copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
  {
  	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
  
*************** _copyAlterTableSpaceOptionsStmt(AlterTab
*** 3331,3337 ****
  }
  
  static CreateExtensionStmt *
! _copyCreateExtensionStmt(CreateExtensionStmt *from)
  {
  	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
  
--- 3331,3337 ----
  }
  
  static CreateExtensionStmt *
! _copyCreateExtensionStmt(const CreateExtensionStmt *from)
  {
  	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
  
*************** _copyCreateExtensionStmt(CreateExtension
*** 3343,3349 ****
  }
  
  static AlterExtensionStmt *
! _copyAlterExtensionStmt(AlterExtensionStmt *from)
  {
  	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
  
--- 3343,3349 ----
  }
  
  static AlterExtensionStmt *
! _copyAlterExtensionStmt(const AlterExtensionStmt *from)
  {
  	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
  
*************** _copyAlterExtensionStmt(AlterExtensionSt
*** 3354,3360 ****
  }
  
  static AlterExtensionContentsStmt *
! _copyAlterExtensionContentsStmt(AlterExtensionContentsStmt *from)
  {
  	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
  
--- 3354,3360 ----
  }
  
  static AlterExtensionContentsStmt *
! _copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
  {
  	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
  
*************** _copyAlterExtensionContentsStmt(AlterExt
*** 3368,3374 ****
  }
  
  static CreateFdwStmt *
! _copyCreateFdwStmt(CreateFdwStmt *from)
  {
  	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
  
--- 3368,3374 ----
  }
  
  static CreateFdwStmt *
! _copyCreateFdwStmt(const CreateFdwStmt *from)
  {
  	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
  
*************** _copyCreateFdwStmt(CreateFdwStmt *from)
*** 3380,3386 ****
  }
  
  static AlterFdwStmt *
! _copyAlterFdwStmt(AlterFdwStmt *from)
  {
  	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
  
--- 3380,3386 ----
  }
  
  static AlterFdwStmt *
! _copyAlterFdwStmt(const AlterFdwStmt *from)
  {
  	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
  
*************** _copyAlterFdwStmt(AlterFdwStmt *from)
*** 3392,3398 ****
  }
  
  static DropFdwStmt *
! _copyDropFdwStmt(DropFdwStmt *from)
  {
  	DropFdwStmt *newnode = makeNode(DropFdwStmt);
  
--- 3392,3398 ----
  }
  
  static DropFdwStmt *
! _copyDropFdwStmt(const DropFdwStmt *from)
  {
  	DropFdwStmt *newnode = makeNode(DropFdwStmt);
  
*************** _copyDropFdwStmt(DropFdwStmt *from)
*** 3404,3410 ****
  }
  
  static CreateForeignServerStmt *
! _copyCreateForeignServerStmt(CreateForeignServerStmt *from)
  {
  	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
  
--- 3404,3410 ----
  }
  
  static CreateForeignServerStmt *
! _copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
  {
  	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
  
*************** _copyCreateForeignServerStmt(CreateForei
*** 3418,3424 ****
  }
  
  static AlterForeignServerStmt *
! _copyAlterForeignServerStmt(AlterForeignServerStmt *from)
  {
  	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
  
--- 3418,3424 ----
  }
  
  static AlterForeignServerStmt *
! _copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
  {
  	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
  
*************** _copyAlterForeignServerStmt(AlterForeign
*** 3431,3437 ****
  }
  
  static DropForeignServerStmt *
! _copyDropForeignServerStmt(DropForeignServerStmt *from)
  {
  	DropForeignServerStmt *newnode = makeNode(DropForeignServerStmt);
  
--- 3431,3437 ----
  }
  
  static DropForeignServerStmt *
! _copyDropForeignServerStmt(const DropForeignServerStmt *from)
  {
  	DropForeignServerStmt *newnode = makeNode(DropForeignServerStmt);
  
*************** _copyDropForeignServerStmt(DropForeignSe
*** 3443,3449 ****
  }
  
  static CreateUserMappingStmt *
! _copyCreateUserMappingStmt(CreateUserMappingStmt *from)
  {
  	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
  
--- 3443,3449 ----
  }
  
  static CreateUserMappingStmt *
! _copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
  {
  	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
  
*************** _copyCreateUserMappingStmt(CreateUserMap
*** 3455,3461 ****
  }
  
  static AlterUserMappingStmt *
! _copyAlterUserMappingStmt(AlterUserMappingStmt *from)
  {
  	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
  
--- 3455,3461 ----
  }
  
  static AlterUserMappingStmt *
! _copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
  {
  	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
  
*************** _copyAlterUserMappingStmt(AlterUserMappi
*** 3467,3473 ****
  }
  
  static DropUserMappingStmt *
! _copyDropUserMappingStmt(DropUserMappingStmt *from)
  {
  	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
  
--- 3467,3473 ----
  }
  
  static DropUserMappingStmt *
! _copyDropUserMappingStmt(const DropUserMappingStmt *from)
  {
  	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
  
*************** _copyDropUserMappingStmt(DropUserMapping
*** 3479,3489 ****
  }
  
  static CreateForeignTableStmt *
! _copyCreateForeignTableStmt(CreateForeignTableStmt *from)
  {
  	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
  
! 	CopyCreateStmtFields((CreateStmt *) from, (CreateStmt *) newnode);
  
  	COPY_STRING_FIELD(servername);
  	COPY_NODE_FIELD(options);
--- 3479,3489 ----
  }
  
  static CreateForeignTableStmt *
! _copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
  {
  	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
  
! 	CopyCreateStmtFields((const CreateStmt *) from, (CreateStmt *) newnode);
  
  	COPY_STRING_FIELD(servername);
  	COPY_NODE_FIELD(options);
*************** _copyCreateForeignTableStmt(CreateForeig
*** 3492,3498 ****
  }
  
  static CreateTrigStmt *
! _copyCreateTrigStmt(CreateTrigStmt *from)
  {
  	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
  
--- 3492,3498 ----
  }
  
  static CreateTrigStmt *
! _copyCreateTrigStmt(const CreateTrigStmt *from)
  {
  	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
  
*************** _copyCreateTrigStmt(CreateTrigStmt *from
*** 3514,3520 ****
  }
  
  static DropPropertyStmt *
! _copyDropPropertyStmt(DropPropertyStmt *from)
  {
  	DropPropertyStmt *newnode = makeNode(DropPropertyStmt);
  
--- 3514,3520 ----
  }
  
  static DropPropertyStmt *
! _copyDropPropertyStmt(const DropPropertyStmt *from)
  {
  	DropPropertyStmt *newnode = makeNode(DropPropertyStmt);
  
*************** _copyDropPropertyStmt(DropPropertyStmt *
*** 3528,3534 ****
  }
  
  static CreatePLangStmt *
! _copyCreatePLangStmt(CreatePLangStmt *from)
  {
  	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
  
--- 3528,3534 ----
  }
  
  static CreatePLangStmt *
! _copyCreatePLangStmt(const CreatePLangStmt *from)
  {
  	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
  
*************** _copyCreatePLangStmt(CreatePLangStmt *fr
*** 3543,3549 ****
  }
  
  static DropPLangStmt *
! _copyDropPLangStmt(DropPLangStmt *from)
  {
  	DropPLangStmt *newnode = makeNode(DropPLangStmt);
  
--- 3543,3549 ----
  }
  
  static DropPLangStmt *
! _copyDropPLangStmt(const DropPLangStmt *from)
  {
  	DropPLangStmt *newnode = makeNode(DropPLangStmt);
  
*************** _copyDropPLangStmt(DropPLangStmt *from)
*** 3555,3561 ****
  }
  
  static CreateRoleStmt *
! _copyCreateRoleStmt(CreateRoleStmt *from)
  {
  	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
  
--- 3555,3561 ----
  }
  
  static CreateRoleStmt *
! _copyCreateRoleStmt(const CreateRoleStmt *from)
  {
  	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
  
*************** _copyCreateRoleStmt(CreateRoleStmt *from
*** 3567,3573 ****
  }
  
  static AlterRoleStmt *
! _copyAlterRoleStmt(AlterRoleStmt *from)
  {
  	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
  
--- 3567,3573 ----
  }
  
  static AlterRoleStmt *
! _copyAlterRoleStmt(const AlterRoleStmt *from)
  {
  	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
  
*************** _copyAlterRoleStmt(AlterRoleStmt *from)
*** 3579,3585 ****
  }
  
  static AlterRoleSetStmt *
! _copyAlterRoleSetStmt(AlterRoleSetStmt *from)
  {
  	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
  
--- 3579,3585 ----
  }
  
  static AlterRoleSetStmt *
! _copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
  {
  	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
  
*************** _copyAlterRoleSetStmt(AlterRoleSetStmt *
*** 3591,3597 ****
  }
  
  static DropRoleStmt *
! _copyDropRoleStmt(DropRoleStmt *from)
  {
  	DropRoleStmt *newnode = makeNode(DropRoleStmt);
  
--- 3591,3597 ----
  }
  
  static DropRoleStmt *
! _copyDropRoleStmt(const DropRoleStmt *from)
  {
  	DropRoleStmt *newnode = makeNode(DropRoleStmt);
  
*************** _copyDropRoleStmt(DropRoleStmt *from)
*** 3602,3608 ****
  }
  
  static LockStmt *
! _copyLockStmt(LockStmt *from)
  {
  	LockStmt   *newnode = makeNode(LockStmt);
  
--- 3602,3608 ----
  }
  
  static LockStmt *
! _copyLockStmt(const LockStmt *from)
  {
  	LockStmt   *newnode = makeNode(LockStmt);
  
*************** _copyLockStmt(LockStmt *from)
*** 3614,3620 ****
  }
  
  static ConstraintsSetStmt *
! _copyConstraintsSetStmt(ConstraintsSetStmt *from)
  {
  	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
  
--- 3614,3620 ----
  }
  
  static ConstraintsSetStmt *
! _copyConstraintsSetStmt(const ConstraintsSetStmt *from)
  {
  	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
  
*************** _copyConstraintsSetStmt(ConstraintsSetSt
*** 3625,3631 ****
  }
  
  static ReindexStmt *
! _copyReindexStmt(ReindexStmt *from)
  {
  	ReindexStmt *newnode = makeNode(ReindexStmt);
  
--- 3625,3631 ----
  }
  
  static ReindexStmt *
! _copyReindexStmt(const ReindexStmt *from)
  {
  	ReindexStmt *newnode = makeNode(ReindexStmt);
  
*************** _copyReindexStmt(ReindexStmt *from)
*** 3639,3645 ****
  }
  
  static CreateSchemaStmt *
! _copyCreateSchemaStmt(CreateSchemaStmt *from)
  {
  	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
  
--- 3639,3645 ----
  }
  
  static CreateSchemaStmt *
! _copyCreateSchemaStmt(const CreateSchemaStmt *from)
  {
  	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
  
*************** _copyCreateSchemaStmt(CreateSchemaStmt *
*** 3651,3657 ****
  }
  
  static CreateConversionStmt *
! _copyCreateConversionStmt(CreateConversionStmt *from)
  {
  	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
  
--- 3651,3657 ----
  }
  
  static CreateConversionStmt *
! _copyCreateConversionStmt(const CreateConversionStmt *from)
  {
  	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
  
*************** _copyCreateConversionStmt(CreateConversi
*** 3665,3671 ****
  }
  
  static CreateCastStmt *
! _copyCreateCastStmt(CreateCastStmt *from)
  {
  	CreateCastStmt *newnode = makeNode(CreateCastStmt);
  
--- 3665,3671 ----
  }
  
  static CreateCastStmt *
! _copyCreateCastStmt(const CreateCastStmt *from)
  {
  	CreateCastStmt *newnode = makeNode(CreateCastStmt);
  
*************** _copyCreateCastStmt(CreateCastStmt *from
*** 3679,3685 ****
  }
  
  static DropCastStmt *
! _copyDropCastStmt(DropCastStmt *from)
  {
  	DropCastStmt *newnode = makeNode(DropCastStmt);
  
--- 3679,3685 ----
  }
  
  static DropCastStmt *
! _copyDropCastStmt(const DropCastStmt *from)
  {
  	DropCastStmt *newnode = makeNode(DropCastStmt);
  
*************** _copyDropCastStmt(DropCastStmt *from)
*** 3692,3698 ****
  }
  
  static PrepareStmt *
! _copyPrepareStmt(PrepareStmt *from)
  {
  	PrepareStmt *newnode = makeNode(PrepareStmt);
  
--- 3692,3698 ----
  }
  
  static PrepareStmt *
! _copyPrepareStmt(const PrepareStmt *from)
  {
  	PrepareStmt *newnode = makeNode(PrepareStmt);
  
*************** _copyPrepareStmt(PrepareStmt *from)
*** 3704,3710 ****
  }
  
  static ExecuteStmt *
! _copyExecuteStmt(ExecuteStmt *from)
  {
  	ExecuteStmt *newnode = makeNode(ExecuteStmt);
  
--- 3704,3710 ----
  }
  
  static ExecuteStmt *
! _copyExecuteStmt(const ExecuteStmt *from)
  {
  	ExecuteStmt *newnode = makeNode(ExecuteStmt);
  
*************** _copyExecuteStmt(ExecuteStmt *from)
*** 3716,3722 ****
  }
  
  static DeallocateStmt *
! _copyDeallocateStmt(DeallocateStmt *from)
  {
  	DeallocateStmt *newnode = makeNode(DeallocateStmt);
  
--- 3716,3722 ----
  }
  
  static DeallocateStmt *
! _copyDeallocateStmt(const DeallocateStmt *from)
  {
  	DeallocateStmt *newnode = makeNode(DeallocateStmt);
  
*************** _copyDeallocateStmt(DeallocateStmt *from
*** 3726,3732 ****
  }
  
  static DropOwnedStmt *
! _copyDropOwnedStmt(DropOwnedStmt *from)
  {
  	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
  
--- 3726,3732 ----
  }
  
  static DropOwnedStmt *
! _copyDropOwnedStmt(const DropOwnedStmt *from)
  {
  	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
  
*************** _copyDropOwnedStmt(DropOwnedStmt *from)
*** 3737,3743 ****
  }
  
  static ReassignOwnedStmt *
! _copyReassignOwnedStmt(ReassignOwnedStmt *from)
  {
  	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
  
--- 3737,3743 ----
  }
  
  static ReassignOwnedStmt *
! _copyReassignOwnedStmt(const ReassignOwnedStmt *from)
  {
  	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
  
*************** _copyReassignOwnedStmt(ReassignOwnedStmt
*** 3748,3754 ****
  }
  
  static AlterTSDictionaryStmt *
! _copyAlterTSDictionaryStmt(AlterTSDictionaryStmt *from)
  {
  	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
  
--- 3748,3754 ----
  }
  
  static AlterTSDictionaryStmt *
! _copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
  {
  	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
  
*************** _copyAlterTSDictionaryStmt(AlterTSDictio
*** 3759,3765 ****
  }
  
  static AlterTSConfigurationStmt *
! _copyAlterTSConfigurationStmt(AlterTSConfigurationStmt *from)
  {
  	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
  
--- 3759,3765 ----
  }
  
  static AlterTSConfigurationStmt *
! _copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
  {
  	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
  
*************** _copyAlterTSConfigurationStmt(AlterTSCon
*** 3788,3794 ****
  	lfirst(new) = copyObject(lfirst(old));
  
  static List *
! _copyList(List *from)
  {
  	List	   *new;
  	ListCell   *curr_old;
--- 3788,3794 ----
  	lfirst(new) = copyObject(lfirst(old));
  
  static List *
! _copyList(const List *from)
  {
  	List	   *new;
  	ListCell   *curr_old;
*************** _copyList(List *from)
*** 3820,3826 ****
   * ****************************************************************
   */
  static Value *
! _copyValue(Value *from)
  {
  	Value	   *newnode = makeNode(Value);
  
--- 3820,3826 ----
   * ****************************************************************
   */
  static Value *
! _copyValue(const Value *from)
  {
  	Value	   *newnode = makeNode(Value);
  
*************** _copyValue(Value *from)
*** 3855,3861 ****
   * substructure is copied too, recursively.
   */
  void *
! copyObject(void *from)
  {
  	void	   *retval;
  
--- 3855,3861 ----
   * substructure is copied too, recursively.
   */
  void *
! copyObject(const void *from)
  {
  	void	   *retval;
  
*************** copyObject(void *from)
*** 4585,4591 ****
  
  		default:
  			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(from));
! 			retval = from;		/* keep compiler quiet */
  			break;
  	}
  
--- 4585,4591 ----
  
  		default:
  			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(from));
! 			retval = 0;		/* keep compiler quiet */
  			break;
  	}
  
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c
new file mode 100644
index f3a34a1..f08df34
*** a/src/backend/nodes/equalfuncs.c
--- b/src/backend/nodes/equalfuncs.c
***************
*** 89,95 ****
   */
  
  static bool
! _equalAlias(Alias *a, Alias *b)
  {
  	COMPARE_STRING_FIELD(aliasname);
  	COMPARE_NODE_FIELD(colnames);
--- 89,95 ----
   */
  
  static bool
! _equalAlias(const Alias *a, const Alias *b)
  {
  	COMPARE_STRING_FIELD(aliasname);
  	COMPARE_NODE_FIELD(colnames);
*************** _equalAlias(Alias *a, Alias *b)
*** 98,104 ****
  }
  
  static bool
! _equalRangeVar(RangeVar *a, RangeVar *b)
  {
  	COMPARE_STRING_FIELD(catalogname);
  	COMPARE_STRING_FIELD(schemaname);
--- 98,104 ----
  }
  
  static bool
! _equalRangeVar(const RangeVar *a, const RangeVar *b)
  {
  	COMPARE_STRING_FIELD(catalogname);
  	COMPARE_STRING_FIELD(schemaname);
*************** _equalRangeVar(RangeVar *a, RangeVar *b)
*** 112,118 ****
  }
  
  static bool
! _equalIntoClause(IntoClause *a, IntoClause *b)
  {
  	COMPARE_NODE_FIELD(rel);
  	COMPARE_NODE_FIELD(colNames);
--- 112,118 ----
  }
  
  static bool
! _equalIntoClause(const IntoClause *a, const IntoClause *b)
  {
  	COMPARE_NODE_FIELD(rel);
  	COMPARE_NODE_FIELD(colNames);
*************** _equalIntoClause(IntoClause *a, IntoClau
*** 131,137 ****
   */
  
  static bool
! _equalVar(Var *a, Var *b)
  {
  	COMPARE_SCALAR_FIELD(varno);
  	COMPARE_SCALAR_FIELD(varattno);
--- 131,137 ----
   */
  
  static bool
! _equalVar(const Var *a, const Var *b)
  {
  	COMPARE_SCALAR_FIELD(varno);
  	COMPARE_SCALAR_FIELD(varattno);
*************** _equalVar(Var *a, Var *b)
*** 147,153 ****
  }
  
  static bool
! _equalConst(Const *a, Const *b)
  {
  	COMPARE_SCALAR_FIELD(consttype);
  	COMPARE_SCALAR_FIELD(consttypmod);
--- 147,153 ----
  }
  
  static bool
! _equalConst(const Const *a, const Const *b)
  {
  	COMPARE_SCALAR_FIELD(consttype);
  	COMPARE_SCALAR_FIELD(consttypmod);
*************** _equalConst(Const *a, Const *b)
*** 168,174 ****
  }
  
  static bool
! _equalParam(Param *a, Param *b)
  {
  	COMPARE_SCALAR_FIELD(paramkind);
  	COMPARE_SCALAR_FIELD(paramid);
--- 168,174 ----
  }
  
  static bool
! _equalParam(const Param *a, const Param *b)
  {
  	COMPARE_SCALAR_FIELD(paramkind);
  	COMPARE_SCALAR_FIELD(paramid);
*************** _equalParam(Param *a, Param *b)
*** 181,187 ****
  }
  
  static bool
! _equalAggref(Aggref *a, Aggref *b)
  {
  	COMPARE_SCALAR_FIELD(aggfnoid);
  	COMPARE_SCALAR_FIELD(aggtype);
--- 181,187 ----
  }
  
  static bool
! _equalAggref(const Aggref *a, const Aggref *b)
  {
  	COMPARE_SCALAR_FIELD(aggfnoid);
  	COMPARE_SCALAR_FIELD(aggtype);
*************** _equalAggref(Aggref *a, Aggref *b)
*** 198,204 ****
  }
  
  static bool
! _equalWindowFunc(WindowFunc *a, WindowFunc *b)
  {
  	COMPARE_SCALAR_FIELD(winfnoid);
  	COMPARE_SCALAR_FIELD(wintype);
--- 198,204 ----
  }
  
  static bool
! _equalWindowFunc(const WindowFunc *a, const WindowFunc *b)
  {
  	COMPARE_SCALAR_FIELD(winfnoid);
  	COMPARE_SCALAR_FIELD(wintype);
*************** _equalWindowFunc(WindowFunc *a, WindowFu
*** 214,220 ****
  }
  
  static bool
! _equalArrayRef(ArrayRef *a, ArrayRef *b)
  {
  	COMPARE_SCALAR_FIELD(refarraytype);
  	COMPARE_SCALAR_FIELD(refelemtype);
--- 214,220 ----
  }
  
  static bool
! _equalArrayRef(const ArrayRef *a, const ArrayRef *b)
  {
  	COMPARE_SCALAR_FIELD(refarraytype);
  	COMPARE_SCALAR_FIELD(refelemtype);
*************** _equalArrayRef(ArrayRef *a, ArrayRef *b)
*** 229,235 ****
  }
  
  static bool
! _equalFuncExpr(FuncExpr *a, FuncExpr *b)
  {
  	COMPARE_SCALAR_FIELD(funcid);
  	COMPARE_SCALAR_FIELD(funcresulttype);
--- 229,235 ----
  }
  
  static bool
! _equalFuncExpr(const FuncExpr *a, const FuncExpr *b)
  {
  	COMPARE_SCALAR_FIELD(funcid);
  	COMPARE_SCALAR_FIELD(funcresulttype);
*************** _equalFuncExpr(FuncExpr *a, FuncExpr *b)
*** 253,259 ****
  }
  
  static bool
! _equalNamedArgExpr(NamedArgExpr *a, NamedArgExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_STRING_FIELD(name);
--- 253,259 ----
  }
  
  static bool
! _equalNamedArgExpr(const NamedArgExpr *a, const NamedArgExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_STRING_FIELD(name);
*************** _equalNamedArgExpr(NamedArgExpr *a, Name
*** 264,270 ****
  }
  
  static bool
! _equalOpExpr(OpExpr *a, OpExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
--- 264,270 ----
  }
  
  static bool
! _equalOpExpr(const OpExpr *a, const OpExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
*************** _equalOpExpr(OpExpr *a, OpExpr *b)
*** 290,296 ****
  }
  
  static bool
! _equalDistinctExpr(DistinctExpr *a, DistinctExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
--- 290,296 ----
  }
  
  static bool
! _equalDistinctExpr(const DistinctExpr *a, const DistinctExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
*************** _equalDistinctExpr(DistinctExpr *a, Dist
*** 316,322 ****
  }
  
  static bool
! _equalNullIfExpr(NullIfExpr *a, NullIfExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
--- 316,322 ----
  }
  
  static bool
! _equalNullIfExpr(const NullIfExpr *a, const NullIfExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
*************** _equalNullIfExpr(NullIfExpr *a, NullIfEx
*** 342,348 ****
  }
  
  static bool
! _equalScalarArrayOpExpr(ScalarArrayOpExpr *a, ScalarArrayOpExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
--- 342,348 ----
  }
  
  static bool
! _equalScalarArrayOpExpr(const ScalarArrayOpExpr *a, const ScalarArrayOpExpr *b)
  {
  	COMPARE_SCALAR_FIELD(opno);
  
*************** _equalScalarArrayOpExpr(ScalarArrayOpExp
*** 366,372 ****
  }
  
  static bool
! _equalBoolExpr(BoolExpr *a, BoolExpr *b)
  {
  	COMPARE_SCALAR_FIELD(boolop);
  	COMPARE_NODE_FIELD(args);
--- 366,372 ----
  }
  
  static bool
! _equalBoolExpr(const BoolExpr *a, const BoolExpr *b)
  {
  	COMPARE_SCALAR_FIELD(boolop);
  	COMPARE_NODE_FIELD(args);
*************** _equalBoolExpr(BoolExpr *a, BoolExpr *b)
*** 376,382 ****
  }
  
  static bool
! _equalSubLink(SubLink *a, SubLink *b)
  {
  	COMPARE_SCALAR_FIELD(subLinkType);
  	COMPARE_NODE_FIELD(testexpr);
--- 376,382 ----
  }
  
  static bool
! _equalSubLink(const SubLink *a, const SubLink *b)
  {
  	COMPARE_SCALAR_FIELD(subLinkType);
  	COMPARE_NODE_FIELD(testexpr);
*************** _equalSubLink(SubLink *a, SubLink *b)
*** 388,394 ****
  }
  
  static bool
! _equalSubPlan(SubPlan *a, SubPlan *b)
  {
  	COMPARE_SCALAR_FIELD(subLinkType);
  	COMPARE_NODE_FIELD(testexpr);
--- 388,394 ----
  }
  
  static bool
! _equalSubPlan(const SubPlan *a, const SubPlan *b)
  {
  	COMPARE_SCALAR_FIELD(subLinkType);
  	COMPARE_NODE_FIELD(testexpr);
*************** _equalSubPlan(SubPlan *a, SubPlan *b)
*** 410,416 ****
  }
  
  static bool
! _equalAlternativeSubPlan(AlternativeSubPlan *a, AlternativeSubPlan *b)
  {
  	COMPARE_NODE_FIELD(subplans);
  
--- 410,416 ----
  }
  
  static bool
! _equalAlternativeSubPlan(const AlternativeSubPlan *a, const AlternativeSubPlan *b)
  {
  	COMPARE_NODE_FIELD(subplans);
  
*************** _equalAlternativeSubPlan(AlternativeSubP
*** 418,424 ****
  }
  
  static bool
! _equalFieldSelect(FieldSelect *a, FieldSelect *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(fieldnum);
--- 418,424 ----
  }
  
  static bool
! _equalFieldSelect(const FieldSelect *a, const FieldSelect *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(fieldnum);
*************** _equalFieldSelect(FieldSelect *a, FieldS
*** 430,436 ****
  }
  
  static bool
! _equalFieldStore(FieldStore *a, FieldStore *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(newvals);
--- 430,436 ----
  }
  
  static bool
! _equalFieldStore(const FieldStore *a, const FieldStore *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(newvals);
*************** _equalFieldStore(FieldStore *a, FieldSto
*** 441,447 ****
  }
  
  static bool
! _equalRelabelType(RelabelType *a, RelabelType *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
--- 441,447 ----
  }
  
  static bool
! _equalRelabelType(const RelabelType *a, const RelabelType *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
*************** _equalRelabelType(RelabelType *a, Relabe
*** 463,469 ****
  }
  
  static bool
! _equalCoerceViaIO(CoerceViaIO *a, CoerceViaIO *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
--- 463,469 ----
  }
  
  static bool
! _equalCoerceViaIO(const CoerceViaIO *a, const CoerceViaIO *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
*************** _equalCoerceViaIO(CoerceViaIO *a, Coerce
*** 484,490 ****
  }
  
  static bool
! _equalArrayCoerceExpr(ArrayCoerceExpr *a, ArrayCoerceExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(elemfuncid);
--- 484,490 ----
  }
  
  static bool
! _equalArrayCoerceExpr(const ArrayCoerceExpr *a, const ArrayCoerceExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(elemfuncid);
*************** _equalArrayCoerceExpr(ArrayCoerceExpr *a
*** 508,514 ****
  }
  
  static bool
! _equalConvertRowtypeExpr(ConvertRowtypeExpr *a, ConvertRowtypeExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
--- 508,514 ----
  }
  
  static bool
! _equalConvertRowtypeExpr(const ConvertRowtypeExpr *a, const ConvertRowtypeExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
*************** _equalConvertRowtypeExpr(ConvertRowtypeE
*** 528,534 ****
  }
  
  static bool
! _equalCollateExpr(CollateExpr *a, CollateExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(collOid);
--- 528,534 ----
  }
  
  static bool
! _equalCollateExpr(const CollateExpr *a, const CollateExpr *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(collOid);
*************** _equalCollateExpr(CollateExpr *a, Collat
*** 538,544 ****
  }
  
  static bool
! _equalCaseExpr(CaseExpr *a, CaseExpr *b)
  {
  	COMPARE_SCALAR_FIELD(casetype);
  	COMPARE_SCALAR_FIELD(casecollid);
--- 538,544 ----
  }
  
  static bool
! _equalCaseExpr(const CaseExpr *a, const CaseExpr *b)
  {
  	COMPARE_SCALAR_FIELD(casetype);
  	COMPARE_SCALAR_FIELD(casecollid);
*************** _equalCaseExpr(CaseExpr *a, CaseExpr *b)
*** 551,557 ****
  }
  
  static bool
! _equalCaseWhen(CaseWhen *a, CaseWhen *b)
  {
  	COMPARE_NODE_FIELD(expr);
  	COMPARE_NODE_FIELD(result);
--- 551,557 ----
  }
  
  static bool
! _equalCaseWhen(const CaseWhen *a, const CaseWhen *b)
  {
  	COMPARE_NODE_FIELD(expr);
  	COMPARE_NODE_FIELD(result);
*************** _equalCaseWhen(CaseWhen *a, CaseWhen *b)
*** 561,567 ****
  }
  
  static bool
! _equalCaseTestExpr(CaseTestExpr *a, CaseTestExpr *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
--- 561,567 ----
  }
  
  static bool
! _equalCaseTestExpr(const CaseTestExpr *a, const CaseTestExpr *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
*************** _equalCaseTestExpr(CaseTestExpr *a, Case
*** 571,577 ****
  }
  
  static bool
! _equalArrayExpr(ArrayExpr *a, ArrayExpr *b)
  {
  	COMPARE_SCALAR_FIELD(array_typeid);
  	COMPARE_SCALAR_FIELD(array_collid);
--- 571,577 ----
  }
  
  static bool
! _equalArrayExpr(const ArrayExpr *a, const ArrayExpr *b)
  {
  	COMPARE_SCALAR_FIELD(array_typeid);
  	COMPARE_SCALAR_FIELD(array_collid);
*************** _equalArrayExpr(ArrayExpr *a, ArrayExpr
*** 584,590 ****
  }
  
  static bool
! _equalRowExpr(RowExpr *a, RowExpr *b)
  {
  	COMPARE_NODE_FIELD(args);
  	COMPARE_SCALAR_FIELD(row_typeid);
--- 584,590 ----
  }
  
  static bool
! _equalRowExpr(const RowExpr *a, const RowExpr *b)
  {
  	COMPARE_NODE_FIELD(args);
  	COMPARE_SCALAR_FIELD(row_typeid);
*************** _equalRowExpr(RowExpr *a, RowExpr *b)
*** 605,611 ****
  }
  
  static bool
! _equalRowCompareExpr(RowCompareExpr *a, RowCompareExpr *b)
  {
  	COMPARE_SCALAR_FIELD(rctype);
  	COMPARE_NODE_FIELD(opnos);
--- 605,611 ----
  }
  
  static bool
! _equalRowCompareExpr(const RowCompareExpr *a, const RowCompareExpr *b)
  {
  	COMPARE_SCALAR_FIELD(rctype);
  	COMPARE_NODE_FIELD(opnos);
*************** _equalRowCompareExpr(RowCompareExpr *a,
*** 618,624 ****
  }
  
  static bool
! _equalCoalesceExpr(CoalesceExpr *a, CoalesceExpr *b)
  {
  	COMPARE_SCALAR_FIELD(coalescetype);
  	COMPARE_SCALAR_FIELD(coalescecollid);
--- 618,624 ----
  }
  
  static bool
! _equalCoalesceExpr(const CoalesceExpr *a, const CoalesceExpr *b)
  {
  	COMPARE_SCALAR_FIELD(coalescetype);
  	COMPARE_SCALAR_FIELD(coalescecollid);
*************** _equalCoalesceExpr(CoalesceExpr *a, Coal
*** 629,635 ****
  }
  
  static bool
! _equalMinMaxExpr(MinMaxExpr *a, MinMaxExpr *b)
  {
  	COMPARE_SCALAR_FIELD(minmaxtype);
  	COMPARE_SCALAR_FIELD(minmaxcollid);
--- 629,635 ----
  }
  
  static bool
! _equalMinMaxExpr(const MinMaxExpr *a, const MinMaxExpr *b)
  {
  	COMPARE_SCALAR_FIELD(minmaxtype);
  	COMPARE_SCALAR_FIELD(minmaxcollid);
*************** _equalMinMaxExpr(MinMaxExpr *a, MinMaxEx
*** 642,648 ****
  }
  
  static bool
! _equalXmlExpr(XmlExpr *a, XmlExpr *b)
  {
  	COMPARE_SCALAR_FIELD(op);
  	COMPARE_STRING_FIELD(name);
--- 642,648 ----
  }
  
  static bool
! _equalXmlExpr(const XmlExpr *a, const XmlExpr *b)
  {
  	COMPARE_SCALAR_FIELD(op);
  	COMPARE_STRING_FIELD(name);
*************** _equalXmlExpr(XmlExpr *a, XmlExpr *b)
*** 658,664 ****
  }
  
  static bool
! _equalNullTest(NullTest *a, NullTest *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(nulltesttype);
--- 658,664 ----
  }
  
  static bool
! _equalNullTest(const NullTest *a, const NullTest *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(nulltesttype);
*************** _equalNullTest(NullTest *a, NullTest *b)
*** 668,674 ****
  }
  
  static bool
! _equalBooleanTest(BooleanTest *a, BooleanTest *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(booltesttype);
--- 668,674 ----
  }
  
  static bool
! _equalBooleanTest(const BooleanTest *a, const BooleanTest *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(booltesttype);
*************** _equalBooleanTest(BooleanTest *a, Boolea
*** 677,683 ****
  }
  
  static bool
! _equalCoerceToDomain(CoerceToDomain *a, CoerceToDomain *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
--- 677,683 ----
  }
  
  static bool
! _equalCoerceToDomain(const CoerceToDomain *a, const CoerceToDomain *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_SCALAR_FIELD(resulttype);
*************** _equalCoerceToDomain(CoerceToDomain *a,
*** 699,705 ****
  }
  
  static bool
! _equalCoerceToDomainValue(CoerceToDomainValue *a, CoerceToDomainValue *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
--- 699,705 ----
  }
  
  static bool
! _equalCoerceToDomainValue(const CoerceToDomainValue *a, const CoerceToDomainValue *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
*************** _equalCoerceToDomainValue(CoerceToDomain
*** 710,716 ****
  }
  
  static bool
! _equalSetToDefault(SetToDefault *a, SetToDefault *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
--- 710,716 ----
  }
  
  static bool
! _equalSetToDefault(const SetToDefault *a, const SetToDefault *b)
  {
  	COMPARE_SCALAR_FIELD(typeId);
  	COMPARE_SCALAR_FIELD(typeMod);
*************** _equalSetToDefault(SetToDefault *a, SetT
*** 721,727 ****
  }
  
  static bool
! _equalCurrentOfExpr(CurrentOfExpr *a, CurrentOfExpr *b)
  {
  	COMPARE_SCALAR_FIELD(cvarno);
  	COMPARE_STRING_FIELD(cursor_name);
--- 721,727 ----
  }
  
  static bool
! _equalCurrentOfExpr(const CurrentOfExpr *a, const CurrentOfExpr *b)
  {
  	COMPARE_SCALAR_FIELD(cvarno);
  	COMPARE_STRING_FIELD(cursor_name);
*************** _equalCurrentOfExpr(CurrentOfExpr *a, Cu
*** 731,737 ****
  }
  
  static bool
! _equalTargetEntry(TargetEntry *a, TargetEntry *b)
  {
  	COMPARE_NODE_FIELD(expr);
  	COMPARE_SCALAR_FIELD(resno);
--- 731,737 ----
  }
  
  static bool
! _equalTargetEntry(const TargetEntry *a, const TargetEntry *b)
  {
  	COMPARE_NODE_FIELD(expr);
  	COMPARE_SCALAR_FIELD(resno);
*************** _equalTargetEntry(TargetEntry *a, Target
*** 745,751 ****
  }
  
  static bool
! _equalRangeTblRef(RangeTblRef *a, RangeTblRef *b)
  {
  	COMPARE_SCALAR_FIELD(rtindex);
  
--- 745,751 ----
  }
  
  static bool
! _equalRangeTblRef(const RangeTblRef *a, const RangeTblRef *b)
  {
  	COMPARE_SCALAR_FIELD(rtindex);
  
*************** _equalRangeTblRef(RangeTblRef *a, RangeT
*** 753,759 ****
  }
  
  static bool
! _equalJoinExpr(JoinExpr *a, JoinExpr *b)
  {
  	COMPARE_SCALAR_FIELD(jointype);
  	COMPARE_SCALAR_FIELD(isNatural);
--- 753,759 ----
  }
  
  static bool
! _equalJoinExpr(const JoinExpr *a, const JoinExpr *b)
  {
  	COMPARE_SCALAR_FIELD(jointype);
  	COMPARE_SCALAR_FIELD(isNatural);
*************** _equalJoinExpr(JoinExpr *a, JoinExpr *b)
*** 768,774 ****
  }
  
  static bool
! _equalFromExpr(FromExpr *a, FromExpr *b)
  {
  	COMPARE_NODE_FIELD(fromlist);
  	COMPARE_NODE_FIELD(quals);
--- 768,774 ----
  }
  
  static bool
! _equalFromExpr(const FromExpr *a, const FromExpr *b)
  {
  	COMPARE_NODE_FIELD(fromlist);
  	COMPARE_NODE_FIELD(quals);
*************** _equalFromExpr(FromExpr *a, FromExpr *b)
*** 782,788 ****
   */
  
  static bool
! _equalPathKey(PathKey *a, PathKey *b)
  {
  	/*
  	 * This is normally used on non-canonicalized PathKeys, so must chase up
--- 782,788 ----
   */
  
  static bool
! _equalPathKey(const PathKey *a, const PathKey *b)
  {
  	/*
  	 * This is normally used on non-canonicalized PathKeys, so must chase up
*************** _equalPathKey(PathKey *a, PathKey *b)
*** 808,814 ****
  }
  
  static bool
! _equalRestrictInfo(RestrictInfo *a, RestrictInfo *b)
  {
  	COMPARE_NODE_FIELD(clause);
  	COMPARE_SCALAR_FIELD(is_pushed_down);
--- 808,814 ----
  }
  
  static bool
! _equalRestrictInfo(const RestrictInfo *a, const RestrictInfo *b)
  {
  	COMPARE_NODE_FIELD(clause);
  	COMPARE_SCALAR_FIELD(is_pushed_down);
*************** _equalRestrictInfo(RestrictInfo *a, Rest
*** 825,831 ****
  }
  
  static bool
! _equalPlaceHolderVar(PlaceHolderVar *a, PlaceHolderVar *b)
  {
  	/*
  	 * We intentionally do not compare phexpr.	Two PlaceHolderVars with the
--- 825,831 ----
  }
  
  static bool
! _equalPlaceHolderVar(const PlaceHolderVar *a, const PlaceHolderVar *b)
  {
  	/*
  	 * We intentionally do not compare phexpr.	Two PlaceHolderVars with the
*************** _equalPlaceHolderVar(PlaceHolderVar *a,
*** 846,852 ****
  }
  
  static bool
! _equalSpecialJoinInfo(SpecialJoinInfo *a, SpecialJoinInfo *b)
  {
  	COMPARE_BITMAPSET_FIELD(min_lefthand);
  	COMPARE_BITMAPSET_FIELD(min_righthand);
--- 846,852 ----
  }
  
  static bool
! _equalSpecialJoinInfo(const SpecialJoinInfo *a, const SpecialJoinInfo *b)
  {
  	COMPARE_BITMAPSET_FIELD(min_lefthand);
  	COMPARE_BITMAPSET_FIELD(min_righthand);
*************** _equalSpecialJoinInfo(SpecialJoinInfo *a
*** 861,867 ****
  }
  
  static bool
! _equalAppendRelInfo(AppendRelInfo *a, AppendRelInfo *b)
  {
  	COMPARE_SCALAR_FIELD(parent_relid);
  	COMPARE_SCALAR_FIELD(child_relid);
--- 861,867 ----
  }
  
  static bool
! _equalAppendRelInfo(const AppendRelInfo *a, const AppendRelInfo *b)
  {
  	COMPARE_SCALAR_FIELD(parent_relid);
  	COMPARE_SCALAR_FIELD(child_relid);
*************** _equalAppendRelInfo(AppendRelInfo *a, Ap
*** 874,880 ****
  }
  
  static bool
! _equalPlaceHolderInfo(PlaceHolderInfo *a, PlaceHolderInfo *b)
  {
  	COMPARE_SCALAR_FIELD(phid);
  	COMPARE_NODE_FIELD(ph_var);
--- 874,880 ----
  }
  
  static bool
! _equalPlaceHolderInfo(const PlaceHolderInfo *a, const PlaceHolderInfo *b)
  {
  	COMPARE_SCALAR_FIELD(phid);
  	COMPARE_NODE_FIELD(ph_var);
*************** _equalPlaceHolderInfo(PlaceHolderInfo *a
*** 892,898 ****
   */
  
  static bool
! _equalQuery(Query *a, Query *b)
  {
  	COMPARE_SCALAR_FIELD(commandType);
  	COMPARE_SCALAR_FIELD(querySource);
--- 892,898 ----
   */
  
  static bool
! _equalQuery(const Query *a, const Query *b)
  {
  	COMPARE_SCALAR_FIELD(commandType);
  	COMPARE_SCALAR_FIELD(querySource);
*************** _equalQuery(Query *a, Query *b)
*** 927,933 ****
  }
  
  static bool
! _equalInsertStmt(InsertStmt *a, InsertStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(cols);
--- 927,933 ----
  }
  
  static bool
! _equalInsertStmt(const InsertStmt *a, const InsertStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(cols);
*************** _equalInsertStmt(InsertStmt *a, InsertSt
*** 939,945 ****
  }
  
  static bool
! _equalDeleteStmt(DeleteStmt *a, DeleteStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(usingClause);
--- 939,945 ----
  }
  
  static bool
! _equalDeleteStmt(const DeleteStmt *a, const DeleteStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(usingClause);
*************** _equalDeleteStmt(DeleteStmt *a, DeleteSt
*** 951,957 ****
  }
  
  static bool
! _equalUpdateStmt(UpdateStmt *a, UpdateStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(targetList);
--- 951,957 ----
  }
  
  static bool
! _equalUpdateStmt(const UpdateStmt *a, const UpdateStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(targetList);
*************** _equalUpdateStmt(UpdateStmt *a, UpdateSt
*** 964,970 ****
  }
  
  static bool
! _equalSelectStmt(SelectStmt *a, SelectStmt *b)
  {
  	COMPARE_NODE_FIELD(distinctClause);
  	COMPARE_NODE_FIELD(intoClause);
--- 964,970 ----
  }
  
  static bool
! _equalSelectStmt(const SelectStmt *a, const SelectStmt *b)
  {
  	COMPARE_NODE_FIELD(distinctClause);
  	COMPARE_NODE_FIELD(intoClause);
*************** _equalSelectStmt(SelectStmt *a, SelectSt
*** 989,995 ****
  }
  
  static bool
! _equalSetOperationStmt(SetOperationStmt *a, SetOperationStmt *b)
  {
  	COMPARE_SCALAR_FIELD(op);
  	COMPARE_SCALAR_FIELD(all);
--- 989,995 ----
  }
  
  static bool
! _equalSetOperationStmt(const SetOperationStmt *a, const SetOperationStmt *b)
  {
  	COMPARE_SCALAR_FIELD(op);
  	COMPARE_SCALAR_FIELD(all);
*************** _equalSetOperationStmt(SetOperationStmt
*** 1004,1010 ****
  }
  
  static bool
! _equalAlterTableStmt(AlterTableStmt *a, AlterTableStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(cmds);
--- 1004,1010 ----
  }
  
  static bool
! _equalAlterTableStmt(const AlterTableStmt *a, const AlterTableStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(cmds);
*************** _equalAlterTableStmt(AlterTableStmt *a,
*** 1014,1020 ****
  }
  
  static bool
! _equalAlterTableCmd(AlterTableCmd *a, AlterTableCmd *b)
  {
  	COMPARE_SCALAR_FIELD(subtype);
  	COMPARE_STRING_FIELD(name);
--- 1014,1020 ----
  }
  
  static bool
! _equalAlterTableCmd(const AlterTableCmd *a, const AlterTableCmd *b)
  {
  	COMPARE_SCALAR_FIELD(subtype);
  	COMPARE_STRING_FIELD(name);
*************** _equalAlterTableCmd(AlterTableCmd *a, Al
*** 1026,1032 ****
  }
  
  static bool
! _equalAlterDomainStmt(AlterDomainStmt *a, AlterDomainStmt *b)
  {
  	COMPARE_SCALAR_FIELD(subtype);
  	COMPARE_NODE_FIELD(typeName);
--- 1026,1032 ----
  }
  
  static bool
! _equalAlterDomainStmt(const AlterDomainStmt *a, const AlterDomainStmt *b)
  {
  	COMPARE_SCALAR_FIELD(subtype);
  	COMPARE_NODE_FIELD(typeName);
*************** _equalAlterDomainStmt(AlterDomainStmt *a
*** 1038,1044 ****
  }
  
  static bool
! _equalGrantStmt(GrantStmt *a, GrantStmt *b)
  {
  	COMPARE_SCALAR_FIELD(is_grant);
  	COMPARE_SCALAR_FIELD(targtype);
--- 1038,1044 ----
  }
  
  static bool
! _equalGrantStmt(const GrantStmt *a, const GrantStmt *b)
  {
  	COMPARE_SCALAR_FIELD(is_grant);
  	COMPARE_SCALAR_FIELD(targtype);
*************** _equalGrantStmt(GrantStmt *a, GrantStmt
*** 1053,1059 ****
  }
  
  static bool
! _equalPrivGrantee(PrivGrantee *a, PrivGrantee *b)
  {
  	COMPARE_STRING_FIELD(rolname);
  
--- 1053,1059 ----
  }
  
  static bool
! _equalPrivGrantee(const PrivGrantee *a, const PrivGrantee *b)
  {
  	COMPARE_STRING_FIELD(rolname);
  
*************** _equalPrivGrantee(PrivGrantee *a, PrivGr
*** 1061,1067 ****
  }
  
  static bool
! _equalFuncWithArgs(FuncWithArgs *a, FuncWithArgs *b)
  {
  	COMPARE_NODE_FIELD(funcname);
  	COMPARE_NODE_FIELD(funcargs);
--- 1061,1067 ----
  }
  
  static bool
! _equalFuncWithArgs(const FuncWithArgs *a, const FuncWithArgs *b)
  {
  	COMPARE_NODE_FIELD(funcname);
  	COMPARE_NODE_FIELD(funcargs);
*************** _equalFuncWithArgs(FuncWithArgs *a, Func
*** 1070,1076 ****
  }
  
  static bool
! _equalAccessPriv(AccessPriv *a, AccessPriv *b)
  {
  	COMPARE_STRING_FIELD(priv_name);
  	COMPARE_NODE_FIELD(cols);
--- 1070,1076 ----
  }
  
  static bool
! _equalAccessPriv(const AccessPriv *a, const AccessPriv *b)
  {
  	COMPARE_STRING_FIELD(priv_name);
  	COMPARE_NODE_FIELD(cols);
*************** _equalAccessPriv(AccessPriv *a, AccessPr
*** 1079,1085 ****
  }
  
  static bool
! _equalGrantRoleStmt(GrantRoleStmt *a, GrantRoleStmt *b)
  {
  	COMPARE_NODE_FIELD(granted_roles);
  	COMPARE_NODE_FIELD(grantee_roles);
--- 1079,1085 ----
  }
  
  static bool
! _equalGrantRoleStmt(const GrantRoleStmt *a, const GrantRoleStmt *b)
  {
  	COMPARE_NODE_FIELD(granted_roles);
  	COMPARE_NODE_FIELD(grantee_roles);
*************** _equalGrantRoleStmt(GrantRoleStmt *a, Gr
*** 1092,1098 ****
  }
  
  static bool
! _equalAlterDefaultPrivilegesStmt(AlterDefaultPrivilegesStmt *a, AlterDefaultPrivilegesStmt *b)
  {
  	COMPARE_NODE_FIELD(options);
  	COMPARE_NODE_FIELD(action);
--- 1092,1098 ----
  }
  
  static bool
! _equalAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *a, const AlterDefaultPrivilegesStmt *b)
  {
  	COMPARE_NODE_FIELD(options);
  	COMPARE_NODE_FIELD(action);
*************** _equalAlterDefaultPrivilegesStmt(AlterDe
*** 1101,1107 ****
  }
  
  static bool
! _equalDeclareCursorStmt(DeclareCursorStmt *a, DeclareCursorStmt *b)
  {
  	COMPARE_STRING_FIELD(portalname);
  	COMPARE_SCALAR_FIELD(options);
--- 1101,1107 ----
  }
  
  static bool
! _equalDeclareCursorStmt(const DeclareCursorStmt *a, const DeclareCursorStmt *b)
  {
  	COMPARE_STRING_FIELD(portalname);
  	COMPARE_SCALAR_FIELD(options);
*************** _equalDeclareCursorStmt(DeclareCursorStm
*** 1111,1117 ****
  }
  
  static bool
! _equalClosePortalStmt(ClosePortalStmt *a, ClosePortalStmt *b)
  {
  	COMPARE_STRING_FIELD(portalname);
  
--- 1111,1117 ----
  }
  
  static bool
! _equalClosePortalStmt(const ClosePortalStmt *a, const ClosePortalStmt *b)
  {
  	COMPARE_STRING_FIELD(portalname);
  
*************** _equalClosePortalStmt(ClosePortalStmt *a
*** 1119,1125 ****
  }
  
  static bool
! _equalClusterStmt(ClusterStmt *a, ClusterStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(indexname);
--- 1119,1125 ----
  }
  
  static bool
! _equalClusterStmt(const ClusterStmt *a, const ClusterStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(indexname);
*************** _equalClusterStmt(ClusterStmt *a, Cluste
*** 1129,1135 ****
  }
  
  static bool
! _equalCopyStmt(CopyStmt *a, CopyStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(query);
--- 1129,1135 ----
  }
  
  static bool
! _equalCopyStmt(const CopyStmt *a, const CopyStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(query);
*************** _equalCopyStmt(CopyStmt *a, CopyStmt *b)
*** 1142,1148 ****
  }
  
  static bool
! _equalCreateStmt(CreateStmt *a, CreateStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(tableElts);
--- 1142,1148 ----
  }
  
  static bool
! _equalCreateStmt(const CreateStmt *a, const CreateStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_NODE_FIELD(tableElts);
*************** _equalCreateStmt(CreateStmt *a, CreateSt
*** 1158,1164 ****
  }
  
  static bool
! _equalInhRelation(InhRelation *a, InhRelation *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_SCALAR_FIELD(options);
--- 1158,1164 ----
  }
  
  static bool
! _equalInhRelation(const InhRelation *a, const InhRelation *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_SCALAR_FIELD(options);
*************** _equalInhRelation(InhRelation *a, InhRel
*** 1167,1173 ****
  }
  
  static bool
! _equalDefineStmt(DefineStmt *a, DefineStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_SCALAR_FIELD(oldstyle);
--- 1167,1173 ----
  }
  
  static bool
! _equalDefineStmt(const DefineStmt *a, const DefineStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_SCALAR_FIELD(oldstyle);
*************** _equalDefineStmt(DefineStmt *a, DefineSt
*** 1179,1185 ****
  }
  
  static bool
! _equalDropStmt(DropStmt *a, DropStmt *b)
  {
  	COMPARE_NODE_FIELD(objects);
  	COMPARE_SCALAR_FIELD(removeType);
--- 1179,1185 ----
  }
  
  static bool
! _equalDropStmt(const DropStmt *a, const DropStmt *b)
  {
  	COMPARE_NODE_FIELD(objects);
  	COMPARE_SCALAR_FIELD(removeType);
*************** _equalDropStmt(DropStmt *a, DropStmt *b)
*** 1190,1196 ****
  }
  
  static bool
! _equalTruncateStmt(TruncateStmt *a, TruncateStmt *b)
  {
  	COMPARE_NODE_FIELD(relations);
  	COMPARE_SCALAR_FIELD(restart_seqs);
--- 1190,1196 ----
  }
  
  static bool
! _equalTruncateStmt(const TruncateStmt *a, const TruncateStmt *b)
  {
  	COMPARE_NODE_FIELD(relations);
  	COMPARE_SCALAR_FIELD(restart_seqs);
*************** _equalTruncateStmt(TruncateStmt *a, Trun
*** 1200,1206 ****
  }
  
  static bool
! _equalCommentStmt(CommentStmt *a, CommentStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objtype);
  	COMPARE_NODE_FIELD(objname);
--- 1200,1206 ----
  }
  
  static bool
! _equalCommentStmt(const CommentStmt *a, const CommentStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objtype);
  	COMPARE_NODE_FIELD(objname);
*************** _equalCommentStmt(CommentStmt *a, Commen
*** 1211,1217 ****
  }
  
  static bool
! _equalSecLabelStmt(SecLabelStmt *a, SecLabelStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objtype);
  	COMPARE_NODE_FIELD(objname);
--- 1211,1217 ----
  }
  
  static bool
! _equalSecLabelStmt(const SecLabelStmt *a, const SecLabelStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objtype);
  	COMPARE_NODE_FIELD(objname);
*************** _equalSecLabelStmt(SecLabelStmt *a, SecL
*** 1223,1229 ****
  }
  
  static bool
! _equalFetchStmt(FetchStmt *a, FetchStmt *b)
  {
  	COMPARE_SCALAR_FIELD(direction);
  	COMPARE_SCALAR_FIELD(howMany);
--- 1223,1229 ----
  }
  
  static bool
! _equalFetchStmt(const FetchStmt *a, const FetchStmt *b)
  {
  	COMPARE_SCALAR_FIELD(direction);
  	COMPARE_SCALAR_FIELD(howMany);
*************** _equalFetchStmt(FetchStmt *a, FetchStmt
*** 1234,1240 ****
  }
  
  static bool
! _equalIndexStmt(IndexStmt *a, IndexStmt *b)
  {
  	COMPARE_STRING_FIELD(idxname);
  	COMPARE_NODE_FIELD(relation);
--- 1234,1240 ----
  }
  
  static bool
! _equalIndexStmt(const IndexStmt *a, const IndexStmt *b)
  {
  	COMPARE_STRING_FIELD(idxname);
  	COMPARE_NODE_FIELD(relation);
*************** _equalIndexStmt(IndexStmt *a, IndexStmt
*** 1257,1263 ****
  }
  
  static bool
! _equalCreateFunctionStmt(CreateFunctionStmt *a, CreateFunctionStmt *b)
  {
  	COMPARE_SCALAR_FIELD(replace);
  	COMPARE_NODE_FIELD(funcname);
--- 1257,1263 ----
  }
  
  static bool
! _equalCreateFunctionStmt(const CreateFunctionStmt *a, const CreateFunctionStmt *b)
  {
  	COMPARE_SCALAR_FIELD(replace);
  	COMPARE_NODE_FIELD(funcname);
*************** _equalCreateFunctionStmt(CreateFunctionS
*** 1270,1276 ****
  }
  
  static bool
! _equalFunctionParameter(FunctionParameter *a, FunctionParameter *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(argType);
--- 1270,1276 ----
  }
  
  static bool
! _equalFunctionParameter(const FunctionParameter *a, const FunctionParameter *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(argType);
*************** _equalFunctionParameter(FunctionParamete
*** 1281,1287 ****
  }
  
  static bool
! _equalAlterFunctionStmt(AlterFunctionStmt *a, AlterFunctionStmt *b)
  {
  	COMPARE_NODE_FIELD(func);
  	COMPARE_NODE_FIELD(actions);
--- 1281,1287 ----
  }
  
  static bool
! _equalAlterFunctionStmt(const AlterFunctionStmt *a, const AlterFunctionStmt *b)
  {
  	COMPARE_NODE_FIELD(func);
  	COMPARE_NODE_FIELD(actions);
*************** _equalAlterFunctionStmt(AlterFunctionStm
*** 1290,1296 ****
  }
  
  static bool
! _equalRemoveFuncStmt(RemoveFuncStmt *a, RemoveFuncStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(name);
--- 1290,1296 ----
  }
  
  static bool
! _equalRemoveFuncStmt(const RemoveFuncStmt *a, const RemoveFuncStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(name);
*************** _equalRemoveFuncStmt(RemoveFuncStmt *a,
*** 1302,1308 ****
  }
  
  static bool
! _equalDoStmt(DoStmt *a, DoStmt *b)
  {
  	COMPARE_NODE_FIELD(args);
  
--- 1302,1308 ----
  }
  
  static bool
! _equalDoStmt(const DoStmt *a, const DoStmt *b)
  {
  	COMPARE_NODE_FIELD(args);
  
*************** _equalDoStmt(DoStmt *a, DoStmt *b)
*** 1310,1316 ****
  }
  
  static bool
! _equalRemoveOpClassStmt(RemoveOpClassStmt *a, RemoveOpClassStmt *b)
  {
  	COMPARE_NODE_FIELD(opclassname);
  	COMPARE_STRING_FIELD(amname);
--- 1310,1316 ----
  }
  
  static bool
! _equalRemoveOpClassStmt(const RemoveOpClassStmt *a, const RemoveOpClassStmt *b)
  {
  	COMPARE_NODE_FIELD(opclassname);
  	COMPARE_STRING_FIELD(amname);
*************** _equalRemoveOpClassStmt(RemoveOpClassStm
*** 1321,1327 ****
  }
  
  static bool
! _equalRemoveOpFamilyStmt(RemoveOpFamilyStmt *a, RemoveOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
--- 1321,1327 ----
  }
  
  static bool
! _equalRemoveOpFamilyStmt(const RemoveOpFamilyStmt *a, const RemoveOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
*************** _equalRemoveOpFamilyStmt(RemoveOpFamilyS
*** 1332,1338 ****
  }
  
  static bool
! _equalRenameStmt(RenameStmt *a, RenameStmt *b)
  {
  	COMPARE_SCALAR_FIELD(renameType);
  	COMPARE_NODE_FIELD(relation);
--- 1332,1338 ----
  }
  
  static bool
! _equalRenameStmt(const RenameStmt *a, const RenameStmt *b)
  {
  	COMPARE_SCALAR_FIELD(renameType);
  	COMPARE_NODE_FIELD(relation);
*************** _equalRenameStmt(RenameStmt *a, RenameSt
*** 1346,1352 ****
  }
  
  static bool
! _equalAlterObjectSchemaStmt(AlterObjectSchemaStmt *a, AlterObjectSchemaStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objectType);
  	COMPARE_NODE_FIELD(relation);
--- 1346,1352 ----
  }
  
  static bool
! _equalAlterObjectSchemaStmt(const AlterObjectSchemaStmt *a, const AlterObjectSchemaStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objectType);
  	COMPARE_NODE_FIELD(relation);
*************** _equalAlterObjectSchemaStmt(AlterObjectS
*** 1359,1365 ****
  }
  
  static bool
! _equalAlterOwnerStmt(AlterOwnerStmt *a, AlterOwnerStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objectType);
  	COMPARE_NODE_FIELD(relation);
--- 1359,1365 ----
  }
  
  static bool
! _equalAlterOwnerStmt(const AlterOwnerStmt *a, const AlterOwnerStmt *b)
  {
  	COMPARE_SCALAR_FIELD(objectType);
  	COMPARE_NODE_FIELD(relation);
*************** _equalAlterOwnerStmt(AlterOwnerStmt *a,
*** 1372,1378 ****
  }
  
  static bool
! _equalRuleStmt(RuleStmt *a, RuleStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(rulename);
--- 1372,1378 ----
  }
  
  static bool
! _equalRuleStmt(const RuleStmt *a, const RuleStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(rulename);
*************** _equalRuleStmt(RuleStmt *a, RuleStmt *b)
*** 1386,1392 ****
  }
  
  static bool
! _equalNotifyStmt(NotifyStmt *a, NotifyStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  	COMPARE_STRING_FIELD(payload);
--- 1386,1392 ----
  }
  
  static bool
! _equalNotifyStmt(const NotifyStmt *a, const NotifyStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  	COMPARE_STRING_FIELD(payload);
*************** _equalNotifyStmt(NotifyStmt *a, NotifySt
*** 1395,1401 ****
  }
  
  static bool
! _equalListenStmt(ListenStmt *a, ListenStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  
--- 1395,1401 ----
  }
  
  static bool
! _equalListenStmt(const ListenStmt *a, const ListenStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  
*************** _equalListenStmt(ListenStmt *a, ListenSt
*** 1403,1409 ****
  }
  
  static bool
! _equalUnlistenStmt(UnlistenStmt *a, UnlistenStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  
--- 1403,1409 ----
  }
  
  static bool
! _equalUnlistenStmt(const UnlistenStmt *a, const UnlistenStmt *b)
  {
  	COMPARE_STRING_FIELD(conditionname);
  
*************** _equalUnlistenStmt(UnlistenStmt *a, Unli
*** 1411,1417 ****
  }
  
  static bool
! _equalTransactionStmt(TransactionStmt *a, TransactionStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(options);
--- 1411,1417 ----
  }
  
  static bool
! _equalTransactionStmt(const TransactionStmt *a, const TransactionStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(options);
*************** _equalTransactionStmt(TransactionStmt *a
*** 1421,1427 ****
  }
  
  static bool
! _equalCompositeTypeStmt(CompositeTypeStmt *a, CompositeTypeStmt *b)
  {
  	COMPARE_NODE_FIELD(typevar);
  	COMPARE_NODE_FIELD(coldeflist);
--- 1421,1427 ----
  }
  
  static bool
! _equalCompositeTypeStmt(const CompositeTypeStmt *a, const CompositeTypeStmt *b)
  {
  	COMPARE_NODE_FIELD(typevar);
  	COMPARE_NODE_FIELD(coldeflist);
*************** _equalCompositeTypeStmt(CompositeTypeStm
*** 1430,1436 ****
  }
  
  static bool
! _equalCreateEnumStmt(CreateEnumStmt *a, CreateEnumStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_NODE_FIELD(vals);
--- 1430,1436 ----
  }
  
  static bool
! _equalCreateEnumStmt(const CreateEnumStmt *a, const CreateEnumStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_NODE_FIELD(vals);
*************** _equalCreateEnumStmt(CreateEnumStmt *a,
*** 1439,1445 ****
  }
  
  static bool
! _equalCreateRangeStmt(CreateRangeStmt *a, CreateRangeStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_NODE_FIELD(params);
--- 1439,1445 ----
  }
  
  static bool
! _equalCreateRangeStmt(const CreateRangeStmt *a, const CreateRangeStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_NODE_FIELD(params);
*************** _equalCreateRangeStmt(CreateRangeStmt *a
*** 1448,1454 ****
  }
  
  static bool
! _equalAlterEnumStmt(AlterEnumStmt *a, AlterEnumStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_STRING_FIELD(newVal);
--- 1448,1454 ----
  }
  
  static bool
! _equalAlterEnumStmt(const AlterEnumStmt *a, const AlterEnumStmt *b)
  {
  	COMPARE_NODE_FIELD(typeName);
  	COMPARE_STRING_FIELD(newVal);
*************** _equalAlterEnumStmt(AlterEnumStmt *a, Al
*** 1459,1465 ****
  }
  
  static bool
! _equalViewStmt(ViewStmt *a, ViewStmt *b)
  {
  	COMPARE_NODE_FIELD(view);
  	COMPARE_NODE_FIELD(aliases);
--- 1459,1465 ----
  }
  
  static bool
! _equalViewStmt(const ViewStmt *a, const ViewStmt *b)
  {
  	COMPARE_NODE_FIELD(view);
  	COMPARE_NODE_FIELD(aliases);
*************** _equalViewStmt(ViewStmt *a, ViewStmt *b)
*** 1470,1476 ****
  }
  
  static bool
! _equalLoadStmt(LoadStmt *a, LoadStmt *b)
  {
  	COMPARE_STRING_FIELD(filename);
  
--- 1470,1476 ----
  }
  
  static bool
! _equalLoadStmt(const LoadStmt *a, const LoadStmt *b)
  {
  	COMPARE_STRING_FIELD(filename);
  
*************** _equalLoadStmt(LoadStmt *a, LoadStmt *b)
*** 1478,1484 ****
  }
  
  static bool
! _equalCreateDomainStmt(CreateDomainStmt *a, CreateDomainStmt *b)
  {
  	COMPARE_NODE_FIELD(domainname);
  	COMPARE_NODE_FIELD(typeName);
--- 1478,1484 ----
  }
  
  static bool
! _equalCreateDomainStmt(const CreateDomainStmt *a, const CreateDomainStmt *b)
  {
  	COMPARE_NODE_FIELD(domainname);
  	COMPARE_NODE_FIELD(typeName);
*************** _equalCreateDomainStmt(CreateDomainStmt
*** 1489,1495 ****
  }
  
  static bool
! _equalCreateOpClassStmt(CreateOpClassStmt *a, CreateOpClassStmt *b)
  {
  	COMPARE_NODE_FIELD(opclassname);
  	COMPARE_NODE_FIELD(opfamilyname);
--- 1489,1495 ----
  }
  
  static bool
! _equalCreateOpClassStmt(const CreateOpClassStmt *a, const CreateOpClassStmt *b)
  {
  	COMPARE_NODE_FIELD(opclassname);
  	COMPARE_NODE_FIELD(opfamilyname);
*************** _equalCreateOpClassStmt(CreateOpClassStm
*** 1502,1508 ****
  }
  
  static bool
! _equalCreateOpClassItem(CreateOpClassItem *a, CreateOpClassItem *b)
  {
  	COMPARE_SCALAR_FIELD(itemtype);
  	COMPARE_NODE_FIELD(name);
--- 1502,1508 ----
  }
  
  static bool
! _equalCreateOpClassItem(const CreateOpClassItem *a, const CreateOpClassItem *b)
  {
  	COMPARE_SCALAR_FIELD(itemtype);
  	COMPARE_NODE_FIELD(name);
*************** _equalCreateOpClassItem(CreateOpClassIte
*** 1516,1522 ****
  }
  
  static bool
! _equalCreateOpFamilyStmt(CreateOpFamilyStmt *a, CreateOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
--- 1516,1522 ----
  }
  
  static bool
! _equalCreateOpFamilyStmt(const CreateOpFamilyStmt *a, const CreateOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
*************** _equalCreateOpFamilyStmt(CreateOpFamilyS
*** 1525,1531 ****
  }
  
  static bool
! _equalAlterOpFamilyStmt(AlterOpFamilyStmt *a, AlterOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
--- 1525,1531 ----
  }
  
  static bool
! _equalAlterOpFamilyStmt(const AlterOpFamilyStmt *a, const AlterOpFamilyStmt *b)
  {
  	COMPARE_NODE_FIELD(opfamilyname);
  	COMPARE_STRING_FIELD(amname);
*************** _equalAlterOpFamilyStmt(AlterOpFamilyStm
*** 1536,1542 ****
  }
  
  static bool
! _equalCreatedbStmt(CreatedbStmt *a, CreatedbStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(options);
--- 1536,1542 ----
  }
  
  static bool
! _equalCreatedbStmt(const CreatedbStmt *a, const CreatedbStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(options);
*************** _equalCreatedbStmt(CreatedbStmt *a, Crea
*** 1545,1551 ****
  }
  
  static bool
! _equalAlterDatabaseStmt(AlterDatabaseStmt *a, AlterDatabaseStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(options);
--- 1545,1551 ----
  }
  
  static bool
! _equalAlterDatabaseStmt(const AlterDatabaseStmt *a, const AlterDatabaseStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(options);
*************** _equalAlterDatabaseStmt(AlterDatabaseStm
*** 1554,1560 ****
  }
  
  static bool
! _equalAlterDatabaseSetStmt(AlterDatabaseSetStmt *a, AlterDatabaseSetStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(setstmt);
--- 1554,1560 ----
  }
  
  static bool
! _equalAlterDatabaseSetStmt(const AlterDatabaseSetStmt *a, const AlterDatabaseSetStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_NODE_FIELD(setstmt);
*************** _equalAlterDatabaseSetStmt(AlterDatabase
*** 1563,1569 ****
  }
  
  static bool
! _equalDropdbStmt(DropdbStmt *a, DropdbStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_SCALAR_FIELD(missing_ok);
--- 1563,1569 ----
  }
  
  static bool
! _equalDropdbStmt(const DropdbStmt *a, const DropdbStmt *b)
  {
  	COMPARE_STRING_FIELD(dbname);
  	COMPARE_SCALAR_FIELD(missing_ok);
*************** _equalDropdbStmt(DropdbStmt *a, DropdbSt
*** 1572,1578 ****
  }
  
  static bool
! _equalVacuumStmt(VacuumStmt *a, VacuumStmt *b)
  {
  	COMPARE_SCALAR_FIELD(options);
  	COMPARE_SCALAR_FIELD(freeze_min_age);
--- 1572,1578 ----
  }
  
  static bool
! _equalVacuumStmt(const VacuumStmt *a, const VacuumStmt *b)
  {
  	COMPARE_SCALAR_FIELD(options);
  	COMPARE_SCALAR_FIELD(freeze_min_age);
*************** _equalVacuumStmt(VacuumStmt *a, VacuumSt
*** 1584,1590 ****
  }
  
  static bool
! _equalExplainStmt(ExplainStmt *a, ExplainStmt *b)
  {
  	COMPARE_NODE_FIELD(query);
  	COMPARE_NODE_FIELD(options);
--- 1584,1590 ----
  }
  
  static bool
! _equalExplainStmt(const ExplainStmt *a, const ExplainStmt *b)
  {
  	COMPARE_NODE_FIELD(query);
  	COMPARE_NODE_FIELD(options);
*************** _equalExplainStmt(ExplainStmt *a, Explai
*** 1593,1599 ****
  }
  
  static bool
! _equalCreateSeqStmt(CreateSeqStmt *a, CreateSeqStmt *b)
  {
  	COMPARE_NODE_FIELD(sequence);
  	COMPARE_NODE_FIELD(options);
--- 1593,1599 ----
  }
  
  static bool
! _equalCreateSeqStmt(const CreateSeqStmt *a, const CreateSeqStmt *b)
  {
  	COMPARE_NODE_FIELD(sequence);
  	COMPARE_NODE_FIELD(options);
*************** _equalCreateSeqStmt(CreateSeqStmt *a, Cr
*** 1603,1609 ****
  }
  
  static bool
! _equalAlterSeqStmt(AlterSeqStmt *a, AlterSeqStmt *b)
  {
  	COMPARE_NODE_FIELD(sequence);
  	COMPARE_NODE_FIELD(options);
--- 1603,1609 ----
  }
  
  static bool
! _equalAlterSeqStmt(const AlterSeqStmt *a, const AlterSeqStmt *b)
  {
  	COMPARE_NODE_FIELD(sequence);
  	COMPARE_NODE_FIELD(options);
*************** _equalAlterSeqStmt(AlterSeqStmt *a, Alte
*** 1612,1618 ****
  }
  
  static bool
! _equalVariableSetStmt(VariableSetStmt *a, VariableSetStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_STRING_FIELD(name);
--- 1612,1618 ----
  }
  
  static bool
! _equalVariableSetStmt(const VariableSetStmt *a, const VariableSetStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_STRING_FIELD(name);
*************** _equalVariableSetStmt(VariableSetStmt *a
*** 1623,1629 ****
  }
  
  static bool
! _equalVariableShowStmt(VariableShowStmt *a, VariableShowStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  
--- 1623,1629 ----
  }
  
  static bool
! _equalVariableShowStmt(const VariableShowStmt *a, const VariableShowStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  
*************** _equalVariableShowStmt(VariableShowStmt
*** 1631,1637 ****
  }
  
  static bool
! _equalDiscardStmt(DiscardStmt *a, DiscardStmt *b)
  {
  	COMPARE_SCALAR_FIELD(target);
  
--- 1631,1637 ----
  }
  
  static bool
! _equalDiscardStmt(const DiscardStmt *a, const DiscardStmt *b)
  {
  	COMPARE_SCALAR_FIELD(target);
  
*************** _equalDiscardStmt(DiscardStmt *a, Discar
*** 1639,1645 ****
  }
  
  static bool
! _equalCreateTableSpaceStmt(CreateTableSpaceStmt *a, CreateTableSpaceStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_STRING_FIELD(owner);
--- 1639,1645 ----
  }
  
  static bool
! _equalCreateTableSpaceStmt(const CreateTableSpaceStmt *a, const CreateTableSpaceStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_STRING_FIELD(owner);
*************** _equalCreateTableSpaceStmt(CreateTableSp
*** 1649,1655 ****
  }
  
  static bool
! _equalDropTableSpaceStmt(DropTableSpaceStmt *a, DropTableSpaceStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_SCALAR_FIELD(missing_ok);
--- 1649,1655 ----
  }
  
  static bool
! _equalDropTableSpaceStmt(const DropTableSpaceStmt *a, const DropTableSpaceStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_SCALAR_FIELD(missing_ok);
*************** _equalDropTableSpaceStmt(DropTableSpaceS
*** 1658,1665 ****
  }
  
  static bool
! _equalAlterTableSpaceOptionsStmt(AlterTableSpaceOptionsStmt *a,
! 								 AlterTableSpaceOptionsStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_NODE_FIELD(options);
--- 1658,1665 ----
  }
  
  static bool
! _equalAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *a,
! 								 const AlterTableSpaceOptionsStmt *b)
  {
  	COMPARE_STRING_FIELD(tablespacename);
  	COMPARE_NODE_FIELD(options);
*************** _equalAlterTableSpaceOptionsStmt(AlterTa
*** 1669,1675 ****
  }
  
  static bool
! _equalCreateExtensionStmt(CreateExtensionStmt *a, CreateExtensionStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_SCALAR_FIELD(if_not_exists);
--- 1669,1675 ----
  }
  
  static bool
! _equalCreateExtensionStmt(const CreateExtensionStmt *a, const CreateExtensionStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_SCALAR_FIELD(if_not_exists);
*************** _equalCreateExtensionStmt(CreateExtensio
*** 1679,1685 ****
  }
  
  static bool
! _equalAlterExtensionStmt(AlterExtensionStmt *a, AlterExtensionStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_NODE_FIELD(options);
--- 1679,1685 ----
  }
  
  static bool
! _equalAlterExtensionStmt(const AlterExtensionStmt *a, const AlterExtensionStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_NODE_FIELD(options);
*************** _equalAlterExtensionStmt(AlterExtensionS
*** 1688,1694 ****
  }
  
  static bool
! _equalAlterExtensionContentsStmt(AlterExtensionContentsStmt *a, AlterExtensionContentsStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_SCALAR_FIELD(action);
--- 1688,1694 ----
  }
  
  static bool
! _equalAlterExtensionContentsStmt(const AlterExtensionContentsStmt *a, const AlterExtensionContentsStmt *b)
  {
  	COMPARE_STRING_FIELD(extname);
  	COMPARE_SCALAR_FIELD(action);
*************** _equalAlterExtensionContentsStmt(AlterEx
*** 1700,1706 ****
  }
  
  static bool
! _equalCreateFdwStmt(CreateFdwStmt *a, CreateFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_NODE_FIELD(func_options);
--- 1700,1706 ----
  }
  
  static bool
! _equalCreateFdwStmt(const CreateFdwStmt *a, const CreateFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_NODE_FIELD(func_options);
*************** _equalCreateFdwStmt(CreateFdwStmt *a, Cr
*** 1710,1716 ****
  }
  
  static bool
! _equalAlterFdwStmt(AlterFdwStmt *a, AlterFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_NODE_FIELD(func_options);
--- 1710,1716 ----
  }
  
  static bool
! _equalAlterFdwStmt(const AlterFdwStmt *a, const AlterFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_NODE_FIELD(func_options);
*************** _equalAlterFdwStmt(AlterFdwStmt *a, Alte
*** 1720,1726 ****
  }
  
  static bool
! _equalDropFdwStmt(DropFdwStmt *a, DropFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_SCALAR_FIELD(missing_ok);
--- 1720,1726 ----
  }
  
  static bool
! _equalDropFdwStmt(const DropFdwStmt *a, const DropFdwStmt *b)
  {
  	COMPARE_STRING_FIELD(fdwname);
  	COMPARE_SCALAR_FIELD(missing_ok);
*************** _equalDropFdwStmt(DropFdwStmt *a, DropFd
*** 1730,1736 ****
  }
  
  static bool
! _equalCreateForeignServerStmt(CreateForeignServerStmt *a, CreateForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_STRING_FIELD(servertype);
--- 1730,1736 ----
  }
  
  static bool
! _equalCreateForeignServerStmt(const CreateForeignServerStmt *a, const CreateForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_STRING_FIELD(servertype);
*************** _equalCreateForeignServerStmt(CreateFore
*** 1742,1748 ****
  }
  
  static bool
! _equalAlterForeignServerStmt(AlterForeignServerStmt *a, AlterForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_STRING_FIELD(version);
--- 1742,1748 ----
  }
  
  static bool
! _equalAlterForeignServerStmt(const AlterForeignServerStmt *a, const AlterForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_STRING_FIELD(version);
*************** _equalAlterForeignServerStmt(AlterForeig
*** 1753,1759 ****
  }
  
  static bool
! _equalDropForeignServerStmt(DropForeignServerStmt *a, DropForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_SCALAR_FIELD(missing_ok);
--- 1753,1759 ----
  }
  
  static bool
! _equalDropForeignServerStmt(const DropForeignServerStmt *a, const DropForeignServerStmt *b)
  {
  	COMPARE_STRING_FIELD(servername);
  	COMPARE_SCALAR_FIELD(missing_ok);
*************** _equalDropForeignServerStmt(DropForeignS
*** 1763,1769 ****
  }
  
  static bool
! _equalCreateUserMappingStmt(CreateUserMappingStmt *a, CreateUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
--- 1763,1769 ----
  }
  
  static bool
! _equalCreateUserMappingStmt(const CreateUserMappingStmt *a, const CreateUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
*************** _equalCreateUserMappingStmt(CreateUserMa
*** 1773,1779 ****
  }
  
  static bool
! _equalAlterUserMappingStmt(AlterUserMappingStmt *a, AlterUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
--- 1773,1779 ----
  }
  
  static bool
! _equalAlterUserMappingStmt(const AlterUserMappingStmt *a, const AlterUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
*************** _equalAlterUserMappingStmt(AlterUserMapp
*** 1783,1789 ****
  }
  
  static bool
! _equalDropUserMappingStmt(DropUserMappingStmt *a, DropUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
--- 1783,1789 ----
  }
  
  static bool
! _equalDropUserMappingStmt(const DropUserMappingStmt *a, const DropUserMappingStmt *b)
  {
  	COMPARE_STRING_FIELD(username);
  	COMPARE_STRING_FIELD(servername);
*************** _equalDropUserMappingStmt(DropUserMappin
*** 1793,1799 ****
  }
  
  static bool
! _equalCreateForeignTableStmt(CreateForeignTableStmt *a, CreateForeignTableStmt *b)
  {
  	if (!_equalCreateStmt(&a->base, &b->base))
  		return false;
--- 1793,1799 ----
  }
  
  static bool
! _equalCreateForeignTableStmt(const CreateForeignTableStmt *a, const CreateForeignTableStmt *b)
  {
  	if (!_equalCreateStmt(&a->base, &b->base))
  		return false;
*************** _equalCreateForeignTableStmt(CreateForei
*** 1805,1811 ****
  }
  
  static bool
! _equalCreateTrigStmt(CreateTrigStmt *a, CreateTrigStmt *b)
  {
  	COMPARE_STRING_FIELD(trigname);
  	COMPARE_NODE_FIELD(relation);
--- 1805,1811 ----
  }
  
  static bool
! _equalCreateTrigStmt(const CreateTrigStmt *a, const CreateTrigStmt *b)
  {
  	COMPARE_STRING_FIELD(trigname);
  	COMPARE_NODE_FIELD(relation);
*************** _equalCreateTrigStmt(CreateTrigStmt *a,
*** 1825,1831 ****
  }
  
  static bool
! _equalDropPropertyStmt(DropPropertyStmt *a, DropPropertyStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(property);
--- 1825,1831 ----
  }
  
  static bool
! _equalDropPropertyStmt(const DropPropertyStmt *a, const DropPropertyStmt *b)
  {
  	COMPARE_NODE_FIELD(relation);
  	COMPARE_STRING_FIELD(property);
*************** _equalDropPropertyStmt(DropPropertyStmt
*** 1837,1843 ****
  }
  
  static bool
! _equalCreatePLangStmt(CreatePLangStmt *a, CreatePLangStmt *b)
  {
  	COMPARE_SCALAR_FIELD(replace);
  	COMPARE_STRING_FIELD(plname);
--- 1837,1843 ----
  }
  
  static bool
! _equalCreatePLangStmt(const CreatePLangStmt *a, const CreatePLangStmt *b)
  {
  	COMPARE_SCALAR_FIELD(replace);
  	COMPARE_STRING_FIELD(plname);
*************** _equalCreatePLangStmt(CreatePLangStmt *a
*** 1850,1856 ****
  }
  
  static bool
! _equalDropPLangStmt(DropPLangStmt *a, DropPLangStmt *b)
  {
  	COMPARE_STRING_FIELD(plname);
  	COMPARE_SCALAR_FIELD(behavior);
--- 1850,1856 ----
  }
  
  static bool
! _equalDropPLangStmt(const DropPLangStmt *a, const DropPLangStmt *b)
  {
  	COMPARE_STRING_FIELD(plname);
  	COMPARE_SCALAR_FIELD(behavior);
*************** _equalDropPLangStmt(DropPLangStmt *a, Dr
*** 1860,1866 ****
  }
  
  static bool
! _equalCreateRoleStmt(CreateRoleStmt *a, CreateRoleStmt *b)
  {
  	COMPARE_SCALAR_FIELD(stmt_type);
  	COMPARE_STRING_FIELD(role);
--- 1860,1866 ----
  }
  
  static bool
! _equalCreateRoleStmt(const CreateRoleStmt *a, const CreateRoleStmt *b)
  {
  	COMPARE_SCALAR_FIELD(stmt_type);
  	COMPARE_STRING_FIELD(role);
*************** _equalCreateRoleStmt(CreateRoleStmt *a,
*** 1870,1876 ****
  }
  
  static bool
! _equalAlterRoleStmt(AlterRoleStmt *a, AlterRoleStmt *b)
  {
  	COMPARE_STRING_FIELD(role);
  	COMPARE_NODE_FIELD(options);
--- 1870,1876 ----
  }
  
  static bool
! _equalAlterRoleStmt(const AlterRoleStmt *a, const AlterRoleStmt *b)
  {
  	COMPARE_STRING_FIELD(role);
  	COMPARE_NODE_FIELD(options);
*************** _equalAlterRoleStmt(AlterRoleStmt *a, Al
*** 1880,1886 ****
  }
  
  static bool
! _equalAlterRoleSetStmt(AlterRoleSetStmt *a, AlterRoleSetStmt *b)
  {
  	COMPARE_STRING_FIELD(role);
  	COMPARE_STRING_FIELD(database);
--- 1880,1886 ----
  }
  
  static bool
! _equalAlterRoleSetStmt(const AlterRoleSetStmt *a, const AlterRoleSetStmt *b)
  {
  	COMPARE_STRING_FIELD(role);
  	COMPARE_STRING_FIELD(database);
*************** _equalAlterRoleSetStmt(AlterRoleSetStmt
*** 1890,1896 ****
  }
  
  static bool
! _equalDropRoleStmt(DropRoleStmt *a, DropRoleStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_SCALAR_FIELD(missing_ok);
--- 1890,1896 ----
  }
  
  static bool
! _equalDropRoleStmt(const DropRoleStmt *a, const DropRoleStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_SCALAR_FIELD(missing_ok);
*************** _equalDropRoleStmt(DropRoleStmt *a, Drop
*** 1899,1905 ****
  }
  
  static bool
! _equalLockStmt(LockStmt *a, LockStmt *b)
  {
  	COMPARE_NODE_FIELD(relations);
  	COMPARE_SCALAR_FIELD(mode);
--- 1899,1905 ----
  }
  
  static bool
! _equalLockStmt(const LockStmt *a, const LockStmt *b)
  {
  	COMPARE_NODE_FIELD(relations);
  	COMPARE_SCALAR_FIELD(mode);
*************** _equalLockStmt(LockStmt *a, LockStmt *b)
*** 1909,1915 ****
  }
  
  static bool
! _equalConstraintsSetStmt(ConstraintsSetStmt *a, ConstraintsSetStmt *b)
  {
  	COMPARE_NODE_FIELD(constraints);
  	COMPARE_SCALAR_FIELD(deferred);
--- 1909,1915 ----
  }
  
  static bool
! _equalConstraintsSetStmt(const ConstraintsSetStmt *a, const ConstraintsSetStmt *b)
  {
  	COMPARE_NODE_FIELD(constraints);
  	COMPARE_SCALAR_FIELD(deferred);
*************** _equalConstraintsSetStmt(ConstraintsSetS
*** 1918,1924 ****
  }
  
  static bool
! _equalReindexStmt(ReindexStmt *a, ReindexStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(relation);
--- 1918,1924 ----
  }
  
  static bool
! _equalReindexStmt(const ReindexStmt *a, const ReindexStmt *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(relation);
*************** _equalReindexStmt(ReindexStmt *a, Reinde
*** 1930,1936 ****
  }
  
  static bool
! _equalCreateSchemaStmt(CreateSchemaStmt *a, CreateSchemaStmt *b)
  {
  	COMPARE_STRING_FIELD(schemaname);
  	COMPARE_STRING_FIELD(authid);
--- 1930,1936 ----
  }
  
  static bool
! _equalCreateSchemaStmt(const CreateSchemaStmt *a, const CreateSchemaStmt *b)
  {
  	COMPARE_STRING_FIELD(schemaname);
  	COMPARE_STRING_FIELD(authid);
*************** _equalCreateSchemaStmt(CreateSchemaStmt
*** 1940,1946 ****
  }
  
  static bool
! _equalCreateConversionStmt(CreateConversionStmt *a, CreateConversionStmt *b)
  {
  	COMPARE_NODE_FIELD(conversion_name);
  	COMPARE_STRING_FIELD(for_encoding_name);
--- 1940,1946 ----
  }
  
  static bool
! _equalCreateConversionStmt(const CreateConversionStmt *a, const CreateConversionStmt *b)
  {
  	COMPARE_NODE_FIELD(conversion_name);
  	COMPARE_STRING_FIELD(for_encoding_name);
*************** _equalCreateConversionStmt(CreateConvers
*** 1952,1958 ****
  }
  
  static bool
! _equalCreateCastStmt(CreateCastStmt *a, CreateCastStmt *b)
  {
  	COMPARE_NODE_FIELD(sourcetype);
  	COMPARE_NODE_FIELD(targettype);
--- 1952,1958 ----
  }
  
  static bool
! _equalCreateCastStmt(const CreateCastStmt *a, const CreateCastStmt *b)
  {
  	COMPARE_NODE_FIELD(sourcetype);
  	COMPARE_NODE_FIELD(targettype);
*************** _equalCreateCastStmt(CreateCastStmt *a,
*** 1964,1970 ****
  }
  
  static bool
! _equalDropCastStmt(DropCastStmt *a, DropCastStmt *b)
  {
  	COMPARE_NODE_FIELD(sourcetype);
  	COMPARE_NODE_FIELD(targettype);
--- 1964,1970 ----
  }
  
  static bool
! _equalDropCastStmt(const DropCastStmt *a, const DropCastStmt *b)
  {
  	COMPARE_NODE_FIELD(sourcetype);
  	COMPARE_NODE_FIELD(targettype);
*************** _equalDropCastStmt(DropCastStmt *a, Drop
*** 1975,1981 ****
  }
  
  static bool
! _equalPrepareStmt(PrepareStmt *a, PrepareStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(argtypes);
--- 1975,1981 ----
  }
  
  static bool
! _equalPrepareStmt(const PrepareStmt *a, const PrepareStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(argtypes);
*************** _equalPrepareStmt(PrepareStmt *a, Prepar
*** 1985,1991 ****
  }
  
  static bool
! _equalExecuteStmt(ExecuteStmt *a, ExecuteStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(into);
--- 1985,1991 ----
  }
  
  static bool
! _equalExecuteStmt(const ExecuteStmt *a, const ExecuteStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(into);
*************** _equalExecuteStmt(ExecuteStmt *a, Execut
*** 1995,2001 ****
  }
  
  static bool
! _equalDeallocateStmt(DeallocateStmt *a, DeallocateStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  
--- 1995,2001 ----
  }
  
  static bool
! _equalDeallocateStmt(const DeallocateStmt *a, const DeallocateStmt *b)
  {
  	COMPARE_STRING_FIELD(name);
  
*************** _equalDeallocateStmt(DeallocateStmt *a,
*** 2003,2009 ****
  }
  
  static bool
! _equalDropOwnedStmt(DropOwnedStmt *a, DropOwnedStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_SCALAR_FIELD(behavior);
--- 2003,2009 ----
  }
  
  static bool
! _equalDropOwnedStmt(const DropOwnedStmt *a, const DropOwnedStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_SCALAR_FIELD(behavior);
*************** _equalDropOwnedStmt(DropOwnedStmt *a, Dr
*** 2012,2018 ****
  }
  
  static bool
! _equalReassignOwnedStmt(ReassignOwnedStmt *a, ReassignOwnedStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_NODE_FIELD(newrole);
--- 2012,2018 ----
  }
  
  static bool
! _equalReassignOwnedStmt(const ReassignOwnedStmt *a, const ReassignOwnedStmt *b)
  {
  	COMPARE_NODE_FIELD(roles);
  	COMPARE_NODE_FIELD(newrole);
*************** _equalReassignOwnedStmt(ReassignOwnedStm
*** 2021,2027 ****
  }
  
  static bool
! _equalAlterTSDictionaryStmt(AlterTSDictionaryStmt *a, AlterTSDictionaryStmt *b)
  {
  	COMPARE_NODE_FIELD(dictname);
  	COMPARE_NODE_FIELD(options);
--- 2021,2027 ----
  }
  
  static bool
! _equalAlterTSDictionaryStmt(const AlterTSDictionaryStmt *a, const AlterTSDictionaryStmt *b)
  {
  	COMPARE_NODE_FIELD(dictname);
  	COMPARE_NODE_FIELD(options);
*************** _equalAlterTSDictionaryStmt(AlterTSDicti
*** 2030,2037 ****
  }
  
  static bool
! _equalAlterTSConfigurationStmt(AlterTSConfigurationStmt *a,
! 							   AlterTSConfigurationStmt *b)
  {
  	COMPARE_NODE_FIELD(cfgname);
  	COMPARE_NODE_FIELD(tokentype);
--- 2030,2037 ----
  }
  
  static bool
! _equalAlterTSConfigurationStmt(const AlterTSConfigurationStmt *a,
! 							   const AlterTSConfigurationStmt *b)
  {
  	COMPARE_NODE_FIELD(cfgname);
  	COMPARE_NODE_FIELD(tokentype);
*************** _equalAlterTSConfigurationStmt(AlterTSCo
*** 2044,2050 ****
  }
  
  static bool
! _equalAExpr(A_Expr *a, A_Expr *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(name);
--- 2044,2050 ----
  }
  
  static bool
! _equalAExpr(const A_Expr *a, const A_Expr *b)
  {
  	COMPARE_SCALAR_FIELD(kind);
  	COMPARE_NODE_FIELD(name);
*************** _equalAExpr(A_Expr *a, A_Expr *b)
*** 2056,2062 ****
  }
  
  static bool
! _equalColumnRef(ColumnRef *a, ColumnRef *b)
  {
  	COMPARE_NODE_FIELD(fields);
  	COMPARE_LOCATION_FIELD(location);
--- 2056,2062 ----
  }
  
  static bool
! _equalColumnRef(const ColumnRef *a, const ColumnRef *b)
  {
  	COMPARE_NODE_FIELD(fields);
  	COMPARE_LOCATION_FIELD(location);
*************** _equalColumnRef(ColumnRef *a, ColumnRef
*** 2065,2071 ****
  }
  
  static bool
! _equalParamRef(ParamRef *a, ParamRef *b)
  {
  	COMPARE_SCALAR_FIELD(number);
  	COMPARE_LOCATION_FIELD(location);
--- 2065,2071 ----
  }
  
  static bool
! _equalParamRef(const ParamRef *a, const ParamRef *b)
  {
  	COMPARE_SCALAR_FIELD(number);
  	COMPARE_LOCATION_FIELD(location);
*************** _equalParamRef(ParamRef *a, ParamRef *b)
*** 2074,2080 ****
  }
  
  static bool
! _equalAConst(A_Const *a, A_Const *b)
  {
  	if (!equal(&a->val, &b->val))		/* hack for in-line Value field */
  		return false;
--- 2074,2080 ----
  }
  
  static bool
! _equalAConst(const A_Const *a, const A_Const *b)
  {
  	if (!equal(&a->val, &b->val))		/* hack for in-line Value field */
  		return false;
*************** _equalAConst(A_Const *a, A_Const *b)
*** 2084,2090 ****
  }
  
  static bool
! _equalFuncCall(FuncCall *a, FuncCall *b)
  {
  	COMPARE_NODE_FIELD(funcname);
  	COMPARE_NODE_FIELD(args);
--- 2084,2090 ----
  }
  
  static bool
! _equalFuncCall(const FuncCall *a, const FuncCall *b)
  {
  	COMPARE_NODE_FIELD(funcname);
  	COMPARE_NODE_FIELD(args);
*************** _equalFuncCall(FuncCall *a, FuncCall *b)
*** 2099,2111 ****
  }
  
  static bool
! _equalAStar(A_Star *a, A_Star *b)
  {
  	return true;
  }
  
  static bool
! _equalAIndices(A_Indices *a, A_Indices *b)
  {
  	COMPARE_NODE_FIELD(lidx);
  	COMPARE_NODE_FIELD(uidx);
--- 2099,2111 ----
  }
  
  static bool
! _equalAStar(const A_Star *a, const A_Star *b)
  {
  	return true;
  }
  
  static bool
! _equalAIndices(const A_Indices *a, const A_Indices *b)
  {
  	COMPARE_NODE_FIELD(lidx);
  	COMPARE_NODE_FIELD(uidx);
*************** _equalAIndices(A_Indices *a, A_Indices *
*** 2114,2120 ****
  }
  
  static bool
! _equalA_Indirection(A_Indirection *a, A_Indirection *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(indirection);
--- 2114,2120 ----
  }
  
  static bool
! _equalA_Indirection(const A_Indirection *a, const A_Indirection *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(indirection);
*************** _equalA_Indirection(A_Indirection *a, A_
*** 2123,2129 ****
  }
  
  static bool
! _equalA_ArrayExpr(A_ArrayExpr *a, A_ArrayExpr *b)
  {
  	COMPARE_NODE_FIELD(elements);
  	COMPARE_LOCATION_FIELD(location);
--- 2123,2129 ----
  }
  
  static bool
! _equalA_ArrayExpr(const A_ArrayExpr *a, const A_ArrayExpr *b)
  {
  	COMPARE_NODE_FIELD(elements);
  	COMPARE_LOCATION_FIELD(location);
*************** _equalA_ArrayExpr(A_ArrayExpr *a, A_Arra
*** 2132,2138 ****
  }
  
  static bool
! _equalResTarget(ResTarget *a, ResTarget *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(indirection);
--- 2132,2138 ----
  }
  
  static bool
! _equalResTarget(const ResTarget *a, const ResTarget *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(indirection);
*************** _equalResTarget(ResTarget *a, ResTarget
*** 2143,2149 ****
  }
  
  static bool
! _equalTypeName(TypeName *a, TypeName *b)
  {
  	COMPARE_NODE_FIELD(names);
  	COMPARE_SCALAR_FIELD(typeOid);
--- 2143,2149 ----
  }
  
  static bool
! _equalTypeName(const TypeName *a, const TypeName *b)
  {
  	COMPARE_NODE_FIELD(names);
  	COMPARE_SCALAR_FIELD(typeOid);
*************** _equalTypeName(TypeName *a, TypeName *b)
*** 2158,2164 ****
  }
  
  static bool
! _equalTypeCast(TypeCast *a, TypeCast *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(typeName);
--- 2158,2164 ----
  }
  
  static bool
! _equalTypeCast(const TypeCast *a, const TypeCast *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(typeName);
*************** _equalTypeCast(TypeCast *a, TypeCast *b)
*** 2168,2174 ****
  }
  
  static bool
! _equalCollateClause(CollateClause *a, CollateClause *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(collname);
--- 2168,2174 ----
  }
  
  static bool
! _equalCollateClause(const CollateClause *a, const CollateClause *b)
  {
  	COMPARE_NODE_FIELD(arg);
  	COMPARE_NODE_FIELD(collname);
*************** _equalCollateClause(CollateClause *a, Co
*** 2178,2184 ****
  }
  
  static bool
! _equalSortBy(SortBy *a, SortBy *b)
  {
  	COMPARE_NODE_FIELD(node);
  	COMPARE_SCALAR_FIELD(sortby_dir);
--- 2178,2184 ----
  }
  
  static bool
! _equalSortBy(const SortBy *a, const SortBy *b)
  {
  	COMPARE_NODE_FIELD(node);
  	COMPARE_SCALAR_FIELD(sortby_dir);
*************** _equalSortBy(SortBy *a, SortBy *b)
*** 2190,2196 ****
  }
  
  static bool
! _equalWindowDef(WindowDef *a, WindowDef *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_STRING_FIELD(refname);
--- 2190,2196 ----
  }
  
  static bool
! _equalWindowDef(const WindowDef *a, const WindowDef *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_STRING_FIELD(refname);
*************** _equalWindowDef(WindowDef *a, WindowDef
*** 2205,2211 ****
  }
  
  static bool
! _equalRangeSubselect(RangeSubselect *a, RangeSubselect *b)
  {
  	COMPARE_NODE_FIELD(subquery);
  	COMPARE_NODE_FIELD(alias);
--- 2205,2211 ----
  }
  
  static bool
! _equalRangeSubselect(const RangeSubselect *a, const RangeSubselect *b)
  {
  	COMPARE_NODE_FIELD(subquery);
  	COMPARE_NODE_FIELD(alias);
*************** _equalRangeSubselect(RangeSubselect *a,
*** 2214,2220 ****
  }
  
  static bool
! _equalRangeFunction(RangeFunction *a, RangeFunction *b)
  {
  	COMPARE_NODE_FIELD(funccallnode);
  	COMPARE_NODE_FIELD(alias);
--- 2214,2220 ----
  }
  
  static bool
! _equalRangeFunction(const RangeFunction *a, const RangeFunction *b)
  {
  	COMPARE_NODE_FIELD(funccallnode);
  	COMPARE_NODE_FIELD(alias);
*************** _equalRangeFunction(RangeFunction *a, Ra
*** 2224,2230 ****
  }
  
  static bool
! _equalIndexElem(IndexElem *a, IndexElem *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(expr);
--- 2224,2230 ----
  }
  
  static bool
! _equalIndexElem(const IndexElem *a, const IndexElem *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_NODE_FIELD(expr);
*************** _equalIndexElem(IndexElem *a, IndexElem
*** 2238,2244 ****
  }
  
  static bool
! _equalColumnDef(ColumnDef *a, ColumnDef *b)
  {
  	COMPARE_STRING_FIELD(colname);
  	COMPARE_NODE_FIELD(typeName);
--- 2238,2244 ----
  }
  
  static bool
! _equalColumnDef(const ColumnDef *a, const ColumnDef *b)
  {
  	COMPARE_STRING_FIELD(colname);
  	COMPARE_NODE_FIELD(typeName);
*************** _equalColumnDef(ColumnDef *a, ColumnDef
*** 2257,2263 ****
  }
  
  static bool
! _equalConstraint(Constraint *a, Constraint *b)
  {
  	COMPARE_SCALAR_FIELD(contype);
  	COMPARE_STRING_FIELD(conname);
--- 2257,2263 ----
  }
  
  static bool
! _equalConstraint(const Constraint *a, const Constraint *b)
  {
  	COMPARE_SCALAR_FIELD(contype);
  	COMPARE_STRING_FIELD(conname);
*************** _equalConstraint(Constraint *a, Constrai
*** 2286,2292 ****
  }
  
  static bool
! _equalDefElem(DefElem *a, DefElem *b)
  {
  	COMPARE_STRING_FIELD(defnamespace);
  	COMPARE_STRING_FIELD(defname);
--- 2286,2292 ----
  }
  
  static bool
! _equalDefElem(const DefElem *a, const DefElem *b)
  {
  	COMPARE_STRING_FIELD(defnamespace);
  	COMPARE_STRING_FIELD(defname);
*************** _equalDefElem(DefElem *a, DefElem *b)
*** 2297,2303 ****
  }
  
  static bool
! _equalLockingClause(LockingClause *a, LockingClause *b)
  {
  	COMPARE_NODE_FIELD(lockedRels);
  	COMPARE_SCALAR_FIELD(forUpdate);
--- 2297,2303 ----
  }
  
  static bool
! _equalLockingClause(const LockingClause *a, const LockingClause *b)
  {
  	COMPARE_NODE_FIELD(lockedRels);
  	COMPARE_SCALAR_FIELD(forUpdate);
*************** _equalLockingClause(LockingClause *a, Lo
*** 2307,2313 ****
  }
  
  static bool
! _equalRangeTblEntry(RangeTblEntry *a, RangeTblEntry *b)
  {
  	COMPARE_SCALAR_FIELD(rtekind);
  	COMPARE_SCALAR_FIELD(relid);
--- 2307,2313 ----
  }
  
  static bool
! _equalRangeTblEntry(const RangeTblEntry *a, const RangeTblEntry *b)
  {
  	COMPARE_SCALAR_FIELD(rtekind);
  	COMPARE_SCALAR_FIELD(relid);
*************** _equalRangeTblEntry(RangeTblEntry *a, Ra
*** 2340,2346 ****
  }
  
  static bool
! _equalSortGroupClause(SortGroupClause *a, SortGroupClause *b)
  {
  	COMPARE_SCALAR_FIELD(tleSortGroupRef);
  	COMPARE_SCALAR_FIELD(eqop);
--- 2340,2346 ----
  }
  
  static bool
! _equalSortGroupClause(const SortGroupClause *a, const SortGroupClause *b)
  {
  	COMPARE_SCALAR_FIELD(tleSortGroupRef);
  	COMPARE_SCALAR_FIELD(eqop);
*************** _equalSortGroupClause(SortGroupClause *a
*** 2352,2358 ****
  }
  
  static bool
! _equalWindowClause(WindowClause *a, WindowClause *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_STRING_FIELD(refname);
--- 2352,2358 ----
  }
  
  static bool
! _equalWindowClause(const WindowClause *a, const WindowClause *b)
  {
  	COMPARE_STRING_FIELD(name);
  	COMPARE_STRING_FIELD(refname);
*************** _equalWindowClause(WindowClause *a, Wind
*** 2368,2374 ****
  }
  
  static bool
! _equalRowMarkClause(RowMarkClause *a, RowMarkClause *b)
  {
  	COMPARE_SCALAR_FIELD(rti);
  	COMPARE_SCALAR_FIELD(forUpdate);
--- 2368,2374 ----
  }
  
  static bool
! _equalRowMarkClause(const RowMarkClause *a, const RowMarkClause *b)
  {
  	COMPARE_SCALAR_FIELD(rti);
  	COMPARE_SCALAR_FIELD(forUpdate);
*************** _equalRowMarkClause(RowMarkClause *a, Ro
*** 2379,2385 ****
  }
  
  static bool
! _equalWithClause(WithClause *a, WithClause *b)
  {
  	COMPARE_NODE_FIELD(ctes);
  	COMPARE_SCALAR_FIELD(recursive);
--- 2379,2385 ----
  }
  
  static bool
! _equalWithClause(const WithClause *a, const WithClause *b)
  {
  	COMPARE_NODE_FIELD(ctes);
  	COMPARE_SCALAR_FIELD(recursive);
*************** _equalWithClause(WithClause *a, WithClau
*** 2389,2395 ****
  }
  
  static bool
! _equalCommonTableExpr(CommonTableExpr *a, CommonTableExpr *b)
  {
  	COMPARE_STRING_FIELD(ctename);
  	COMPARE_NODE_FIELD(aliascolnames);
--- 2389,2395 ----
  }
  
  static bool
! _equalCommonTableExpr(const CommonTableExpr *a, const CommonTableExpr *b)
  {
  	COMPARE_STRING_FIELD(ctename);
  	COMPARE_NODE_FIELD(aliascolnames);
*************** _equalCommonTableExpr(CommonTableExpr *a
*** 2406,2412 ****
  }
  
  static bool
! _equalXmlSerialize(XmlSerialize *a, XmlSerialize *b)
  {
  	COMPARE_SCALAR_FIELD(xmloption);
  	COMPARE_NODE_FIELD(expr);
--- 2406,2412 ----
  }
  
  static bool
! _equalXmlSerialize(const XmlSerialize *a, const XmlSerialize *b)
  {
  	COMPARE_SCALAR_FIELD(xmloption);
  	COMPARE_NODE_FIELD(expr);
*************** _equalXmlSerialize(XmlSerialize *a, XmlS
*** 2421,2430 ****
   */
  
  static bool
! _equalList(List *a, List *b)
  {
! 	ListCell   *item_a;
! 	ListCell   *item_b;
  
  	/*
  	 * Try to reject by simple scalar checks before grovelling through all the
--- 2421,2430 ----
   */
  
  static bool
! _equalList(const List *a, const List *b)
  {
! 	const ListCell   *item_a;
! 	const ListCell   *item_b;
  
  	/*
  	 * Try to reject by simple scalar checks before grovelling through all the
*************** _equalList(List *a, List *b)
*** 2480,2486 ****
   */
  
  static bool
! _equalValue(Value *a, Value *b)
  {
  	COMPARE_SCALAR_FIELD(type);
  
--- 2480,2486 ----
   */
  
  static bool
! _equalValue(const Value *a, const Value *b)
  {
  	COMPARE_SCALAR_FIELD(type);
  
*************** _equalValue(Value *a, Value *b)
*** 2510,2516 ****
   *	  returns whether two nodes are equal
   */
  bool
! equal(void *a, void *b)
  {
  	bool		retval;
  
--- 2510,2516 ----
   *	  returns whether two nodes are equal
   */
  bool
! equal(const void *a, const void *b)
  {
  	bool		retval;
  
diff --git a/src/backend/nodes/list.c b/src/backend/nodes/list.c
new file mode 100644
index d4684d3..add172e
*** a/src/backend/nodes/list.c
--- b/src/backend/nodes/list.c
***************
*** 31,37 ****
   * Check that the specified List is valid (so far as we can tell).
   */
  static void
! check_list_invariants(List *list)
  {
  	if (list == NIL)
  		return;
--- 31,37 ----
   * Check that the specified List is valid (so far as we can tell).
   */
  static void
! check_list_invariants(const List *list)
  {
  	if (list == NIL)
  		return;
*************** list_truncate(List *list, int new_size)
*** 383,389 ****
   * failure if there is no such cell.
   */
  static ListCell *
! list_nth_cell(List *list, int n)
  {
  	ListCell   *match;
  
--- 383,389 ----
   * failure if there is no such cell.
   */
  static ListCell *
! list_nth_cell(const List *list, int n)
  {
  	ListCell   *match;
  
*************** list_nth_cell(List *list, int n)
*** 407,413 ****
   * specified list. (List elements begin at 0.)
   */
  void *
! list_nth(List *list, int n)
  {
  	Assert(IsPointerList(list));
  	return lfirst(list_nth_cell(list, n));
--- 407,413 ----
   * specified list. (List elements begin at 0.)
   */
  void *
! list_nth(const List *list, int n)
  {
  	Assert(IsPointerList(list));
  	return lfirst(list_nth_cell(list, n));
*************** list_nth(List *list, int n)
*** 418,424 ****
   * specified list.
   */
  int
! list_nth_int(List *list, int n)
  {
  	Assert(IsIntegerList(list));
  	return lfirst_int(list_nth_cell(list, n));
--- 418,424 ----
   * specified list.
   */
  int
! list_nth_int(const List *list, int n)
  {
  	Assert(IsIntegerList(list));
  	return lfirst_int(list_nth_cell(list, n));
*************** list_nth_int(List *list, int n)
*** 429,435 ****
   * list.
   */
  Oid
! list_nth_oid(List *list, int n)
  {
  	Assert(IsOidList(list));
  	return lfirst_oid(list_nth_cell(list, n));
--- 429,435 ----
   * list.
   */
  Oid
! list_nth_oid(const List *list, int n)
  {
  	Assert(IsOidList(list));
  	return lfirst_oid(list_nth_cell(list, n));
*************** list_nth_oid(List *list, int n)
*** 441,449 ****
   * Node as 'datum'.
   */
  bool
! list_member(List *list, void *datum)
  {
! 	ListCell   *cell;
  
  	Assert(IsPointerList(list));
  	check_list_invariants(list);
--- 441,449 ----
   * Node as 'datum'.
   */
  bool
! list_member(const List *list, const void *datum)
  {
! 	const ListCell   *cell;
  
  	Assert(IsPointerList(list));
  	check_list_invariants(list);
*************** list_member(List *list, void *datum)
*** 462,470 ****
   * determined by using simple pointer comparison.
   */
  bool
! list_member_ptr(List *list, void *datum)
  {
! 	ListCell   *cell;
  
  	Assert(IsPointerList(list));
  	check_list_invariants(list);
--- 462,470 ----
   * determined by using simple pointer comparison.
   */
  bool
! list_member_ptr(const List *list, const void *datum)
  {
! 	const ListCell   *cell;
  
  	Assert(IsPointerList(list));
  	check_list_invariants(list);
*************** list_member_ptr(List *list, void *datum)
*** 482,490 ****
   * Return true iff the integer 'datum' is a member of the list.
   */
  bool
! list_member_int(List *list, int datum)
  {
! 	ListCell   *cell;
  
  	Assert(IsIntegerList(list));
  	check_list_invariants(list);
--- 482,490 ----
   * Return true iff the integer 'datum' is a member of the list.
   */
  bool
! list_member_int(const List *list, int datum)
  {
! 	const ListCell   *cell;
  
  	Assert(IsIntegerList(list));
  	check_list_invariants(list);
*************** list_member_int(List *list, int datum)
*** 502,510 ****
   * Return true iff the OID 'datum' is a member of the list.
   */
  bool
! list_member_oid(List *list, Oid datum)
  {
! 	ListCell   *cell;
  
  	Assert(IsOidList(list));
  	check_list_invariants(list);
--- 502,510 ----
   * Return true iff the OID 'datum' is a member of the list.
   */
  bool
! list_member_oid(const List *list, Oid datum)
  {
! 	const ListCell   *cell;
  
  	Assert(IsOidList(list));
  	check_list_invariants(list);
*************** list_delete_first(List *list)
*** 694,703 ****
   * performance bottleneck.
   */
  List *
! list_union(List *list1, List *list2)
  {
  	List	   *result;
! 	ListCell   *cell;
  
  	Assert(IsPointerList(list1));
  	Assert(IsPointerList(list2));
--- 694,703 ----
   * performance bottleneck.
   */
  List *
! list_union(const List *list1, const List *list2)
  {
  	List	   *result;
! 	const ListCell   *cell;
  
  	Assert(IsPointerList(list1));
  	Assert(IsPointerList(list2));
*************** list_union(List *list1, List *list2)
*** 718,727 ****
   * pointer comparison.
   */
  List *
! list_union_ptr(List *list1, List *list2)
  {
  	List	   *result;
! 	ListCell   *cell;
  
  	Assert(IsPointerList(list1));
  	Assert(IsPointerList(list2));
--- 718,727 ----
   * pointer comparison.
   */
  List *
! list_union_ptr(const List *list1, const List *list2)
  {
  	List	   *result;
! 	const ListCell   *cell;
  
  	Assert(IsPointerList(list1));
  	Assert(IsPointerList(list2));
*************** list_union_ptr(List *list1, List *list2)
*** 741,750 ****
   * This variant of list_union() operates upon lists of integers.
   */
  List *
! list_union_int(List *list1, List *list2)
  {
  	List	   *result;
! 	ListCell   *cell;
  
  	Assert(IsIntegerList(list1));
  	Assert(IsIntegerList(list2));
--- 741,750 ----
   * This variant of list_union() operates upon lists of integers.
   */
  List *
! list_union_int(const List *list1, const List *list2)
  {
  	List	   *result;
! 	const ListCell   *cell;
  
  	Assert(IsIntegerList(list1));
  	Assert(IsIntegerList(list2));
*************** list_union_int(List *list1, List *list2)
*** 764,773 ****
   * This variant of list_union() operates upon lists of OIDs.
   */
  List *
! list_union_oid(List *list1, List *list2)
  {
  	List	   *result;
! 	ListCell   *cell;
  
  	Assert(IsOidList(list1));
  	Assert(IsOidList(list2));
--- 764,773 ----
   * This variant of list_union() operates upon lists of OIDs.
   */
  List *
! list_union_oid(const List *list1, const List *list2)
  {
  	List	   *result;
! 	const ListCell   *cell;
  
  	Assert(IsOidList(list1));
  	Assert(IsOidList(list2));
*************** list_union_oid(List *list1, List *list2)
*** 797,806 ****
   * to in the result.
   */
  List *
! list_intersection(List *list1, List *list2)
  {
  	List	   *result;
! 	ListCell   *cell;
  
  	if (list1 == NIL || list2 == NIL)
  		return NIL;
--- 797,806 ----
   * to in the result.
   */
  List *
! list_intersection(const List *list1, const List *list2)
  {
  	List	   *result;
! 	const ListCell   *cell;
  
  	if (list1 == NIL || list2 == NIL)
  		return NIL;
*************** list_intersection(List *list1, List *lis
*** 829,837 ****
   * membership via equal()
   */
  List *
! list_difference(List *list1, List *list2)
  {
! 	ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsPointerList(list1));
--- 829,837 ----
   * membership via equal()
   */
  List *
! list_difference(const List *list1, const List *list2)
  {
! 	const ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsPointerList(list1));
*************** list_difference(List *list1, List *list2
*** 855,863 ****
   * simple pointer equality.
   */
  List *
! list_difference_ptr(List *list1, List *list2)
  {
! 	ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsPointerList(list1));
--- 855,863 ----
   * simple pointer equality.
   */
  List *
! list_difference_ptr(const List *list1, const List *list2)
  {
! 	const ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsPointerList(list1));
*************** list_difference_ptr(List *list1, List *l
*** 880,888 ****
   * This variant of list_difference() operates upon lists of integers.
   */
  List *
! list_difference_int(List *list1, List *list2)
  {
! 	ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsIntegerList(list1));
--- 880,888 ----
   * This variant of list_difference() operates upon lists of integers.
   */
  List *
! list_difference_int(const List *list1, const List *list2)
  {
! 	const ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsIntegerList(list1));
*************** list_difference_int(List *list1, List *l
*** 905,913 ****
   * This variant of list_difference() operates upon lists of OIDs.
   */
  List *
! list_difference_oid(List *list1, List *list2)
  {
! 	ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsOidList(list1));
--- 905,913 ----
   * This variant of list_difference() operates upon lists of OIDs.
   */
  List *
! list_difference_oid(const List *list1, const List *list2)
  {
! 	const ListCell   *cell;
  	List	   *result = NIL;
  
  	Assert(IsOidList(list1));
*************** list_free_deep(List *list)
*** 1131,1137 ****
   * Return a shallow copy of the specified list.
   */
  List *
! list_copy(List *oldlist)
  {
  	List	   *newlist;
  	ListCell   *newlist_prev;
--- 1131,1137 ----
   * Return a shallow copy of the specified list.
   */
  List *
! list_copy(const List *oldlist)
  {
  	List	   *newlist;
  	ListCell   *newlist_prev;
*************** list_copy(List *oldlist)
*** 1174,1180 ****
   * Return a shallow copy of the specified list, without the first N elements.
   */
  List *
! list_copy_tail(List *oldlist, int nskip)
  {
  	List	   *newlist;
  	ListCell   *newlist_prev;
--- 1174,1180 ----
   * Return a shallow copy of the specified list, without the first N elements.
   */
  List *
! list_copy_tail(const List *oldlist, int nskip)
  {
  	List	   *newlist;
  	ListCell   *newlist_prev;
*************** list_copy_tail(List *oldlist, int nskip)
*** 1230,1236 ****
  #ifndef USE_INLINE
  
  ListCell *
! list_head(List *l)
  {
  	return l ? l->head : NULL;
  }
--- 1230,1236 ----
  #ifndef USE_INLINE
  
  ListCell *
! list_head(const List *l)
  {
  	return l ? l->head : NULL;
  }
*************** list_tail(List *l)
*** 1242,1248 ****
  }
  
  int
! list_length(List *l)
  {
  	return l ? l->length : 0;
  }
--- 1242,1248 ----
  }
  
  int
! list_length(const List *l)
  {
  	return l ? l->length : 0;
  }
*************** list_length(List *l)
*** 1264,1273 ****
   * list_length() macro in order to avoid the overhead of a function
   * call.
   */
! int			length(List *list);
  
  int
! length(List *list)
  {
  	return list_length(list);
  }
--- 1264,1273 ----
   * list_length() macro in order to avoid the overhead of a function
   * call.
   */
! int			length(const List *list);
  
  int
! length(const List *list)
  {
  	return list_length(list);
  }
diff --git a/src/backend/nodes/nodeFuncs.c b/src/backend/nodes/nodeFuncs.c
new file mode 100644
index 0e57f6c..48b0590
*** a/src/backend/nodes/nodeFuncs.c
--- b/src/backend/nodes/nodeFuncs.c
*************** static int	leftmostLoc(int loc1, int loc
*** 32,38 ****
   *	  returns the Oid of the type of the expression's result.
   */
  Oid
! exprType(Node *expr)
  {
  	Oid			type;
  
--- 32,38 ----
   *	  returns the Oid of the type of the expression's result.
   */
  Oid
! exprType(const Node *expr)
  {
  	Oid			type;
  
*************** exprType(Node *expr)
*** 42,64 ****
  	switch (nodeTag(expr))
  	{
  		case T_Var:
! 			type = ((Var *) expr)->vartype;
  			break;
  		case T_Const:
! 			type = ((Const *) expr)->consttype;
  			break;
  		case T_Param:
! 			type = ((Param *) expr)->paramtype;
  			break;
  		case T_Aggref:
! 			type = ((Aggref *) expr)->aggtype;
  			break;
  		case T_WindowFunc:
! 			type = ((WindowFunc *) expr)->wintype;
  			break;
  		case T_ArrayRef:
  			{
! 				ArrayRef   *arrayref = (ArrayRef *) expr;
  
  				/* slice and/or store operations yield the array type */
  				if (arrayref->reflowerindexpr || arrayref->refassgnexpr)
--- 42,64 ----
  	switch (nodeTag(expr))
  	{
  		case T_Var:
! 			type = ((const Var *) expr)->vartype;
  			break;
  		case T_Const:
! 			type = ((const Const *) expr)->consttype;
  			break;
  		case T_Param:
! 			type = ((const Param *) expr)->paramtype;
  			break;
  		case T_Aggref:
! 			type = ((const Aggref *) expr)->aggtype;
  			break;
  		case T_WindowFunc:
! 			type = ((const WindowFunc *) expr)->wintype;
  			break;
  		case T_ArrayRef:
  			{
! 				const ArrayRef   *arrayref = (const ArrayRef *) expr;
  
  				/* slice and/or store operations yield the array type */
  				if (arrayref->reflowerindexpr || arrayref->refassgnexpr)
*************** exprType(Node *expr)
*** 68,86 ****
  			}
  			break;
  		case T_FuncExpr:
! 			type = ((FuncExpr *) expr)->funcresulttype;
  			break;
  		case T_NamedArgExpr:
! 			type = exprType((Node *) ((NamedArgExpr *) expr)->arg);
  			break;
  		case T_OpExpr:
! 			type = ((OpExpr *) expr)->opresulttype;
  			break;
  		case T_DistinctExpr:
! 			type = ((DistinctExpr *) expr)->opresulttype;
  			break;
  		case T_NullIfExpr:
! 			type = ((NullIfExpr *) expr)->opresulttype;
  			break;
  		case T_ScalarArrayOpExpr:
  			type = BOOLOID;
--- 68,86 ----
  			}
  			break;
  		case T_FuncExpr:
! 			type = ((const FuncExpr *) expr)->funcresulttype;
  			break;
  		case T_NamedArgExpr:
! 			type = exprType((Node *) ((const NamedArgExpr *) expr)->arg);
  			break;
  		case T_OpExpr:
! 			type = ((const OpExpr *) expr)->opresulttype;
  			break;
  		case T_DistinctExpr:
! 			type = ((const DistinctExpr *) expr)->opresulttype;
  			break;
  		case T_NullIfExpr:
! 			type = ((const NullIfExpr *) expr)->opresulttype;
  			break;
  		case T_ScalarArrayOpExpr:
  			type = BOOLOID;
*************** exprType(Node *expr)
*** 90,96 ****
  			break;
  		case T_SubLink:
  			{
! 				SubLink    *sublink = (SubLink *) expr;
  
  				if (sublink->subLinkType == EXPR_SUBLINK ||
  					sublink->subLinkType == ARRAY_SUBLINK)
--- 90,96 ----
  			break;
  		case T_SubLink:
  			{
! 				const SubLink    *sublink = (const SubLink *) expr;
  
  				if (sublink->subLinkType == EXPR_SUBLINK ||
  					sublink->subLinkType == ARRAY_SUBLINK)
*************** exprType(Node *expr)
*** 124,130 ****
  			break;
  		case T_SubPlan:
  			{
! 				SubPlan    *subplan = (SubPlan *) expr;
  
  				if (subplan->subLinkType == EXPR_SUBLINK ||
  					subplan->subLinkType == ARRAY_SUBLINK)
--- 124,130 ----
  			break;
  		case T_SubPlan:
  			{
! 				const SubPlan    *subplan = (const SubPlan *) expr;
  
  				if (subplan->subLinkType == EXPR_SUBLINK ||
  					subplan->subLinkType == ARRAY_SUBLINK)
*************** exprType(Node *expr)
*** 150,207 ****
  			break;
  		case T_AlternativeSubPlan:
  			{
! 				AlternativeSubPlan *asplan = (AlternativeSubPlan *) expr;
  
  				/* subplans should all return the same thing */
  				type = exprType((Node *) linitial(asplan->subplans));
  			}
  			break;
  		case T_FieldSelect:
! 			type = ((FieldSelect *) expr)->resulttype;
  			break;
  		case T_FieldStore:
! 			type = ((FieldStore *) expr)->resulttype;
  			break;
  		case T_RelabelType:
! 			type = ((RelabelType *) expr)->resulttype;
  			break;
  		case T_CoerceViaIO:
! 			type = ((CoerceViaIO *) expr)->resulttype;
  			break;
  		case T_ArrayCoerceExpr:
! 			type = ((ArrayCoerceExpr *) expr)->resulttype;
  			break;
  		case T_ConvertRowtypeExpr:
! 			type = ((ConvertRowtypeExpr *) expr)->resulttype;
  			break;
  		case T_CollateExpr:
! 			type = exprType((Node *) ((CollateExpr *) expr)->arg);
  			break;
  		case T_CaseExpr:
! 			type = ((CaseExpr *) expr)->casetype;
  			break;
  		case T_CaseTestExpr:
! 			type = ((CaseTestExpr *) expr)->typeId;
  			break;
  		case T_ArrayExpr:
! 			type = ((ArrayExpr *) expr)->array_typeid;
  			break;
  		case T_RowExpr:
! 			type = ((RowExpr *) expr)->row_typeid;
  			break;
  		case T_RowCompareExpr:
  			type = BOOLOID;
  			break;
  		case T_CoalesceExpr:
! 			type = ((CoalesceExpr *) expr)->coalescetype;
  			break;
  		case T_MinMaxExpr:
! 			type = ((MinMaxExpr *) expr)->minmaxtype;
  			break;
  		case T_XmlExpr:
! 			if (((XmlExpr *) expr)->op == IS_DOCUMENT)
  				type = BOOLOID;
! 			else if (((XmlExpr *) expr)->op == IS_XMLSERIALIZE)
  				type = TEXTOID;
  			else
  				type = XMLOID;
--- 150,207 ----
  			break;
  		case T_AlternativeSubPlan:
  			{
! 				const AlternativeSubPlan *asplan = (const AlternativeSubPlan *) expr;
  
  				/* subplans should all return the same thing */
  				type = exprType((Node *) linitial(asplan->subplans));
  			}
  			break;
  		case T_FieldSelect:
! 			type = ((const FieldSelect *) expr)->resulttype;
  			break;
  		case T_FieldStore:
! 			type = ((const FieldStore *) expr)->resulttype;
  			break;
  		case T_RelabelType:
! 			type = ((const RelabelType *) expr)->resulttype;
  			break;
  		case T_CoerceViaIO:
! 			type = ((const CoerceViaIO *) expr)->resulttype;
  			break;
  		case T_ArrayCoerceExpr:
! 			type = ((const ArrayCoerceExpr *) expr)->resulttype;
  			break;
  		case T_ConvertRowtypeExpr:
! 			type = ((const ConvertRowtypeExpr *) expr)->resulttype;
  			break;
  		case T_CollateExpr:
! 			type = exprType((Node *) ((const CollateExpr *) expr)->arg);
  			break;
  		case T_CaseExpr:
! 			type = ((const CaseExpr *) expr)->casetype;
  			break;
  		case T_CaseTestExpr:
! 			type = ((const CaseTestExpr *) expr)->typeId;
  			break;
  		case T_ArrayExpr:
! 			type = ((const ArrayExpr *) expr)->array_typeid;
  			break;
  		case T_RowExpr:
! 			type = ((const RowExpr *) expr)->row_typeid;
  			break;
  		case T_RowCompareExpr:
  			type = BOOLOID;
  			break;
  		case T_CoalesceExpr:
! 			type = ((const CoalesceExpr *) expr)->coalescetype;
  			break;
  		case T_MinMaxExpr:
! 			type = ((const MinMaxExpr *) expr)->minmaxtype;
  			break;
  		case T_XmlExpr:
! 			if (((const XmlExpr *) expr)->op == IS_DOCUMENT)
  				type = BOOLOID;
! 			else if (((const XmlExpr *) expr)->op == IS_XMLSERIALIZE)
  				type = TEXTOID;
  			else
  				type = XMLOID;
*************** exprType(Node *expr)
*** 213,231 ****
  			type = BOOLOID;
  			break;
  		case T_CoerceToDomain:
! 			type = ((CoerceToDomain *) expr)->resulttype;
  			break;
  		case T_CoerceToDomainValue:
! 			type = ((CoerceToDomainValue *) expr)->typeId;
  			break;
  		case T_SetToDefault:
! 			type = ((SetToDefault *) expr)->typeId;
  			break;
  		case T_CurrentOfExpr:
  			type = BOOLOID;
  			break;
  		case T_PlaceHolderVar:
! 			type = exprType((Node *) ((PlaceHolderVar *) expr)->phexpr);
  			break;
  		default:
  			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(expr));
--- 213,231 ----
  			type = BOOLOID;
  			break;
  		case T_CoerceToDomain:
! 			type = ((const CoerceToDomain *) expr)->resulttype;
  			break;
  		case T_CoerceToDomainValue:
! 			type = ((const CoerceToDomainValue *) expr)->typeId;
  			break;
  		case T_SetToDefault:
! 			type = ((const SetToDefault *) expr)->typeId;
  			break;
  		case T_CurrentOfExpr:
  			type = BOOLOID;
  			break;
  		case T_PlaceHolderVar:
! 			type = exprType((Node *) ((const PlaceHolderVar *) expr)->phexpr);
  			break;
  		default:
  			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(expr));
*************** exprType(Node *expr)
*** 241,247 ****
   *	  if it can be determined.	In many cases, it can't and we return -1.
   */
  int32
! exprTypmod(Node *expr)
  {
  	if (!expr)
  		return -1;
--- 241,247 ----
   *	  if it can be determined.	In many cases, it can't and we return -1.
   */
  int32
! exprTypmod(const Node *expr)
  {
  	if (!expr)
  		return -1;
*************** exprTypmod(Node *expr)
*** 249,262 ****
  	switch (nodeTag(expr))
  	{
  		case T_Var:
! 			return ((Var *) expr)->vartypmod;
  		case T_Const:
! 			return ((Const *) expr)->consttypmod;
  		case T_Param:
! 			return ((Param *) expr)->paramtypmod;
  		case T_ArrayRef:
  			/* typmod is the same for array or element */
! 			return ((ArrayRef *) expr)->reftypmod;
  		case T_FuncExpr:
  			{
  				int32		coercedTypmod;
--- 249,262 ----
  	switch (nodeTag(expr))
  	{
  		case T_Var:
! 			return ((const Var *) expr)->vartypmod;
  		case T_Const:
! 			return ((const Const *) expr)->consttypmod;
  		case T_Param:
! 			return ((const Param *) expr)->paramtypmod;
  		case T_ArrayRef:
  			/* typmod is the same for array or element */
! 			return ((const ArrayRef *) expr)->reftypmod;
  		case T_FuncExpr:
  			{
  				int32		coercedTypmod;
*************** exprTypmod(Node *expr)
*** 267,287 ****
  			}
  			break;
  		case T_NamedArgExpr:
! 			return exprTypmod((Node *) ((NamedArgExpr *) expr)->arg);
  		case T_NullIfExpr:
  			{
  				/*
  				 * Result is either first argument or NULL, so we can report
  				 * first argument's typmod if known.
  				 */
! 				NullIfExpr *nexpr = (NullIfExpr *) expr;
  
  				return exprTypmod((Node *) linitial(nexpr->args));
  			}
  			break;
  		case T_SubLink:
  			{
! 				SubLink    *sublink = (SubLink *) expr;
  
  				if (sublink->subLinkType == EXPR_SUBLINK ||
  					sublink->subLinkType == ARRAY_SUBLINK)
--- 267,287 ----
  			}
  			break;
  		case T_NamedArgExpr:
! 			return exprTypmod((Node *) ((const NamedArgExpr *) expr)->arg);
  		case T_NullIfExpr:
  			{
  				/*
  				 * Result is either first argument or NULL, so we can report
  				 * first argument's typmod if known.
  				 */
! 				const NullIfExpr *nexpr = (const NullIfExpr *) expr;
  
  				return exprTypmod((Node *) linitial(nexpr->args));
  			}
  			break;
  		case T_SubLink:
  			{
! 				const SubLink    *sublink = (const SubLink *) expr;
  
  				if (sublink->subLinkType == EXPR_SUBLINK ||
  					sublink->subLinkType == ARRAY_SUBLINK)
*************** exprTypmod(Node *expr)
*** 302,308 ****
  			break;
  		case T_SubPlan:
  			{
! 				SubPlan    *subplan = (SubPlan *) expr;
  
  				if (subplan->subLinkType == EXPR_SUBLINK ||
  					subplan->subLinkType == ARRAY_SUBLINK)
--- 302,308 ----
  			break;
  		case T_SubPlan:
  			{
! 				const SubPlan    *subplan = (const SubPlan *) expr;
  
  				if (subplan->subLinkType == EXPR_SUBLINK ||
  					subplan->subLinkType == ARRAY_SUBLINK)
*************** exprTypmod(Node *expr)
*** 320,346 ****
  			break;
  		case T_AlternativeSubPlan:
  			{
! 				AlternativeSubPlan *asplan = (AlternativeSubPlan *) expr;
  
  				/* subplans should all return the same thing */
  				return exprTypmod((Node *) linitial(asplan->subplans));
  			}
  			break;
  		case T_FieldSelect:
! 			return ((FieldSelect *) expr)->resulttypmod;
  		case T_RelabelType:
! 			return ((RelabelType *) expr)->resulttypmod;
  		case T_ArrayCoerceExpr:
! 			return ((ArrayCoerceExpr *) expr)->resulttypmod;
  		case T_CollateExpr:
! 			return exprTypmod((Node *) ((CollateExpr *) expr)->arg);
  		case T_CaseExpr:
  			{
  				/*
  				 * If all the alternatives agree on type/typmod, return that
  				 * typmod, else use -1
  				 */
! 				CaseExpr   *cexpr = (CaseExpr *) expr;
  				Oid			casetype = cexpr->casetype;
  				int32		typmod;
  				ListCell   *arg;
--- 320,346 ----
  			break;
  		case T_AlternativeSubPlan:
  			{
! 				const AlternativeSubPlan *asplan = (const AlternativeSubPlan *) expr;
  
  				/* subplans should all return the same thing */
  				return exprTypmod((Node *) linitial(asplan->subplans));
  			}
  			break;
  		case T_FieldSelect:
! 			return ((const FieldSelect *) expr)->resulttypmod;
  		case T_RelabelType:
! 			return ((const RelabelType *) expr)->resulttypmod;
  		case T_ArrayCoerceExpr:
! 			return ((const ArrayCoerceExpr *) expr)->resulttypmod;
  		case T_CollateExpr:
! 			return exprTypmod((Node *) ((const CollateExpr *) expr)->arg);
  		case T_CaseExpr:
  			{
  				/*
  				 * If all the alternatives agree on type/typmod, return that
  				 * typmod, else use -1
  				 */
! 				const CaseExpr   *cexpr = (const CaseExpr *) expr;
  				Oid			casetype = cexpr->casetype;
  				int32		typmod;
  				ListCell   *arg;
*************** exprTypmod(Node *expr)
*** 366,379 ****
  			}
  			break;
  		case T_CaseTestExpr:
! 			return ((CaseTestExpr *) expr)->typeMod;
  		case T_ArrayExpr:
  			{
  				/*
  				 * If all the elements agree on type/typmod, return that
  				 * typmod, else use -1
  				 */
! 				ArrayExpr  *arrayexpr = (ArrayExpr *) expr;
  				Oid			commontype;
  				int32		typmod;
  				ListCell   *elem;
--- 366,379 ----
  			}
  			break;
  		case T_CaseTestExpr:
! 			return ((const CaseTestExpr *) expr)->typeMod;
  		case T_ArrayExpr:
  			{
  				/*
  				 * If all the elements agree on type/typmod, return that
  				 * typmod, else use -1
  				 */
! 				const ArrayExpr  *arrayexpr = (const ArrayExpr *) expr;
  				Oid			commontype;
  				int32		typmod;
  				ListCell   *elem;
*************** exprTypmod(Node *expr)
*** 405,411 ****
  				 * If all the alternatives agree on type/typmod, return that
  				 * typmod, else use -1
  				 */
! 				CoalesceExpr *cexpr = (CoalesceExpr *) expr;
  				Oid			coalescetype = cexpr->coalescetype;
  				int32		typmod;
  				ListCell   *arg;
--- 405,411 ----
  				 * If all the alternatives agree on type/typmod, return that
  				 * typmod, else use -1
  				 */
! 				const CoalesceExpr *cexpr = (const CoalesceExpr *) expr;
  				Oid			coalescetype = cexpr->coalescetype;
  				int32		typmod;
  				ListCell   *arg;
*************** exprTypmod(Node *expr)
*** 433,439 ****
  				 * If all the alternatives agree on type/typmod, return that
  				 * typmod, else use -1
  				 */
! 				MinMaxExpr *mexpr = (MinMaxExpr *) expr;
  				Oid			minmaxtype = mexpr->minmaxtype;
  				int32		typmod;
  				ListCell   *arg;
--- 433,439 ----
  				 * If all the alternatives agree on type/typmod, return that
  				 * typmod, else use -1
  				 */
! 				const MinMaxExpr *mexpr = (const MinMaxExpr *) expr;
  				Oid			minmaxtype = mexpr->minmaxtype;
  				int32		typmod;
  				ListCell   *arg;
*************** exprTypmod(Node *expr)
*** 456,468 ****
  			}
  			break;
  		case T_CoerceToDomain:
! 			return ((CoerceToDomain *) expr)->resulttypmod;
  		case T_CoerceToDomainValue:
! 			return ((CoerceToDomainValue *) expr)->typeMod;
  		case T_SetToDefault:
! 			return ((SetToDefault *) expr)->typeMod;
  		case T_PlaceHolderVar:
! 			return exprTypmod((Node *) ((PlaceHolderVar *) expr)->phexpr);
  		default:
  			break;
  	}
--- 456,468 ----
  			}
  			break;
  		case T_CoerceToDomain:
! 			return ((const CoerceToDomain *) expr)->resulttypmod;
  		case T_CoerceToDomainValue:
! 			return ((const CoerceToDomainValue *) expr)->typeMod;
  		case T_SetToDefault:
! 			return ((const SetToDefault *) expr)->typeMod;
  		case T_PlaceHolderVar:
! 			return exprTypmod((Node *) ((const PlaceHolderVar *) expr)->phexpr);
  		default:
  			break;
  	}
*************** exprTypmod(Node *expr)
*** 481,487 ****
   * length coercion by this routine.
   */
  bool
! exprIsLengthCoercion(Node *expr, int32 *coercedTypmod)
  {
  	if (coercedTypmod != NULL)
  		*coercedTypmod = -1;	/* default result on failure */
--- 481,487 ----
   * length coercion by this routine.
   */
  bool
! exprIsLengthCoercion(const Node *expr, int32 *coercedTypmod)
  {
  	if (coercedTypmod != NULL)
  		*coercedTypmod = -1;	/* default result on failure */
*************** exprIsLengthCoercion(Node *expr, int32 *
*** 492,498 ****
  	 */
  	if (expr && IsA(expr, FuncExpr))
  	{
! 		FuncExpr   *func = (FuncExpr *) expr;
  		int			nargs;
  		Const	   *second_arg;
  
--- 492,498 ----
  	 */
  	if (expr && IsA(expr, FuncExpr))
  	{
! 		const FuncExpr   *func = (const FuncExpr *) expr;
  		int			nargs;
  		Const	   *second_arg;
  
*************** exprIsLengthCoercion(Node *expr, int32 *
*** 529,535 ****
  
  	if (expr && IsA(expr, ArrayCoerceExpr))
  	{
! 		ArrayCoerceExpr *acoerce = (ArrayCoerceExpr *) expr;
  
  		/* It's not a length coercion unless there's a nondefault typmod */
  		if (acoerce->resulttypmod < 0)
--- 529,535 ----
  
  	if (expr && IsA(expr, ArrayCoerceExpr))
  	{
! 		const ArrayCoerceExpr *acoerce = (const ArrayCoerceExpr *) expr;
  
  		/* It's not a length coercion unless there's a nondefault typmod */
  		if (acoerce->resulttypmod < 0)
*************** expression_returns_set_walker(Node *node
*** 632,638 ****
   * or vice versa, the two are different.
   */
  Oid
! exprCollation(Node *expr)
  {
  	Oid			coll;
  
--- 632,638 ----
   * or vice versa, the two are different.
   */
  Oid
! exprCollation(const Node *expr)
  {
  	Oid			coll;
  
*************** exprCollation(Node *expr)
*** 642,678 ****
  	switch (nodeTag(expr))
  	{
  		case T_Var:
! 			coll = ((Var *) expr)->varcollid;
  			break;
  		case T_Const:
! 			coll = ((Const *) expr)->constcollid;
  			break;
  		case T_Param:
! 			coll = ((Param *) expr)->paramcollid;
  			break;
  		case T_Aggref:
! 			coll = ((Aggref *) expr)->aggcollid;
  			break;
  		case T_WindowFunc:
! 			coll = ((WindowFunc *) expr)->wincollid;
  			break;
  		case T_ArrayRef:
! 			coll = ((ArrayRef *) expr)->refcollid;
  			break;
  		case T_FuncExpr:
! 			coll = ((FuncExpr *) expr)->funccollid;
  			break;
  		case T_NamedArgExpr:
! 			coll = exprCollation((Node *) ((NamedArgExpr *) expr)->arg);
  			break;
  		case T_OpExpr:
! 			coll = ((OpExpr *) expr)->opcollid;
  			break;
  		case T_DistinctExpr:
! 			coll = ((DistinctExpr *) expr)->opcollid;
  			break;
  		case T_NullIfExpr:
! 			coll = ((NullIfExpr *) expr)->opcollid;
  			break;
  		case T_ScalarArrayOpExpr:
  			coll = InvalidOid;	/* result is always boolean */
--- 642,678 ----
  	switch (nodeTag(expr))
  	{
  		case T_Var:
! 			coll = ((const Var *) expr)->varcollid;
  			break;
  		case T_Const:
! 			coll = ((const Const *) expr)->constcollid;
  			break;
  		case T_Param:
! 			coll = ((const Param *) expr)->paramcollid;
  			break;
  		case T_Aggref:
! 			coll = ((const Aggref *) expr)->aggcollid;
  			break;
  		case T_WindowFunc:
! 			coll = ((const WindowFunc *) expr)->wincollid;
  			break;
  		case T_ArrayRef:
! 			coll = ((const ArrayRef *) expr)->refcollid;
  			break;
  		case T_FuncExpr:
! 			coll = ((const FuncExpr *) expr)->funccollid;
  			break;
  		case T_NamedArgExpr:
! 			coll = exprCollation((Node *) ((const NamedArgExpr *) expr)->arg);
  			break;
  		case T_OpExpr:
! 			coll = ((const OpExpr *) expr)->opcollid;
  			break;
  		case T_DistinctExpr:
! 			coll = ((const DistinctExpr *) expr)->opcollid;
  			break;
  		case T_NullIfExpr:
! 			coll = ((const NullIfExpr *) expr)->opcollid;
  			break;
  		case T_ScalarArrayOpExpr:
  			coll = InvalidOid;	/* result is always boolean */
*************** exprCollation(Node *expr)
*** 682,688 ****
  			break;
  		case T_SubLink:
  			{
! 				SubLink    *sublink = (SubLink *) expr;
  
  				if (sublink->subLinkType == EXPR_SUBLINK ||
  					sublink->subLinkType == ARRAY_SUBLINK)
--- 682,688 ----
  			break;
  		case T_SubLink:
  			{
! 				const SubLink    *sublink = (const SubLink *) expr;
  
  				if (sublink->subLinkType == EXPR_SUBLINK ||
  					sublink->subLinkType == ARRAY_SUBLINK)
*************** exprCollation(Node *expr)
*** 708,714 ****
  			break;
  		case T_SubPlan:
  			{
! 				SubPlan    *subplan = (SubPlan *) expr;
  
  				if (subplan->subLinkType == EXPR_SUBLINK ||
  					subplan->subLinkType == ARRAY_SUBLINK)
--- 708,714 ----
  			break;
  		case T_SubPlan:
  			{
! 				const SubPlan    *subplan = (const SubPlan *) expr;
  
  				if (subplan->subLinkType == EXPR_SUBLINK ||
  					subplan->subLinkType == ARRAY_SUBLINK)
*************** exprCollation(Node *expr)
*** 726,766 ****
  			break;
  		case T_AlternativeSubPlan:
  			{
! 				AlternativeSubPlan *asplan = (AlternativeSubPlan *) expr;
  
  				/* subplans should all return the same thing */
  				coll = exprCollation((Node *) linitial(asplan->subplans));
  			}
  			break;
  		case T_FieldSelect:
! 			coll = ((FieldSelect *) expr)->resultcollid;
  			break;
  		case T_FieldStore:
  			coll = InvalidOid;	/* result is always composite */
  			break;
  		case T_RelabelType:
! 			coll = ((RelabelType *) expr)->resultcollid;
  			break;
  		case T_CoerceViaIO:
! 			coll = ((CoerceViaIO *) expr)->resultcollid;
  			break;
  		case T_ArrayCoerceExpr:
! 			coll = ((ArrayCoerceExpr *) expr)->resultcollid;
  			break;
  		case T_ConvertRowtypeExpr:
  			coll = InvalidOid;	/* result is always composite */
  			break;
  		case T_CollateExpr:
! 			coll = ((CollateExpr *) expr)->collOid;
  			break;
  		case T_CaseExpr:
! 			coll = ((CaseExpr *) expr)->casecollid;
  			break;
  		case T_CaseTestExpr:
! 			coll = ((CaseTestExpr *) expr)->collation;
  			break;
  		case T_ArrayExpr:
! 			coll = ((ArrayExpr *) expr)->array_collid;
  			break;
  		case T_RowExpr:
  			coll = InvalidOid;	/* result is always composite */
--- 726,766 ----
  			break;
  		case T_AlternativeSubPlan:
  			{
! 				const AlternativeSubPlan *asplan = (const AlternativeSubPlan *) expr;
  
  				/* subplans should all return the same thing */
  				coll = exprCollation((Node *) linitial(asplan->subplans));
  			}
  			break;
  		case T_FieldSelect:
! 			coll = ((const FieldSelect *) expr)->resultcollid;
  			break;
  		case T_FieldStore:
  			coll = InvalidOid;	/* result is always composite */
  			break;
  		case T_RelabelType:
! 			coll = ((const RelabelType *) expr)->resultcollid;
  			break;
  		case T_CoerceViaIO:
! 			coll = ((const CoerceViaIO *) expr)->resultcollid;
  			break;
  		case T_ArrayCoerceExpr:
! 			coll = ((const ArrayCoerceExpr *) expr)->resultcollid;
  			break;
  		case T_ConvertRowtypeExpr:
  			coll = InvalidOid;	/* result is always composite */
  			break;
  		case T_CollateExpr:
! 			coll = ((const CollateExpr *) expr)->collOid;
  			break;
  		case T_CaseExpr:
! 			coll = ((const CaseExpr *) expr)->casecollid;
  			break;
  		case T_CaseTestExpr:
! 			coll = ((const CaseTestExpr *) expr)->collation;
  			break;
  		case T_ArrayExpr:
! 			coll = ((const ArrayExpr *) expr)->array_collid;
  			break;
  		case T_RowExpr:
  			coll = InvalidOid;	/* result is always composite */
*************** exprCollation(Node *expr)
*** 769,778 ****
  			coll = InvalidOid;	/* result is always boolean */
  			break;
  		case T_CoalesceExpr:
! 			coll = ((CoalesceExpr *) expr)->coalescecollid;
  			break;
  		case T_MinMaxExpr:
! 			coll = ((MinMaxExpr *) expr)->minmaxcollid;
  			break;
  		case T_XmlExpr:
  
--- 769,778 ----
  			coll = InvalidOid;	/* result is always boolean */
  			break;
  		case T_CoalesceExpr:
! 			coll = ((const CoalesceExpr *) expr)->coalescecollid;
  			break;
  		case T_MinMaxExpr:
! 			coll = ((const MinMaxExpr *) expr)->minmaxcollid;
  			break;
  		case T_XmlExpr:
  
*************** exprCollation(Node *expr)
*** 781,787 ****
  			 * collation is always default.  The other cases return boolean or
  			 * XML, which are non-collatable.
  			 */
! 			if (((XmlExpr *) expr)->op == IS_XMLSERIALIZE)
  				coll = DEFAULT_COLLATION_OID;
  			else
  				coll = InvalidOid;
--- 781,787 ----
  			 * collation is always default.  The other cases return boolean or
  			 * XML, which are non-collatable.
  			 */
! 			if (((const XmlExpr *) expr)->op == IS_XMLSERIALIZE)
  				coll = DEFAULT_COLLATION_OID;
  			else
  				coll = InvalidOid;
*************** exprCollation(Node *expr)
*** 793,811 ****
  			coll = InvalidOid;	/* result is always boolean */
  			break;
  		case T_CoerceToDomain:
! 			coll = ((CoerceToDomain *) expr)->resultcollid;
  			break;
  		case T_CoerceToDomainValue:
! 			coll = ((CoerceToDomainValue *) expr)->collation;
  			break;
  		case T_SetToDefault:
! 			coll = ((SetToDefault *) expr)->collation;
  			break;
  		case T_CurrentOfExpr:
  			coll = InvalidOid;	/* result is always boolean */
  			break;
  		case T_PlaceHolderVar:
! 			coll = exprCollation((Node *) ((PlaceHolderVar *) expr)->phexpr);
  			break;
  		default:
  			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(expr));
--- 793,811 ----
  			coll = InvalidOid;	/* result is always boolean */
  			break;
  		case T_CoerceToDomain:
! 			coll = ((const CoerceToDomain *) expr)->resultcollid;
  			break;
  		case T_CoerceToDomainValue:
! 			coll = ((const CoerceToDomainValue *) expr)->collation;
  			break;
  		case T_SetToDefault:
! 			coll = ((const SetToDefault *) expr)->collation;
  			break;
  		case T_CurrentOfExpr:
  			coll = InvalidOid;	/* result is always boolean */
  			break;
  		case T_PlaceHolderVar:
! 			coll = exprCollation((Node *) ((const PlaceHolderVar *) expr)->phexpr);
  			break;
  		default:
  			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(expr));
*************** exprCollation(Node *expr)
*** 822,828 ****
   * Result is InvalidOid if the node type doesn't store this information.
   */
  Oid
! exprInputCollation(Node *expr)
  {
  	Oid			coll;
  
--- 822,828 ----
   * Result is InvalidOid if the node type doesn't store this information.
   */
  Oid
! exprInputCollation(const Node *expr)
  {
  	Oid			coll;
  
*************** exprInputCollation(Node *expr)
*** 832,859 ****
  	switch (nodeTag(expr))
  	{
  		case T_Aggref:
! 			coll = ((Aggref *) expr)->inputcollid;
  			break;
  		case T_WindowFunc:
! 			coll = ((WindowFunc *) expr)->inputcollid;
  			break;
  		case T_FuncExpr:
! 			coll = ((FuncExpr *) expr)->inputcollid;
  			break;
  		case T_OpExpr:
! 			coll = ((OpExpr *) expr)->inputcollid;
  			break;
  		case T_DistinctExpr:
! 			coll = ((DistinctExpr *) expr)->inputcollid;
  			break;
  		case T_NullIfExpr:
! 			coll = ((NullIfExpr *) expr)->inputcollid;
  			break;
  		case T_ScalarArrayOpExpr:
! 			coll = ((ScalarArrayOpExpr *) expr)->inputcollid;
  			break;
  		case T_MinMaxExpr:
! 			coll = ((MinMaxExpr *) expr)->inputcollid;
  			break;
  		default:
  			coll = InvalidOid;
--- 832,859 ----
  	switch (nodeTag(expr))
  	{
  		case T_Aggref:
! 			coll = ((const Aggref *) expr)->inputcollid;
  			break;
  		case T_WindowFunc:
! 			coll = ((const WindowFunc *) expr)->inputcollid;
  			break;
  		case T_FuncExpr:
! 			coll = ((const FuncExpr *) expr)->inputcollid;
  			break;
  		case T_OpExpr:
! 			coll = ((const OpExpr *) expr)->inputcollid;
  			break;
  		case T_DistinctExpr:
! 			coll = ((const DistinctExpr *) expr)->inputcollid;
  			break;
  		case T_NullIfExpr:
! 			coll = ((const NullIfExpr *) expr)->inputcollid;
  			break;
  		case T_ScalarArrayOpExpr:
! 			coll = ((const ScalarArrayOpExpr *) expr)->inputcollid;
  			break;
  		case T_MinMaxExpr:
! 			coll = ((const MinMaxExpr *) expr)->inputcollid;
  			break;
  		default:
  			coll = InvalidOid;
*************** exprSetInputCollation(Node *expr, Oid in
*** 1078,1084 ****
   * known and unknown locations in a tree.
   */
  int
! exprLocation(Node *expr)
  {
  	int			loc;
  
--- 1078,1084 ----
   * known and unknown locations in a tree.
   */
  int
! exprLocation(const Node *expr)
  {
  	int			loc;
  
*************** exprLocation(Node *expr)
*** 1087,1118 ****
  	switch (nodeTag(expr))
  	{
  		case T_RangeVar:
! 			loc = ((RangeVar *) expr)->location;
  			break;
  		case T_Var:
! 			loc = ((Var *) expr)->location;
  			break;
  		case T_Const:
! 			loc = ((Const *) expr)->location;
  			break;
  		case T_Param:
! 			loc = ((Param *) expr)->location;
  			break;
  		case T_Aggref:
  			/* function name should always be the first thing */
! 			loc = ((Aggref *) expr)->location;
  			break;
  		case T_WindowFunc:
  			/* function name should always be the first thing */
! 			loc = ((WindowFunc *) expr)->location;
  			break;
  		case T_ArrayRef:
  			/* just use array argument's location */
! 			loc = exprLocation((Node *) ((ArrayRef *) expr)->refexpr);
  			break;
  		case T_FuncExpr:
  			{
! 				FuncExpr   *fexpr = (FuncExpr *) expr;
  
  				/* consider both function name and leftmost arg */
  				loc = leftmostLoc(fexpr->location,
--- 1087,1118 ----
  	switch (nodeTag(expr))
  	{
  		case T_RangeVar:
! 			loc = ((const RangeVar *) expr)->location;
  			break;
  		case T_Var:
! 			loc = ((const Var *) expr)->location;
  			break;
  		case T_Const:
! 			loc = ((const Const *) expr)->location;
  			break;
  		case T_Param:
! 			loc = ((const Param *) expr)->location;
  			break;
  		case T_Aggref:
  			/* function name should always be the first thing */
! 			loc = ((const Aggref *) expr)->location;
  			break;
  		case T_WindowFunc:
  			/* function name should always be the first thing */
! 			loc = ((const WindowFunc *) expr)->location;
  			break;
  		case T_ArrayRef:
  			/* just use array argument's location */
! 			loc = exprLocation((Node *) ((const ArrayRef *) expr)->refexpr);
  			break;
  		case T_FuncExpr:
  			{
! 				const FuncExpr   *fexpr = (const FuncExpr *) expr;
  
  				/* consider both function name and leftmost arg */
  				loc = leftmostLoc(fexpr->location,
*************** exprLocation(Node *expr)
*** 1121,1127 ****
  			break;
  		case T_NamedArgExpr:
  			{
! 				NamedArgExpr *na = (NamedArgExpr *) expr;
  
  				/* consider both argument name and value */
  				loc = leftmostLoc(na->location,
--- 1121,1127 ----
  			break;
  		case T_NamedArgExpr:
  			{
! 				const NamedArgExpr *na = (const NamedArgExpr *) expr;
  
  				/* consider both argument name and value */
  				loc = leftmostLoc(na->location,
*************** exprLocation(Node *expr)
*** 1132,1138 ****
  		case T_DistinctExpr:	/* struct-equivalent to OpExpr */
  		case T_NullIfExpr:		/* struct-equivalent to OpExpr */
  			{
! 				OpExpr	   *opexpr = (OpExpr *) expr;
  
  				/* consider both operator name and leftmost arg */
  				loc = leftmostLoc(opexpr->location,
--- 1132,1138 ----
  		case T_DistinctExpr:	/* struct-equivalent to OpExpr */
  		case T_NullIfExpr:		/* struct-equivalent to OpExpr */
  			{
! 				const OpExpr	   *opexpr = (const OpExpr *) expr;
  
  				/* consider both operator name and leftmost arg */
  				loc = leftmostLoc(opexpr->location,
*************** exprLocation(Node *expr)
*** 1141,1147 ****
  			break;
  		case T_ScalarArrayOpExpr:
  			{
! 				ScalarArrayOpExpr *saopexpr = (ScalarArrayOpExpr *) expr;
  
  				/* consider both operator name and leftmost arg */
  				loc = leftmostLoc(saopexpr->location,
--- 1141,1147 ----
  			break;
  		case T_ScalarArrayOpExpr:
  			{
! 				const ScalarArrayOpExpr *saopexpr = (const ScalarArrayOpExpr *) expr;
  
  				/* consider both operator name and leftmost arg */
  				loc = leftmostLoc(saopexpr->location,
*************** exprLocation(Node *expr)
*** 1150,1156 ****
  			break;
  		case T_BoolExpr:
  			{
! 				BoolExpr   *bexpr = (BoolExpr *) expr;
  
  				/*
  				 * Same as above, to handle either NOT or AND/OR.  We can't
--- 1150,1156 ----
  			break;
  		case T_BoolExpr:
  			{
! 				const BoolExpr   *bexpr = (const BoolExpr *) expr;
  
  				/*
  				 * Same as above, to handle either NOT or AND/OR.  We can't
*************** exprLocation(Node *expr)
*** 1163,1169 ****
  			break;
  		case T_SubLink:
  			{
! 				SubLink    *sublink = (SubLink *) expr;
  
  				/* check the testexpr, if any, and the operator/keyword */
  				loc = leftmostLoc(exprLocation(sublink->testexpr),
--- 1163,1169 ----
  			break;
  		case T_SubLink:
  			{
! 				const SubLink    *sublink = (const SubLink *) expr;
  
  				/* check the testexpr, if any, and the operator/keyword */
  				loc = leftmostLoc(exprLocation(sublink->testexpr),
*************** exprLocation(Node *expr)
*** 1172,1186 ****
  			break;
  		case T_FieldSelect:
  			/* just use argument's location */
! 			loc = exprLocation((Node *) ((FieldSelect *) expr)->arg);
  			break;
  		case T_FieldStore:
  			/* just use argument's location */
! 			loc = exprLocation((Node *) ((FieldStore *) expr)->arg);
  			break;
  		case T_RelabelType:
  			{
! 				RelabelType *rexpr = (RelabelType *) expr;
  
  				/* Much as above */
  				loc = leftmostLoc(rexpr->location,
--- 1172,1186 ----
  			break;
  		case T_FieldSelect:
  			/* just use argument's location */
! 			loc = exprLocation((Node *) ((const FieldSelect *) expr)->arg);
  			break;
  		case T_FieldStore:
  			/* just use argument's location */
! 			loc = exprLocation((Node *) ((const FieldStore *) expr)->arg);
  			break;
  		case T_RelabelType:
  			{
! 				const RelabelType *rexpr = (const RelabelType *) expr;
  
  				/* Much as above */
  				loc = leftmostLoc(rexpr->location,
*************** exprLocation(Node *expr)
*** 1189,1195 ****
  			break;
  		case T_CoerceViaIO:
  			{
! 				CoerceViaIO *cexpr = (CoerceViaIO *) expr;
  
  				/* Much as above */
  				loc = leftmostLoc(cexpr->location,
--- 1189,1195 ----
  			break;
  		case T_CoerceViaIO:
  			{
! 				const CoerceViaIO *cexpr = (const CoerceViaIO *) expr;
  
  				/* Much as above */
  				loc = leftmostLoc(cexpr->location,
*************** exprLocation(Node *expr)
*** 1198,1204 ****
  			break;
  		case T_ArrayCoerceExpr:
  			{
! 				ArrayCoerceExpr *cexpr = (ArrayCoerceExpr *) expr;
  
  				/* Much as above */
  				loc = leftmostLoc(cexpr->location,
--- 1198,1204 ----
  			break;
  		case T_ArrayCoerceExpr:
  			{
! 				const ArrayCoerceExpr *cexpr = (const ArrayCoerceExpr *) expr;
  
  				/* Much as above */
  				loc = leftmostLoc(cexpr->location,
*************** exprLocation(Node *expr)
*** 1207,1213 ****
  			break;
  		case T_ConvertRowtypeExpr:
  			{
! 				ConvertRowtypeExpr *cexpr = (ConvertRowtypeExpr *) expr;
  
  				/* Much as above */
  				loc = leftmostLoc(cexpr->location,
--- 1207,1213 ----
  			break;
  		case T_ConvertRowtypeExpr:
  			{
! 				const ConvertRowtypeExpr *cexpr = (const ConvertRowtypeExpr *) expr;
  
  				/* Much as above */
  				loc = leftmostLoc(cexpr->location,
*************** exprLocation(Node *expr)
*** 1216,1254 ****
  			break;
  		case T_CollateExpr:
  			/* just use argument's location */
! 			loc = exprLocation((Node *) ((CollateExpr *) expr)->arg);
  			break;
  		case T_CaseExpr:
  			/* CASE keyword should always be the first thing */
! 			loc = ((CaseExpr *) expr)->location;
  			break;
  		case T_CaseWhen:
  			/* WHEN keyword should always be the first thing */
! 			loc = ((CaseWhen *) expr)->location;
  			break;
  		case T_ArrayExpr:
  			/* the location points at ARRAY or [, which must be leftmost */
! 			loc = ((ArrayExpr *) expr)->location;
  			break;
  		case T_RowExpr:
  			/* the location points at ROW or (, which must be leftmost */
! 			loc = ((RowExpr *) expr)->location;
  			break;
  		case T_RowCompareExpr:
  			/* just use leftmost argument's location */
! 			loc = exprLocation((Node *) ((RowCompareExpr *) expr)->largs);
  			break;
  		case T_CoalesceExpr:
  			/* COALESCE keyword should always be the first thing */
! 			loc = ((CoalesceExpr *) expr)->location;
  			break;
  		case T_MinMaxExpr:
  			/* GREATEST/LEAST keyword should always be the first thing */
! 			loc = ((MinMaxExpr *) expr)->location;
  			break;
  		case T_XmlExpr:
  			{
! 				XmlExpr    *xexpr = (XmlExpr *) expr;
  
  				/* consider both function name and leftmost arg */
  				loc = leftmostLoc(xexpr->location,
--- 1216,1254 ----
  			break;
  		case T_CollateExpr:
  			/* just use argument's location */
! 			loc = exprLocation((Node *) ((const CollateExpr *) expr)->arg);
  			break;
  		case T_CaseExpr:
  			/* CASE keyword should always be the first thing */
! 			loc = ((const CaseExpr *) expr)->location;
  			break;
  		case T_CaseWhen:
  			/* WHEN keyword should always be the first thing */
! 			loc = ((const CaseWhen *) expr)->location;
  			break;
  		case T_ArrayExpr:
  			/* the location points at ARRAY or [, which must be leftmost */
! 			loc = ((const ArrayExpr *) expr)->location;
  			break;
  		case T_RowExpr:
  			/* the location points at ROW or (, which must be leftmost */
! 			loc = ((const RowExpr *) expr)->location;
  			break;
  		case T_RowCompareExpr:
  			/* just use leftmost argument's location */
! 			loc = exprLocation((Node *) ((const RowCompareExpr *) expr)->largs);
  			break;
  		case T_CoalesceExpr:
  			/* COALESCE keyword should always be the first thing */
! 			loc = ((const CoalesceExpr *) expr)->location;
  			break;
  		case T_MinMaxExpr:
  			/* GREATEST/LEAST keyword should always be the first thing */
! 			loc = ((const MinMaxExpr *) expr)->location;
  			break;
  		case T_XmlExpr:
  			{
! 				const XmlExpr    *xexpr = (const XmlExpr *) expr;
  
  				/* consider both function name and leftmost arg */
  				loc = leftmostLoc(xexpr->location,
*************** exprLocation(Node *expr)
*** 1257,1271 ****
  			break;
  		case T_NullTest:
  			/* just use argument's location */
! 			loc = exprLocation((Node *) ((NullTest *) expr)->arg);
  			break;
  		case T_BooleanTest:
  			/* just use argument's location */
! 			loc = exprLocation((Node *) ((BooleanTest *) expr)->arg);
  			break;
  		case T_CoerceToDomain:
  			{
! 				CoerceToDomain *cexpr = (CoerceToDomain *) expr;
  
  				/* Much as above */
  				loc = leftmostLoc(cexpr->location,
--- 1257,1271 ----
  			break;
  		case T_NullTest:
  			/* just use argument's location */
! 			loc = exprLocation((Node *) ((const NullTest *) expr)->arg);
  			break;
  		case T_BooleanTest:
  			/* just use argument's location */
! 			loc = exprLocation((Node *) ((const BooleanTest *) expr)->arg);
  			break;
  		case T_CoerceToDomain:
  			{
! 				const CoerceToDomain *cexpr = (const CoerceToDomain *) expr;
  
  				/* Much as above */
  				loc = leftmostLoc(cexpr->location,
*************** exprLocation(Node *expr)
*** 1273,1290 ****
  			}
  			break;
  		case T_CoerceToDomainValue:
! 			loc = ((CoerceToDomainValue *) expr)->location;
  			break;
  		case T_SetToDefault:
! 			loc = ((SetToDefault *) expr)->location;
  			break;
  		case T_TargetEntry:
  			/* just use argument's location */
! 			loc = exprLocation((Node *) ((TargetEntry *) expr)->expr);
  			break;
  		case T_IntoClause:
  			/* use the contained RangeVar's location --- close enough */
! 			loc = exprLocation((Node *) ((IntoClause *) expr)->rel);
  			break;
  		case T_List:
  			{
--- 1273,1290 ----
  			}
  			break;
  		case T_CoerceToDomainValue:
! 			loc = ((const CoerceToDomainValue *) expr)->location;
  			break;
  		case T_SetToDefault:
! 			loc = ((const SetToDefault *) expr)->location;
  			break;
  		case T_TargetEntry:
  			/* just use argument's location */
! 			loc = exprLocation((Node *) ((const TargetEntry *) expr)->expr);
  			break;
  		case T_IntoClause:
  			/* use the contained RangeVar's location --- close enough */
! 			loc = exprLocation((Node *) ((const IntoClause *) expr)->rel);
  			break;
  		case T_List:
  			{
*************** exprLocation(Node *expr)
*** 1292,1298 ****
  				ListCell   *lc;
  
  				loc = -1;		/* just to suppress compiler warning */
! 				foreach(lc, (List *) expr)
  				{
  					loc = exprLocation((Node *) lfirst(lc));
  					if (loc >= 0)
--- 1292,1298 ----
  				ListCell   *lc;
  
  				loc = -1;		/* just to suppress compiler warning */
! 				foreach(lc, (const List *) expr)
  				{
  					loc = exprLocation((Node *) lfirst(lc));
  					if (loc >= 0)
*************** exprLocation(Node *expr)
*** 1302,1308 ****
  			break;
  		case T_A_Expr:
  			{
! 				A_Expr	   *aexpr = (A_Expr *) expr;
  
  				/* use leftmost of operator or left operand (if any) */
  				/* we assume right operand can't be to left of operator */
--- 1302,1308 ----
  			break;
  		case T_A_Expr:
  			{
! 				const A_Expr	   *aexpr = (const A_Expr *) expr;
  
  				/* use leftmost of operator or left operand (if any) */
  				/* we assume right operand can't be to left of operator */
*************** exprLocation(Node *expr)
*** 1311,1327 ****
  			}
  			break;
  		case T_ColumnRef:
! 			loc = ((ColumnRef *) expr)->location;
  			break;
  		case T_ParamRef:
! 			loc = ((ParamRef *) expr)->location;
  			break;
  		case T_A_Const:
! 			loc = ((A_Const *) expr)->location;
  			break;
  		case T_FuncCall:
  			{
! 				FuncCall   *fc = (FuncCall *) expr;
  
  				/* consider both function name and leftmost arg */
  				/* (we assume any ORDER BY nodes must be to right of name) */
--- 1311,1327 ----
  			}
  			break;
  		case T_ColumnRef:
! 			loc = ((const ColumnRef *) expr)->location;
  			break;
  		case T_ParamRef:
! 			loc = ((const ParamRef *) expr)->location;
  			break;
  		case T_A_Const:
! 			loc = ((const A_Const *) expr)->location;
  			break;
  		case T_FuncCall:
  			{
! 				const FuncCall   *fc = (const FuncCall *) expr;
  
  				/* consider both function name and leftmost arg */
  				/* (we assume any ORDER BY nodes must be to right of name) */
*************** exprLocation(Node *expr)
*** 1331,1345 ****
  			break;
  		case T_A_ArrayExpr:
  			/* the location points at ARRAY or [, which must be leftmost */
! 			loc = ((A_ArrayExpr *) expr)->location;
  			break;
  		case T_ResTarget:
  			/* we need not examine the contained expression (if any) */
! 			loc = ((ResTarget *) expr)->location;
  			break;
  		case T_TypeCast:
  			{
! 				TypeCast   *tc = (TypeCast *) expr;
  
  				/*
  				 * This could represent CAST(), ::, or TypeName 'literal', so
--- 1331,1345 ----
  			break;
  		case T_A_ArrayExpr:
  			/* the location points at ARRAY or [, which must be leftmost */
! 			loc = ((const A_ArrayExpr *) expr)->location;
  			break;
  		case T_ResTarget:
  			/* we need not examine the contained expression (if any) */
! 			loc = ((const ResTarget *) expr)->location;
  			break;
  		case T_TypeCast:
  			{
! 				const TypeCast   *tc = (const TypeCast *) expr;
  
  				/*
  				 * This could represent CAST(), ::, or TypeName 'literal', so
*************** exprLocation(Node *expr)
*** 1352,1385 ****
  			break;
  		case T_CollateClause:
  			/* just use argument's location */
! 			loc = exprLocation(((CollateClause *) expr)->arg);
  			break;
  		case T_SortBy:
  			/* just use argument's location (ignore operator, if any) */
! 			loc = exprLocation(((SortBy *) expr)->node);
  			break;
  		case T_WindowDef:
! 			loc = ((WindowDef *) expr)->location;
  			break;
  		case T_TypeName:
! 			loc = ((TypeName *) expr)->location;
  			break;
  		case T_Constraint:
! 			loc = ((Constraint *) expr)->location;
  			break;
  		case T_XmlSerialize:
  			/* XMLSERIALIZE keyword should always be the first thing */
! 			loc = ((XmlSerialize *) expr)->location;
  			break;
  		case T_WithClause:
! 			loc = ((WithClause *) expr)->location;
  			break;
  		case T_CommonTableExpr:
! 			loc = ((CommonTableExpr *) expr)->location;
  			break;
  		case T_PlaceHolderVar:
  			/* just use argument's location */
! 			loc = exprLocation((Node *) ((PlaceHolderVar *) expr)->phexpr);
  			break;
  		default:
  			/* for any other node type it's just unknown... */
--- 1352,1385 ----
  			break;
  		case T_CollateClause:
  			/* just use argument's location */
! 			loc = exprLocation(((const CollateClause *) expr)->arg);
  			break;
  		case T_SortBy:
  			/* just use argument's location (ignore operator, if any) */
! 			loc = exprLocation(((const SortBy *) expr)->node);
  			break;
  		case T_WindowDef:
! 			loc = ((const WindowDef *) expr)->location;
  			break;
  		case T_TypeName:
! 			loc = ((const TypeName *) expr)->location;
  			break;
  		case T_Constraint:
! 			loc = ((const Constraint *) expr)->location;
  			break;
  		case T_XmlSerialize:
  			/* XMLSERIALIZE keyword should always be the first thing */
! 			loc = ((const XmlSerialize *) expr)->location;
  			break;
  		case T_WithClause:
! 			loc = ((const WithClause *) expr)->location;
  			break;
  		case T_CommonTableExpr:
! 			loc = ((const CommonTableExpr *) expr)->location;
  			break;
  		case T_PlaceHolderVar:
  			/* just use argument's location */
! 			loc = exprLocation((Node *) ((const PlaceHolderVar *) expr)->phexpr);
  			break;
  		default:
  			/* for any other node type it's just unknown... */
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
new file mode 100644
index f7d39ed..34ed4c0
*** a/src/backend/nodes/outfuncs.c
--- b/src/backend/nodes/outfuncs.c
***************
*** 94,100 ****
  
  #define booltostr(x)  ((x) ? "true" : "false")
  
! static void _outNode(StringInfo str, void *obj);
  
  
  /*
--- 94,100 ----
  
  #define booltostr(x)  ((x) ? "true" : "false")
  
! static void _outNode(StringInfo str, const void *obj);
  
  
  /*
*************** static void _outNode(StringInfo str, voi
*** 105,111 ****
   *	  If a null or empty string is given, it is encoded as "<>".
   */
  static void
! _outToken(StringInfo str, char *s)
  {
  	if (s == NULL || *s == '\0')
  	{
--- 105,111 ----
   *	  If a null or empty string is given, it is encoded as "<>".
   */
  static void
! _outToken(StringInfo str, const char *s)
  {
  	if (s == NULL || *s == '\0')
  	{
*************** _outToken(StringInfo str, char *s)
*** 137,145 ****
  }
  
  static void
! _outList(StringInfo str, List *node)
  {
! 	ListCell   *lc;
  
  	appendStringInfoChar(str, '(');
  
--- 137,145 ----
  }
  
  static void
! _outList(StringInfo str, const List *node)
  {
! 	const ListCell   *lc;
  
  	appendStringInfoChar(str, '(');
  
*************** _outList(StringInfo str, List *node)
*** 180,186 ****
   * Note: the output format is "(b int int ...)", similar to an integer List.
   */
  static void
! _outBitmapset(StringInfo str, Bitmapset *bms)
  {
  	Bitmapset  *tmpset;
  	int			x;
--- 180,186 ----
   * Note: the output format is "(b int int ...)", similar to an integer List.
   */
  static void
! _outBitmapset(StringInfo str, const Bitmapset *bms)
  {
  	Bitmapset  *tmpset;
  	int			x;
*************** _outDatum(StringInfo str, Datum value, i
*** 235,241 ****
   */
  
  static void
! _outPlannedStmt(StringInfo str, PlannedStmt *node)
  {
  	WRITE_NODE_TYPE("PLANNEDSTMT");
  
--- 235,241 ----
   */
  
  static void
! _outPlannedStmt(StringInfo str, const PlannedStmt *node)
  {
  	WRITE_NODE_TYPE("PLANNEDSTMT");
  
*************** _outPlannedStmt(StringInfo str, PlannedS
*** 261,267 ****
   * print the basic stuff of all nodes that inherit from Plan
   */
  static void
! _outPlanInfo(StringInfo str, Plan *node)
  {
  	WRITE_FLOAT_FIELD(startup_cost, "%.2f");
  	WRITE_FLOAT_FIELD(total_cost, "%.2f");
--- 261,267 ----
   * print the basic stuff of all nodes that inherit from Plan
   */
  static void
! _outPlanInfo(StringInfo str, const Plan *node)
  {
  	WRITE_FLOAT_FIELD(startup_cost, "%.2f");
  	WRITE_FLOAT_FIELD(total_cost, "%.2f");
*************** _outPlanInfo(StringInfo str, Plan *node)
*** 280,288 ****
   * print the basic stuff of all nodes that inherit from Scan
   */
  static void
! _outScanInfo(StringInfo str, Scan *node)
  {
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_UINT_FIELD(scanrelid);
  }
--- 280,288 ----
   * print the basic stuff of all nodes that inherit from Scan
   */
  static void
! _outScanInfo(StringInfo str, const Scan *node)
  {
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_UINT_FIELD(scanrelid);
  }
*************** _outScanInfo(StringInfo str, Scan *node)
*** 291,299 ****
   * print the basic stuff of all nodes that inherit from Join
   */
  static void
! _outJoinPlanInfo(StringInfo str, Join *node)
  {
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_ENUM_FIELD(jointype, JoinType);
  	WRITE_NODE_FIELD(joinqual);
--- 291,299 ----
   * print the basic stuff of all nodes that inherit from Join
   */
  static void
! _outJoinPlanInfo(StringInfo str, const Join *node)
  {
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_ENUM_FIELD(jointype, JoinType);
  	WRITE_NODE_FIELD(joinqual);
*************** _outJoinPlanInfo(StringInfo str, Join *n
*** 301,329 ****
  
  
  static void
! _outPlan(StringInfo str, Plan *node)
  {
  	WRITE_NODE_TYPE("PLAN");
  
! 	_outPlanInfo(str, (Plan *) node);
  }
  
  static void
! _outResult(StringInfo str, Result *node)
  {
  	WRITE_NODE_TYPE("RESULT");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(resconstantqual);
  }
  
  static void
! _outModifyTable(StringInfo str, ModifyTable *node)
  {
  	WRITE_NODE_TYPE("MODIFYTABLE");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_ENUM_FIELD(operation, CmdType);
  	WRITE_BOOL_FIELD(canSetTag);
--- 301,329 ----
  
  
  static void
! _outPlan(StringInfo str, const Plan *node)
  {
  	WRITE_NODE_TYPE("PLAN");
  
! 	_outPlanInfo(str, (const Plan *) node);
  }
  
  static void
! _outResult(StringInfo str, const Result *node)
  {
  	WRITE_NODE_TYPE("RESULT");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(resconstantqual);
  }
  
  static void
! _outModifyTable(StringInfo str, const ModifyTable *node)
  {
  	WRITE_NODE_TYPE("MODIFYTABLE");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_ENUM_FIELD(operation, CmdType);
  	WRITE_BOOL_FIELD(canSetTag);
*************** _outModifyTable(StringInfo str, ModifyTa
*** 336,358 ****
  }
  
  static void
! _outAppend(StringInfo str, Append *node)
  {
  	WRITE_NODE_TYPE("APPEND");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(appendplans);
  }
  
  static void
! _outMergeAppend(StringInfo str, MergeAppend *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("MERGEAPPEND");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(mergeplans);
  
--- 336,358 ----
  }
  
  static void
! _outAppend(StringInfo str, const Append *node)
  {
  	WRITE_NODE_TYPE("APPEND");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(appendplans);
  }
  
  static void
! _outMergeAppend(StringInfo str, const MergeAppend *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("MERGEAPPEND");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(mergeplans);
  
*************** _outMergeAppend(StringInfo str, MergeApp
*** 376,388 ****
  }
  
  static void
! _outRecursiveUnion(StringInfo str, RecursiveUnion *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("RECURSIVEUNION");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_INT_FIELD(wtParam);
  	WRITE_INT_FIELD(numCols);
--- 376,388 ----
  }
  
  static void
! _outRecursiveUnion(StringInfo str, const RecursiveUnion *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("RECURSIVEUNION");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_INT_FIELD(wtParam);
  	WRITE_INT_FIELD(numCols);
*************** _outRecursiveUnion(StringInfo str, Recur
*** 399,445 ****
  }
  
  static void
! _outBitmapAnd(StringInfo str, BitmapAnd *node)
  {
  	WRITE_NODE_TYPE("BITMAPAND");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(bitmapplans);
  }
  
  static void
! _outBitmapOr(StringInfo str, BitmapOr *node)
  {
  	WRITE_NODE_TYPE("BITMAPOR");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(bitmapplans);
  }
  
  static void
! _outScan(StringInfo str, Scan *node)
  {
  	WRITE_NODE_TYPE("SCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  }
  
  static void
! _outSeqScan(StringInfo str, SeqScan *node)
  {
  	WRITE_NODE_TYPE("SEQSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  }
  
  static void
! _outIndexScan(StringInfo str, IndexScan *node)
  {
  	WRITE_NODE_TYPE("INDEXSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
--- 399,445 ----
  }
  
  static void
! _outBitmapAnd(StringInfo str, const BitmapAnd *node)
  {
  	WRITE_NODE_TYPE("BITMAPAND");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(bitmapplans);
  }
  
  static void
! _outBitmapOr(StringInfo str, const BitmapOr *node)
  {
  	WRITE_NODE_TYPE("BITMAPOR");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(bitmapplans);
  }
  
  static void
! _outScan(StringInfo str, const Scan *node)
  {
  	WRITE_NODE_TYPE("SCAN");
  
! 	_outScanInfo(str, node);
  }
  
  static void
! _outSeqScan(StringInfo str, const SeqScan *node)
  {
  	WRITE_NODE_TYPE("SEQSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  }
  
  static void
! _outIndexScan(StringInfo str, const IndexScan *node)
  {
  	WRITE_NODE_TYPE("INDEXSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
*************** _outIndexScan(StringInfo str, IndexScan
*** 450,460 ****
  }
  
  static void
! _outIndexOnlyScan(StringInfo str, IndexOnlyScan *node)
  {
  	WRITE_NODE_TYPE("INDEXONLYSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
--- 450,460 ----
  }
  
  static void
! _outIndexOnlyScan(StringInfo str, const IndexOnlyScan *node)
  {
  	WRITE_NODE_TYPE("INDEXONLYSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
*************** _outIndexOnlyScan(StringInfo str, IndexO
*** 464,474 ****
  }
  
  static void
! _outBitmapIndexScan(StringInfo str, BitmapIndexScan *node)
  {
  	WRITE_NODE_TYPE("BITMAPINDEXSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
--- 464,474 ----
  }
  
  static void
! _outBitmapIndexScan(StringInfo str, const BitmapIndexScan *node)
  {
  	WRITE_NODE_TYPE("BITMAPINDEXSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_OID_FIELD(indexid);
  	WRITE_NODE_FIELD(indexqual);
*************** _outBitmapIndexScan(StringInfo str, Bitm
*** 476,516 ****
  }
  
  static void
! _outBitmapHeapScan(StringInfo str, BitmapHeapScan *node)
  {
  	WRITE_NODE_TYPE("BITMAPHEAPSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_NODE_FIELD(bitmapqualorig);
  }
  
  static void
! _outTidScan(StringInfo str, TidScan *node)
  {
  	WRITE_NODE_TYPE("TIDSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_NODE_FIELD(tidquals);
  }
  
  static void
! _outSubqueryScan(StringInfo str, SubqueryScan *node)
  {
  	WRITE_NODE_TYPE("SUBQUERYSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_NODE_FIELD(subplan);
  }
  
  static void
! _outFunctionScan(StringInfo str, FunctionScan *node)
  {
  	WRITE_NODE_TYPE("FUNCTIONSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_NODE_FIELD(funcexpr);
  	WRITE_NODE_FIELD(funccolnames);
--- 476,516 ----
  }
  
  static void
! _outBitmapHeapScan(StringInfo str, const BitmapHeapScan *node)
  {
  	WRITE_NODE_TYPE("BITMAPHEAPSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_NODE_FIELD(bitmapqualorig);
  }
  
  static void
! _outTidScan(StringInfo str, const TidScan *node)
  {
  	WRITE_NODE_TYPE("TIDSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_NODE_FIELD(tidquals);
  }
  
  static void
! _outSubqueryScan(StringInfo str, const SubqueryScan *node)
  {
  	WRITE_NODE_TYPE("SUBQUERYSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_NODE_FIELD(subplan);
  }
  
  static void
! _outFunctionScan(StringInfo str, const FunctionScan *node)
  {
  	WRITE_NODE_TYPE("FUNCTIONSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_NODE_FIELD(funcexpr);
  	WRITE_NODE_FIELD(funccolnames);
*************** _outFunctionScan(StringInfo str, Functio
*** 520,568 ****
  }
  
  static void
! _outValuesScan(StringInfo str, ValuesScan *node)
  {
  	WRITE_NODE_TYPE("VALUESSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_NODE_FIELD(values_lists);
  }
  
  static void
! _outCteScan(StringInfo str, CteScan *node)
  {
  	WRITE_NODE_TYPE("CTESCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_INT_FIELD(ctePlanId);
  	WRITE_INT_FIELD(cteParam);
  }
  
  static void
! _outWorkTableScan(StringInfo str, WorkTableScan *node)
  {
  	WRITE_NODE_TYPE("WORKTABLESCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_INT_FIELD(wtParam);
  }
  
  static void
! _outForeignScan(StringInfo str, ForeignScan *node)
  {
  	WRITE_NODE_TYPE("FOREIGNSCAN");
  
! 	_outScanInfo(str, (Scan *) node);
  
  	WRITE_BOOL_FIELD(fsSystemCol);
  	WRITE_NODE_FIELD(fdwplan);
  }
  
  static void
! _outFdwPlan(StringInfo str, FdwPlan *node)
  {
  	WRITE_NODE_TYPE("FDWPLAN");
  
--- 520,568 ----
  }
  
  static void
! _outValuesScan(StringInfo str, const ValuesScan *node)
  {
  	WRITE_NODE_TYPE("VALUESSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_NODE_FIELD(values_lists);
  }
  
  static void
! _outCteScan(StringInfo str, const CteScan *node)
  {
  	WRITE_NODE_TYPE("CTESCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_INT_FIELD(ctePlanId);
  	WRITE_INT_FIELD(cteParam);
  }
  
  static void
! _outWorkTableScan(StringInfo str, const WorkTableScan *node)
  {
  	WRITE_NODE_TYPE("WORKTABLESCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_INT_FIELD(wtParam);
  }
  
  static void
! _outForeignScan(StringInfo str, const ForeignScan *node)
  {
  	WRITE_NODE_TYPE("FOREIGNSCAN");
  
! 	_outScanInfo(str, (const Scan *) node);
  
  	WRITE_BOOL_FIELD(fsSystemCol);
  	WRITE_NODE_FIELD(fdwplan);
  }
  
  static void
! _outFdwPlan(StringInfo str, const FdwPlan *node)
  {
  	WRITE_NODE_TYPE("FDWPLAN");
  
*************** _outFdwPlan(StringInfo str, FdwPlan *nod
*** 572,603 ****
  }
  
  static void
! _outJoin(StringInfo str, Join *node)
  {
  	WRITE_NODE_TYPE("JOIN");
  
! 	_outJoinPlanInfo(str, (Join *) node);
  }
  
  static void
! _outNestLoop(StringInfo str, NestLoop *node)
  {
  	WRITE_NODE_TYPE("NESTLOOP");
  
! 	_outJoinPlanInfo(str, (Join *) node);
  
  	WRITE_NODE_FIELD(nestParams);
  }
  
  static void
! _outMergeJoin(StringInfo str, MergeJoin *node)
  {
  	int			numCols;
  	int			i;
  
  	WRITE_NODE_TYPE("MERGEJOIN");
  
! 	_outJoinPlanInfo(str, (Join *) node);
  
  	WRITE_NODE_FIELD(mergeclauses);
  
--- 572,603 ----
  }
  
  static void
! _outJoin(StringInfo str, const Join *node)
  {
  	WRITE_NODE_TYPE("JOIN");
  
! 	_outJoinPlanInfo(str, (const Join *) node);
  }
  
  static void
! _outNestLoop(StringInfo str, const NestLoop *node)
  {
  	WRITE_NODE_TYPE("NESTLOOP");
  
! 	_outJoinPlanInfo(str, (const Join *) node);
  
  	WRITE_NODE_FIELD(nestParams);
  }
  
  static void
! _outMergeJoin(StringInfo str, const MergeJoin *node)
  {
  	int			numCols;
  	int			i;
  
  	WRITE_NODE_TYPE("MERGEJOIN");
  
! 	_outJoinPlanInfo(str, (const Join *) node);
  
  	WRITE_NODE_FIELD(mergeclauses);
  
*************** _outMergeJoin(StringInfo str, MergeJoin
*** 621,643 ****
  }
  
  static void
! _outHashJoin(StringInfo str, HashJoin *node)
  {
  	WRITE_NODE_TYPE("HASHJOIN");
  
! 	_outJoinPlanInfo(str, (Join *) node);
  
  	WRITE_NODE_FIELD(hashclauses);
  }
  
  static void
! _outAgg(StringInfo str, Agg *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("AGG");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_ENUM_FIELD(aggstrategy, AggStrategy);
  	WRITE_INT_FIELD(numCols);
--- 621,643 ----
  }
  
  static void
! _outHashJoin(StringInfo str, const HashJoin *node)
  {
  	WRITE_NODE_TYPE("HASHJOIN");
  
! 	_outJoinPlanInfo(str, (const Join *) node);
  
  	WRITE_NODE_FIELD(hashclauses);
  }
  
  static void
! _outAgg(StringInfo str, const Agg *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("AGG");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_ENUM_FIELD(aggstrategy, AggStrategy);
  	WRITE_INT_FIELD(numCols);
*************** _outAgg(StringInfo str, Agg *node)
*** 654,666 ****
  }
  
  static void
! _outWindowAgg(StringInfo str, WindowAgg *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("WINDOWAGG");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_UINT_FIELD(winref);
  	WRITE_INT_FIELD(partNumCols);
--- 654,666 ----
  }
  
  static void
! _outWindowAgg(StringInfo str, const WindowAgg *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("WINDOWAGG");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_UINT_FIELD(winref);
  	WRITE_INT_FIELD(partNumCols);
*************** _outWindowAgg(StringInfo str, WindowAgg
*** 689,701 ****
  }
  
  static void
! _outGroup(StringInfo str, Group *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("GROUP");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
--- 689,701 ----
  }
  
  static void
! _outGroup(StringInfo str, const Group *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("GROUP");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
*************** _outGroup(StringInfo str, Group *node)
*** 709,729 ****
  }
  
  static void
! _outMaterial(StringInfo str, Material *node)
  {
  	WRITE_NODE_TYPE("MATERIAL");
  
! 	_outPlanInfo(str, (Plan *) node);
  }
  
  static void
! _outSort(StringInfo str, Sort *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("SORT");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
--- 709,729 ----
  }
  
  static void
! _outMaterial(StringInfo str, const Material *node)
  {
  	WRITE_NODE_TYPE("MATERIAL");
  
! 	_outPlanInfo(str, (const Plan *) node);
  }
  
  static void
! _outSort(StringInfo str, const Sort *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("SORT");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
*************** _outSort(StringInfo str, Sort *node)
*** 745,757 ****
  }
  
  static void
! _outUnique(StringInfo str, Unique *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("UNIQUE");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
--- 745,757 ----
  }
  
  static void
! _outUnique(StringInfo str, const Unique *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("UNIQUE");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_INT_FIELD(numCols);
  
*************** _outUnique(StringInfo str, Unique *node)
*** 765,775 ****
  }
  
  static void
! _outHash(StringInfo str, Hash *node)
  {
  	WRITE_NODE_TYPE("HASH");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_OID_FIELD(skewTable);
  	WRITE_INT_FIELD(skewColumn);
--- 765,775 ----
  }
  
  static void
! _outHash(StringInfo str, const Hash *node)
  {
  	WRITE_NODE_TYPE("HASH");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_OID_FIELD(skewTable);
  	WRITE_INT_FIELD(skewColumn);
*************** _outHash(StringInfo str, Hash *node)
*** 779,791 ****
  }
  
  static void
! _outSetOp(StringInfo str, SetOp *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("SETOP");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_ENUM_FIELD(cmd, SetOpCmd);
  	WRITE_ENUM_FIELD(strategy, SetOpStrategy);
--- 779,791 ----
  }
  
  static void
! _outSetOp(StringInfo str, const SetOp *node)
  {
  	int			i;
  
  	WRITE_NODE_TYPE("SETOP");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_ENUM_FIELD(cmd, SetOpCmd);
  	WRITE_ENUM_FIELD(strategy, SetOpStrategy);
*************** _outSetOp(StringInfo str, SetOp *node)
*** 805,833 ****
  }
  
  static void
! _outLockRows(StringInfo str, LockRows *node)
  {
  	WRITE_NODE_TYPE("LOCKROWS");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(rowMarks);
  	WRITE_INT_FIELD(epqParam);
  }
  
  static void
! _outLimit(StringInfo str, Limit *node)
  {
  	WRITE_NODE_TYPE("LIMIT");
  
! 	_outPlanInfo(str, (Plan *) node);
  
  	WRITE_NODE_FIELD(limitOffset);
  	WRITE_NODE_FIELD(limitCount);
  }
  
  static void
! _outNestLoopParam(StringInfo str, NestLoopParam *node)
  {
  	WRITE_NODE_TYPE("NESTLOOPPARAM");
  
--- 805,833 ----
  }
  
  static void
! _outLockRows(StringInfo str, const LockRows *node)
  {
  	WRITE_NODE_TYPE("LOCKROWS");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(rowMarks);
  	WRITE_INT_FIELD(epqParam);
  }
  
  static void
! _outLimit(StringInfo str, const Limit *node)
  {
  	WRITE_NODE_TYPE("LIMIT");
  
! 	_outPlanInfo(str, (const Plan *) node);
  
  	WRITE_NODE_FIELD(limitOffset);
  	WRITE_NODE_FIELD(limitCount);
  }
  
  static void
! _outNestLoopParam(StringInfo str, const NestLoopParam *node)
  {
  	WRITE_NODE_TYPE("NESTLOOPPARAM");
  
*************** _outNestLoopParam(StringInfo str, NestLo
*** 836,842 ****
  }
  
  static void
! _outPlanRowMark(StringInfo str, PlanRowMark *node)
  {
  	WRITE_NODE_TYPE("PLANROWMARK");
  
--- 836,842 ----
  }
  
  static void
! _outPlanRowMark(StringInfo str, const PlanRowMark *node)
  {
  	WRITE_NODE_TYPE("PLANROWMARK");
  
*************** _outPlanRowMark(StringInfo str, PlanRowM
*** 849,855 ****
  }
  
  static void
! _outPlanInvalItem(StringInfo str, PlanInvalItem *node)
  {
  	WRITE_NODE_TYPE("PLANINVALITEM");
  
--- 849,855 ----
  }
  
  static void
! _outPlanInvalItem(StringInfo str, const PlanInvalItem *node)
  {
  	WRITE_NODE_TYPE("PLANINVALITEM");
  
*************** _outPlanInvalItem(StringInfo str, PlanIn
*** 864,870 ****
   *****************************************************************************/
  
  static void
! _outAlias(StringInfo str, Alias *node)
  {
  	WRITE_NODE_TYPE("ALIAS");
  
--- 864,870 ----
   *****************************************************************************/
  
  static void
! _outAlias(StringInfo str, const Alias *node)
  {
  	WRITE_NODE_TYPE("ALIAS");
  
*************** _outAlias(StringInfo str, Alias *node)
*** 873,879 ****
  }
  
  static void
! _outRangeVar(StringInfo str, RangeVar *node)
  {
  	WRITE_NODE_TYPE("RANGEVAR");
  
--- 873,879 ----
  }
  
  static void
! _outRangeVar(StringInfo str, const RangeVar *node)
  {
  	WRITE_NODE_TYPE("RANGEVAR");
  
*************** _outRangeVar(StringInfo str, RangeVar *n
*** 890,896 ****
  }
  
  static void
! _outIntoClause(StringInfo str, IntoClause *node)
  {
  	WRITE_NODE_TYPE("INTOCLAUSE");
  
--- 890,896 ----
  }
  
  static void
! _outIntoClause(StringInfo str, const IntoClause *node)
  {
  	WRITE_NODE_TYPE("INTOCLAUSE");
  
*************** _outIntoClause(StringInfo str, IntoClaus
*** 902,908 ****
  }
  
  static void
! _outVar(StringInfo str, Var *node)
  {
  	WRITE_NODE_TYPE("VAR");
  
--- 902,908 ----
  }
  
  static void
! _outVar(StringInfo str, const Var *node)
  {
  	WRITE_NODE_TYPE("VAR");
  
*************** _outVar(StringInfo str, Var *node)
*** 918,924 ****
  }
  
  static void
! _outConst(StringInfo str, Const *node)
  {
  	WRITE_NODE_TYPE("CONST");
  
--- 918,924 ----
  }
  
  static void
! _outConst(StringInfo str, const Const *node)
  {
  	WRITE_NODE_TYPE("CONST");
  
*************** _outConst(StringInfo str, Const *node)
*** 938,944 ****
  }
  
  static void
! _outParam(StringInfo str, Param *node)
  {
  	WRITE_NODE_TYPE("PARAM");
  
--- 938,944 ----
  }
  
  static void
! _outParam(StringInfo str, const Param *node)
  {
  	WRITE_NODE_TYPE("PARAM");
  
*************** _outParam(StringInfo str, Param *node)
*** 951,957 ****
  }
  
  static void
! _outAggref(StringInfo str, Aggref *node)
  {
  	WRITE_NODE_TYPE("AGGREF");
  
--- 951,957 ----
  }
  
  static void
! _outAggref(StringInfo str, const Aggref *node)
  {
  	WRITE_NODE_TYPE("AGGREF");
  
*************** _outAggref(StringInfo str, Aggref *node)
*** 968,974 ****
  }
  
  static void
! _outWindowFunc(StringInfo str, WindowFunc *node)
  {
  	WRITE_NODE_TYPE("WINDOWFUNC");
  
--- 968,974 ----
  }
  
  static void
! _outWindowFunc(StringInfo str, const WindowFunc *node)
  {
  	WRITE_NODE_TYPE("WINDOWFUNC");
  
*************** _outWindowFunc(StringInfo str, WindowFun
*** 984,990 ****
  }
  
  static void
! _outArrayRef(StringInfo str, ArrayRef *node)
  {
  	WRITE_NODE_TYPE("ARRAYREF");
  
--- 984,990 ----
  }
  
  static void
! _outArrayRef(StringInfo str, const ArrayRef *node)
  {
  	WRITE_NODE_TYPE("ARRAYREF");
  
*************** _outArrayRef(StringInfo str, ArrayRef *n
*** 999,1005 ****
  }
  
  static void
! _outFuncExpr(StringInfo str, FuncExpr *node)
  {
  	WRITE_NODE_TYPE("FUNCEXPR");
  
--- 999,1005 ----
  }
  
  static void
! _outFuncExpr(StringInfo str, const FuncExpr *node)
  {
  	WRITE_NODE_TYPE("FUNCEXPR");
  
*************** _outFuncExpr(StringInfo str, FuncExpr *n
*** 1014,1020 ****
  }
  
  static void
! _outNamedArgExpr(StringInfo str, NamedArgExpr *node)
  {
  	WRITE_NODE_TYPE("NAMEDARGEXPR");
  
--- 1014,1020 ----
  }
  
  static void
! _outNamedArgExpr(StringInfo str, const NamedArgExpr *node)
  {
  	WRITE_NODE_TYPE("NAMEDARGEXPR");
  
*************** _outNamedArgExpr(StringInfo str, NamedAr
*** 1025,1031 ****
  }
  
  static void
! _outOpExpr(StringInfo str, OpExpr *node)
  {
  	WRITE_NODE_TYPE("OPEXPR");
  
--- 1025,1031 ----
  }
  
  static void
! _outOpExpr(StringInfo str, const OpExpr *node)
  {
  	WRITE_NODE_TYPE("OPEXPR");
  
*************** _outOpExpr(StringInfo str, OpExpr *node)
*** 1040,1046 ****
  }
  
  static void
! _outDistinctExpr(StringInfo str, DistinctExpr *node)
  {
  	WRITE_NODE_TYPE("DISTINCTEXPR");
  
--- 1040,1046 ----
  }
  
  static void
! _outDistinctExpr(StringInfo str, const DistinctExpr *node)
  {
  	WRITE_NODE_TYPE("DISTINCTEXPR");
  
*************** _outDistinctExpr(StringInfo str, Distinc
*** 1055,1061 ****
  }
  
  static void
! _outNullIfExpr(StringInfo str, NullIfExpr *node)
  {
  	WRITE_NODE_TYPE("NULLIFEXPR");
  
--- 1055,1061 ----
  }
  
  static void
! _outNullIfExpr(StringInfo str, const NullIfExpr *node)
  {
  	WRITE_NODE_TYPE("NULLIFEXPR");
  
*************** _outNullIfExpr(StringInfo str, NullIfExp
*** 1070,1076 ****
  }
  
  static void
! _outScalarArrayOpExpr(StringInfo str, ScalarArrayOpExpr *node)
  {
  	WRITE_NODE_TYPE("SCALARARRAYOPEXPR");
  
--- 1070,1076 ----
  }
  
  static void
! _outScalarArrayOpExpr(StringInfo str, const ScalarArrayOpExpr *node)
  {
  	WRITE_NODE_TYPE("SCALARARRAYOPEXPR");
  
*************** _outScalarArrayOpExpr(StringInfo str, Sc
*** 1083,1089 ****
  }
  
  static void
! _outBoolExpr(StringInfo str, BoolExpr *node)
  {
  	char	   *opstr = NULL;
  
--- 1083,1089 ----
  }
  
  static void
! _outBoolExpr(StringInfo str, const BoolExpr *node)
  {
  	char	   *opstr = NULL;
  
*************** _outBoolExpr(StringInfo str, BoolExpr *n
*** 1110,1116 ****
  }
  
  static void
! _outSubLink(StringInfo str, SubLink *node)
  {
  	WRITE_NODE_TYPE("SUBLINK");
  
--- 1110,1116 ----
  }
  
  static void
! _outSubLink(StringInfo str, const SubLink *node)
  {
  	WRITE_NODE_TYPE("SUBLINK");
  
*************** _outSubLink(StringInfo str, SubLink *nod
*** 1122,1128 ****
  }
  
  static void
! _outSubPlan(StringInfo str, SubPlan *node)
  {
  	WRITE_NODE_TYPE("SUBPLAN");
  
--- 1122,1128 ----
  }
  
  static void
! _outSubPlan(StringInfo str, const SubPlan *node)
  {
  	WRITE_NODE_TYPE("SUBPLAN");
  
*************** _outSubPlan(StringInfo str, SubPlan *nod
*** 1144,1150 ****
  }
  
  static void
! _outAlternativeSubPlan(StringInfo str, AlternativeSubPlan *node)
  {
  	WRITE_NODE_TYPE("ALTERNATIVESUBPLAN");
  
--- 1144,1150 ----
  }
  
  static void
! _outAlternativeSubPlan(StringInfo str, const AlternativeSubPlan *node)
  {
  	WRITE_NODE_TYPE("ALTERNATIVESUBPLAN");
  
*************** _outAlternativeSubPlan(StringInfo str, A
*** 1152,1158 ****
  }
  
  static void
! _outFieldSelect(StringInfo str, FieldSelect *node)
  {
  	WRITE_NODE_TYPE("FIELDSELECT");
  
--- 1152,1158 ----
  }
  
  static void
! _outFieldSelect(StringInfo str, const FieldSelect *node)
  {
  	WRITE_NODE_TYPE("FIELDSELECT");
  
*************** _outFieldSelect(StringInfo str, FieldSel
*** 1164,1170 ****
  }
  
  static void
! _outFieldStore(StringInfo str, FieldStore *node)
  {
  	WRITE_NODE_TYPE("FIELDSTORE");
  
--- 1164,1170 ----
  }
  
  static void
! _outFieldStore(StringInfo str, const FieldStore *node)
  {
  	WRITE_NODE_TYPE("FIELDSTORE");
  
*************** _outFieldStore(StringInfo str, FieldStor
*** 1175,1181 ****
  }
  
  static void
! _outRelabelType(StringInfo str, RelabelType *node)
  {
  	WRITE_NODE_TYPE("RELABELTYPE");
  
--- 1175,1181 ----
  }
  
  static void
! _outRelabelType(StringInfo str, const RelabelType *node)
  {
  	WRITE_NODE_TYPE("RELABELTYPE");
  
*************** _outRelabelType(StringInfo str, RelabelT
*** 1188,1194 ****
  }
  
  static void
! _outCoerceViaIO(StringInfo str, CoerceViaIO *node)
  {
  	WRITE_NODE_TYPE("COERCEVIAIO");
  
--- 1188,1194 ----
  }
  
  static void
! _outCoerceViaIO(StringInfo str, const CoerceViaIO *node)
  {
  	WRITE_NODE_TYPE("COERCEVIAIO");
  
*************** _outCoerceViaIO(StringInfo str, CoerceVi
*** 1200,1206 ****
  }
  
  static void
! _outArrayCoerceExpr(StringInfo str, ArrayCoerceExpr *node)
  {
  	WRITE_NODE_TYPE("ARRAYCOERCEEXPR");
  
--- 1200,1206 ----
  }
  
  static void
! _outArrayCoerceExpr(StringInfo str, const ArrayCoerceExpr *node)
  {
  	WRITE_NODE_TYPE("ARRAYCOERCEEXPR");
  
*************** _outArrayCoerceExpr(StringInfo str, Arra
*** 1215,1221 ****
  }
  
  static void
! _outConvertRowtypeExpr(StringInfo str, ConvertRowtypeExpr *node)
  {
  	WRITE_NODE_TYPE("CONVERTROWTYPEEXPR");
  
--- 1215,1221 ----
  }
  
  static void
! _outConvertRowtypeExpr(StringInfo str, const ConvertRowtypeExpr *node)
  {
  	WRITE_NODE_TYPE("CONVERTROWTYPEEXPR");
  
*************** _outConvertRowtypeExpr(StringInfo str, C
*** 1226,1232 ****
  }
  
  static void
! _outCollateExpr(StringInfo str, CollateExpr *node)
  {
  	WRITE_NODE_TYPE("COLLATE");
  
--- 1226,1232 ----
  }
  
  static void
! _outCollateExpr(StringInfo str, const CollateExpr *node)
  {
  	WRITE_NODE_TYPE("COLLATE");
  
*************** _outCollateExpr(StringInfo str, CollateE
*** 1236,1242 ****
  }
  
  static void
! _outCaseExpr(StringInfo str, CaseExpr *node)
  {
  	WRITE_NODE_TYPE("CASE");
  
--- 1236,1242 ----
  }
  
  static void
! _outCaseExpr(StringInfo str, const CaseExpr *node)
  {
  	WRITE_NODE_TYPE("CASE");
  
*************** _outCaseExpr(StringInfo str, CaseExpr *n
*** 1249,1255 ****
  }
  
  static void
! _outCaseWhen(StringInfo str, CaseWhen *node)
  {
  	WRITE_NODE_TYPE("WHEN");
  
--- 1249,1255 ----
  }
  
  static void
! _outCaseWhen(StringInfo str, const CaseWhen *node)
  {
  	WRITE_NODE_TYPE("WHEN");
  
*************** _outCaseWhen(StringInfo str, CaseWhen *n
*** 1259,1265 ****
  }
  
  static void
! _outCaseTestExpr(StringInfo str, CaseTestExpr *node)
  {
  	WRITE_NODE_TYPE("CASETESTEXPR");
  
--- 1259,1265 ----
  }
  
  static void
! _outCaseTestExpr(StringInfo str, const CaseTestExpr *node)
  {
  	WRITE_NODE_TYPE("CASETESTEXPR");
  
*************** _outCaseTestExpr(StringInfo str, CaseTes
*** 1269,1275 ****
  }
  
  static void
! _outArrayExpr(StringInfo str, ArrayExpr *node)
  {
  	WRITE_NODE_TYPE("ARRAY");
  
--- 1269,1275 ----
  }
  
  static void
! _outArrayExpr(StringInfo str, const ArrayExpr *node)
  {
  	WRITE_NODE_TYPE("ARRAY");
  
*************** _outArrayExpr(StringInfo str, ArrayExpr
*** 1282,1288 ****
  }
  
  static void
! _outRowExpr(StringInfo str, RowExpr *node)
  {
  	WRITE_NODE_TYPE("ROW");
  
--- 1282,1288 ----
  }
  
  static void
! _outRowExpr(StringInfo str, const RowExpr *node)
  {
  	WRITE_NODE_TYPE("ROW");
  
*************** _outRowExpr(StringInfo str, RowExpr *nod
*** 1294,1300 ****
  }
  
  static void
! _outRowCompareExpr(StringInfo str, RowCompareExpr *node)
  {
  	WRITE_NODE_TYPE("ROWCOMPARE");
  
--- 1294,1300 ----
  }
  
  static void
! _outRowCompareExpr(StringInfo str, const RowCompareExpr *node)
  {
  	WRITE_NODE_TYPE("ROWCOMPARE");
  
*************** _outRowCompareExpr(StringInfo str, RowCo
*** 1307,1313 ****
  }
  
  static void
! _outCoalesceExpr(StringInfo str, CoalesceExpr *node)
  {
  	WRITE_NODE_TYPE("COALESCE");
  
--- 1307,1313 ----
  }
  
  static void
! _outCoalesceExpr(StringInfo str, const CoalesceExpr *node)
  {
  	WRITE_NODE_TYPE("COALESCE");
  
*************** _outCoalesceExpr(StringInfo str, Coalesc
*** 1318,1324 ****
  }
  
  static void
! _outMinMaxExpr(StringInfo str, MinMaxExpr *node)
  {
  	WRITE_NODE_TYPE("MINMAX");
  
--- 1318,1324 ----
  }
  
  static void
! _outMinMaxExpr(StringInfo str, const MinMaxExpr *node)
  {
  	WRITE_NODE_TYPE("MINMAX");
  
*************** _outMinMaxExpr(StringInfo str, MinMaxExp
*** 1331,1337 ****
  }
  
  static void
! _outXmlExpr(StringInfo str, XmlExpr *node)
  {
  	WRITE_NODE_TYPE("XMLEXPR");
  
--- 1331,1337 ----
  }
  
  static void
! _outXmlExpr(StringInfo str, const XmlExpr *node)
  {
  	WRITE_NODE_TYPE("XMLEXPR");
  
*************** _outXmlExpr(StringInfo str, XmlExpr *nod
*** 1347,1353 ****
  }
  
  static void
! _outNullTest(StringInfo str, NullTest *node)
  {
  	WRITE_NODE_TYPE("NULLTEST");
  
--- 1347,1353 ----
  }
  
  static void
! _outNullTest(StringInfo str, const NullTest *node)
  {
  	WRITE_NODE_TYPE("NULLTEST");
  
*************** _outNullTest(StringInfo str, NullTest *n
*** 1357,1363 ****
  }
  
  static void
! _outBooleanTest(StringInfo str, BooleanTest *node)
  {
  	WRITE_NODE_TYPE("BOOLEANTEST");
  
--- 1357,1363 ----
  }
  
  static void
! _outBooleanTest(StringInfo str, const BooleanTest *node)
  {
  	WRITE_NODE_TYPE("BOOLEANTEST");
  
*************** _outBooleanTest(StringInfo str, BooleanT
*** 1366,1372 ****
  }
  
  static void
! _outCoerceToDomain(StringInfo str, CoerceToDomain *node)
  {
  	WRITE_NODE_TYPE("COERCETODOMAIN");
  
--- 1366,1372 ----
  }
  
  static void
! _outCoerceToDomain(StringInfo str, const CoerceToDomain *node)
  {
  	WRITE_NODE_TYPE("COERCETODOMAIN");
  
*************** _outCoerceToDomain(StringInfo str, Coerc
*** 1379,1385 ****
  }
  
  static void
! _outCoerceToDomainValue(StringInfo str, CoerceToDomainValue *node)
  {
  	WRITE_NODE_TYPE("COERCETODOMAINVALUE");
  
--- 1379,1385 ----
  }
  
  static void
! _outCoerceToDomainValue(StringInfo str, const CoerceToDomainValue *node)
  {
  	WRITE_NODE_TYPE("COERCETODOMAINVALUE");
  
*************** _outCoerceToDomainValue(StringInfo str,
*** 1390,1396 ****
  }
  
  static void
! _outSetToDefault(StringInfo str, SetToDefault *node)
  {
  	WRITE_NODE_TYPE("SETTODEFAULT");
  
--- 1390,1396 ----
  }
  
  static void
! _outSetToDefault(StringInfo str, const SetToDefault *node)
  {
  	WRITE_NODE_TYPE("SETTODEFAULT");
  
*************** _outSetToDefault(StringInfo str, SetToDe
*** 1401,1407 ****
  }
  
  static void
! _outCurrentOfExpr(StringInfo str, CurrentOfExpr *node)
  {
  	WRITE_NODE_TYPE("CURRENTOFEXPR");
  
--- 1401,1407 ----
  }
  
  static void
! _outCurrentOfExpr(StringInfo str, const CurrentOfExpr *node)
  {
  	WRITE_NODE_TYPE("CURRENTOFEXPR");
  
*************** _outCurrentOfExpr(StringInfo str, Curren
*** 1411,1417 ****
  }
  
  static void
! _outTargetEntry(StringInfo str, TargetEntry *node)
  {
  	WRITE_NODE_TYPE("TARGETENTRY");
  
--- 1411,1417 ----
  }
  
  static void
! _outTargetEntry(StringInfo str, const TargetEntry *node)
  {
  	WRITE_NODE_TYPE("TARGETENTRY");
  
*************** _outTargetEntry(StringInfo str, TargetEn
*** 1425,1431 ****
  }
  
  static void
! _outRangeTblRef(StringInfo str, RangeTblRef *node)
  {
  	WRITE_NODE_TYPE("RANGETBLREF");
  
--- 1425,1431 ----
  }
  
  static void
! _outRangeTblRef(StringInfo str, const RangeTblRef *node)
  {
  	WRITE_NODE_TYPE("RANGETBLREF");
  
*************** _outRangeTblRef(StringInfo str, RangeTbl
*** 1433,1439 ****
  }
  
  static void
! _outJoinExpr(StringInfo str, JoinExpr *node)
  {
  	WRITE_NODE_TYPE("JOINEXPR");
  
--- 1433,1439 ----
  }
  
  static void
! _outJoinExpr(StringInfo str, const JoinExpr *node)
  {
  	WRITE_NODE_TYPE("JOINEXPR");
  
*************** _outJoinExpr(StringInfo str, JoinExpr *n
*** 1448,1454 ****
  }
  
  static void
! _outFromExpr(StringInfo str, FromExpr *node)
  {
  	WRITE_NODE_TYPE("FROMEXPR");
  
--- 1448,1454 ----
  }
  
  static void
! _outFromExpr(StringInfo str, const FromExpr *node)
  {
  	WRITE_NODE_TYPE("FROMEXPR");
  
*************** _outFromExpr(StringInfo str, FromExpr *n
*** 1469,1475 ****
   * We can print the parent's relids for identification purposes, though.
   */
  static void
! _outPathInfo(StringInfo str, Path *node)
  {
  	WRITE_ENUM_FIELD(pathtype, NodeTag);
  	appendStringInfo(str, " :parent_relids ");
--- 1469,1475 ----
   * We can print the parent's relids for identification purposes, though.
   */
  static void
! _outPathInfo(StringInfo str, const Path *node)
  {
  	WRITE_ENUM_FIELD(pathtype, NodeTag);
  	appendStringInfo(str, " :parent_relids ");
*************** _outPathInfo(StringInfo str, Path *node)
*** 1483,1491 ****
   * print the basic stuff of all nodes that inherit from JoinPath
   */
  static void
! _outJoinPathInfo(StringInfo str, JoinPath *node)
  {
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_ENUM_FIELD(jointype, JoinType);
  	WRITE_NODE_FIELD(outerjoinpath);
--- 1483,1491 ----
   * print the basic stuff of all nodes that inherit from JoinPath
   */
  static void
! _outJoinPathInfo(StringInfo str, const JoinPath *node)
  {
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_ENUM_FIELD(jointype, JoinType);
  	WRITE_NODE_FIELD(outerjoinpath);
*************** _outJoinPathInfo(StringInfo str, JoinPat
*** 1494,1512 ****
  }
  
  static void
! _outPath(StringInfo str, Path *node)
  {
  	WRITE_NODE_TYPE("PATH");
  
! 	_outPathInfo(str, (Path *) node);
  }
  
  static void
! _outIndexPath(StringInfo str, IndexPath *node)
  {
  	WRITE_NODE_TYPE("INDEXPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(indexinfo);
  	WRITE_NODE_FIELD(indexclauses);
--- 1494,1512 ----
  }
  
  static void
! _outPath(StringInfo str, const Path *node)
  {
  	WRITE_NODE_TYPE("PATH");
  
! 	_outPathInfo(str, (const Path *) node);
  }
  
  static void
! _outIndexPath(StringInfo str, const IndexPath *node)
  {
  	WRITE_NODE_TYPE("INDEXPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(indexinfo);
  	WRITE_NODE_FIELD(indexclauses);
*************** _outIndexPath(StringInfo str, IndexPath
*** 1520,1530 ****
  }
  
  static void
! _outBitmapHeapPath(StringInfo str, BitmapHeapPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPHEAPPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(bitmapqual);
  	WRITE_BOOL_FIELD(isjoininner);
--- 1520,1530 ----
  }
  
  static void
! _outBitmapHeapPath(StringInfo str, const BitmapHeapPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPHEAPPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(bitmapqual);
  	WRITE_BOOL_FIELD(isjoininner);
*************** _outBitmapHeapPath(StringInfo str, Bitma
*** 1532,1625 ****
  }
  
  static void
! _outBitmapAndPath(StringInfo str, BitmapAndPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPANDPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(bitmapquals);
  	WRITE_FLOAT_FIELD(bitmapselectivity, "%.4f");
  }
  
  static void
! _outBitmapOrPath(StringInfo str, BitmapOrPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPORPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(bitmapquals);
  	WRITE_FLOAT_FIELD(bitmapselectivity, "%.4f");
  }
  
  static void
! _outTidPath(StringInfo str, TidPath *node)
  {
  	WRITE_NODE_TYPE("TIDPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(tidquals);
  }
  
  static void
! _outForeignPath(StringInfo str, ForeignPath *node)
  {
  	WRITE_NODE_TYPE("FOREIGNPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(fdwplan);
  }
  
  static void
! _outAppendPath(StringInfo str, AppendPath *node)
  {
  	WRITE_NODE_TYPE("APPENDPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(subpaths);
  }
  
  static void
! _outMergeAppendPath(StringInfo str, MergeAppendPath *node)
  {
  	WRITE_NODE_TYPE("MERGEAPPENDPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(subpaths);
  	WRITE_FLOAT_FIELD(limit_tuples, "%.0f");
  }
  
  static void
! _outResultPath(StringInfo str, ResultPath *node)
  {
  	WRITE_NODE_TYPE("RESULTPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(quals);
  }
  
  static void
! _outMaterialPath(StringInfo str, MaterialPath *node)
  {
  	WRITE_NODE_TYPE("MATERIALPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(subpath);
  }
  
  static void
! _outUniquePath(StringInfo str, UniquePath *node)
  {
  	WRITE_NODE_TYPE("UNIQUEPATH");
  
! 	_outPathInfo(str, (Path *) node);
  
  	WRITE_NODE_FIELD(subpath);
  	WRITE_ENUM_FIELD(umethod, UniquePathMethod);
--- 1532,1625 ----
  }
  
  static void
! _outBitmapAndPath(StringInfo str, const BitmapAndPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPANDPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(bitmapquals);
  	WRITE_FLOAT_FIELD(bitmapselectivity, "%.4f");
  }
  
  static void
! _outBitmapOrPath(StringInfo str, const BitmapOrPath *node)
  {
  	WRITE_NODE_TYPE("BITMAPORPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(bitmapquals);
  	WRITE_FLOAT_FIELD(bitmapselectivity, "%.4f");
  }
  
  static void
! _outTidPath(StringInfo str, const TidPath *node)
  {
  	WRITE_NODE_TYPE("TIDPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(tidquals);
  }
  
  static void
! _outForeignPath(StringInfo str, const ForeignPath *node)
  {
  	WRITE_NODE_TYPE("FOREIGNPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(fdwplan);
  }
  
  static void
! _outAppendPath(StringInfo str, const AppendPath *node)
  {
  	WRITE_NODE_TYPE("APPENDPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(subpaths);
  }
  
  static void
! _outMergeAppendPath(StringInfo str, const MergeAppendPath *node)
  {
  	WRITE_NODE_TYPE("MERGEAPPENDPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(subpaths);
  	WRITE_FLOAT_FIELD(limit_tuples, "%.0f");
  }
  
  static void
! _outResultPath(StringInfo str, const ResultPath *node)
  {
  	WRITE_NODE_TYPE("RESULTPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(quals);
  }
  
  static void
! _outMaterialPath(StringInfo str, const MaterialPath *node)
  {
  	WRITE_NODE_TYPE("MATERIALPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(subpath);
  }
  
  static void
! _outUniquePath(StringInfo str, const UniquePath *node)
  {
  	WRITE_NODE_TYPE("UNIQUEPATH");
  
! 	_outPathInfo(str, (const Path *) node);
  
  	WRITE_NODE_FIELD(subpath);
  	WRITE_ENUM_FIELD(umethod, UniquePathMethod);
*************** _outUniquePath(StringInfo str, UniquePat
*** 1629,1647 ****
  }
  
  static void
! _outNestPath(StringInfo str, NestPath *node)
  {
  	WRITE_NODE_TYPE("NESTPATH");
  
! 	_outJoinPathInfo(str, (JoinPath *) node);
  }
  
  static void
! _outMergePath(StringInfo str, MergePath *node)
  {
  	WRITE_NODE_TYPE("MERGEPATH");
  
! 	_outJoinPathInfo(str, (JoinPath *) node);
  
  	WRITE_NODE_FIELD(path_mergeclauses);
  	WRITE_NODE_FIELD(outersortkeys);
--- 1629,1647 ----
  }
  
  static void
! _outNestPath(StringInfo str, const NestPath *node)
  {
  	WRITE_NODE_TYPE("NESTPATH");
  
! 	_outJoinPathInfo(str, (const JoinPath *) node);
  }
  
  static void
! _outMergePath(StringInfo str, const MergePath *node)
  {
  	WRITE_NODE_TYPE("MERGEPATH");
  
! 	_outJoinPathInfo(str, (const JoinPath *) node);
  
  	WRITE_NODE_FIELD(path_mergeclauses);
  	WRITE_NODE_FIELD(outersortkeys);
*************** _outMergePath(StringInfo str, MergePath
*** 1650,1667 ****
  }
  
  static void
! _outHashPath(StringInfo str, HashPath *node)
  {
  	WRITE_NODE_TYPE("HASHPATH");
  
! 	_outJoinPathInfo(str, (JoinPath *) node);
  
  	WRITE_NODE_FIELD(path_hashclauses);
  	WRITE_INT_FIELD(num_batches);
  }
  
  static void
! _outPlannerGlobal(StringInfo str, PlannerGlobal *node)
  {
  	WRITE_NODE_TYPE("PLANNERGLOBAL");
  
--- 1650,1667 ----
  }
  
  static void
! _outHashPath(StringInfo str, const HashPath *node)
  {
  	WRITE_NODE_TYPE("HASHPATH");
  
! 	_outJoinPathInfo(str, (const JoinPath *) node);
  
  	WRITE_NODE_FIELD(path_hashclauses);
  	WRITE_INT_FIELD(num_batches);
  }
  
  static void
! _outPlannerGlobal(StringInfo str, const PlannerGlobal *node)
  {
  	WRITE_NODE_TYPE("PLANNERGLOBAL");
  
*************** _outPlannerGlobal(StringInfo str, Planne
*** 1680,1686 ****
  }
  
  static void
! _outPlannerInfo(StringInfo str, PlannerInfo *node)
  {
  	WRITE_NODE_TYPE("PLANNERINFO");
  
--- 1680,1686 ----
  }
  
  static void
! _outPlannerInfo(StringInfo str, const PlannerInfo *node)
  {
  	WRITE_NODE_TYPE("PLANNERINFO");
  
*************** _outPlannerInfo(StringInfo str, PlannerI
*** 1721,1727 ****
  }
  
  static void
! _outRelOptInfo(StringInfo str, RelOptInfo *node)
  {
  	WRITE_NODE_TYPE("RELOPTINFO");
  
--- 1721,1727 ----
  }
  
  static void
! _outRelOptInfo(StringInfo str, const RelOptInfo *node)
  {
  	WRITE_NODE_TYPE("RELOPTINFO");
  
*************** _outRelOptInfo(StringInfo str, RelOptInf
*** 1754,1760 ****
  }
  
  static void
! _outIndexOptInfo(StringInfo str, IndexOptInfo *node)
  {
  	WRITE_NODE_TYPE("INDEXOPTINFO");
  
--- 1754,1760 ----
  }
  
  static void
! _outIndexOptInfo(StringInfo str, const IndexOptInfo *node)
  {
  	WRITE_NODE_TYPE("INDEXOPTINFO");
  
*************** _outIndexOptInfo(StringInfo str, IndexOp
*** 1775,1781 ****
  }
  
  static void
! _outEquivalenceClass(StringInfo str, EquivalenceClass *node)
  {
  	/*
  	 * To simplify reading, we just chase up to the topmost merged EC and
--- 1775,1781 ----
  }
  
  static void
! _outEquivalenceClass(StringInfo str, const EquivalenceClass *node)
  {
  	/*
  	 * To simplify reading, we just chase up to the topmost merged EC and
*************** _outEquivalenceClass(StringInfo str, Equ
*** 1800,1806 ****
  }
  
  static void
! _outEquivalenceMember(StringInfo str, EquivalenceMember *node)
  {
  	WRITE_NODE_TYPE("EQUIVALENCEMEMBER");
  
--- 1800,1806 ----
  }
  
  static void
! _outEquivalenceMember(StringInfo str, const EquivalenceMember *node)
  {
  	WRITE_NODE_TYPE("EQUIVALENCEMEMBER");
  
*************** _outEquivalenceMember(StringInfo str, Eq
*** 1812,1818 ****
  }
  
  static void
! _outPathKey(StringInfo str, PathKey *node)
  {
  	WRITE_NODE_TYPE("PATHKEY");
  
--- 1812,1818 ----
  }
  
  static void
! _outPathKey(StringInfo str, const PathKey *node)
  {
  	WRITE_NODE_TYPE("PATHKEY");
  
*************** _outPathKey(StringInfo str, PathKey *nod
*** 1823,1829 ****
  }
  
  static void
! _outRestrictInfo(StringInfo str, RestrictInfo *node)
  {
  	WRITE_NODE_TYPE("RESTRICTINFO");
  
--- 1823,1829 ----
  }
  
  static void
! _outRestrictInfo(StringInfo str, const RestrictInfo *node)
  {
  	WRITE_NODE_TYPE("RESTRICTINFO");
  
*************** _outRestrictInfo(StringInfo str, Restric
*** 1852,1858 ****
  }
  
  static void
! _outInnerIndexscanInfo(StringInfo str, InnerIndexscanInfo *node)
  {
  	WRITE_NODE_TYPE("INNERINDEXSCANINFO");
  	WRITE_BITMAPSET_FIELD(other_relids);
--- 1852,1858 ----
  }
  
  static void
! _outInnerIndexscanInfo(StringInfo str, const InnerIndexscanInfo *node)
  {
  	WRITE_NODE_TYPE("INNERINDEXSCANINFO");
  	WRITE_BITMAPSET_FIELD(other_relids);
*************** _outInnerIndexscanInfo(StringInfo str, I
*** 1862,1868 ****
  }
  
  static void
! _outPlaceHolderVar(StringInfo str, PlaceHolderVar *node)
  {
  	WRITE_NODE_TYPE("PLACEHOLDERVAR");
  
--- 1862,1868 ----
  }
  
  static void
! _outPlaceHolderVar(StringInfo str, const PlaceHolderVar *node)
  {
  	WRITE_NODE_TYPE("PLACEHOLDERVAR");
  
*************** _outPlaceHolderVar(StringInfo str, Place
*** 1873,1879 ****
  }
  
  static void
! _outSpecialJoinInfo(StringInfo str, SpecialJoinInfo *node)
  {
  	WRITE_NODE_TYPE("SPECIALJOININFO");
  
--- 1873,1879 ----
  }
  
  static void
! _outSpecialJoinInfo(StringInfo str, const SpecialJoinInfo *node)
  {
  	WRITE_NODE_TYPE("SPECIALJOININFO");
  
*************** _outSpecialJoinInfo(StringInfo str, Spec
*** 1888,1894 ****
  }
  
  static void
! _outAppendRelInfo(StringInfo str, AppendRelInfo *node)
  {
  	WRITE_NODE_TYPE("APPENDRELINFO");
  
--- 1888,1894 ----
  }
  
  static void
! _outAppendRelInfo(StringInfo str, const AppendRelInfo *node)
  {
  	WRITE_NODE_TYPE("APPENDRELINFO");
  
*************** _outAppendRelInfo(StringInfo str, Append
*** 1901,1907 ****
  }
  
  static void
! _outPlaceHolderInfo(StringInfo str, PlaceHolderInfo *node)
  {
  	WRITE_NODE_TYPE("PLACEHOLDERINFO");
  
--- 1901,1907 ----
  }
  
  static void
! _outPlaceHolderInfo(StringInfo str, const PlaceHolderInfo *node)
  {
  	WRITE_NODE_TYPE("PLACEHOLDERINFO");
  
*************** _outPlaceHolderInfo(StringInfo str, Plac
*** 1914,1920 ****
  }
  
  static void
! _outMinMaxAggInfo(StringInfo str, MinMaxAggInfo *node)
  {
  	WRITE_NODE_TYPE("MINMAXAGGINFO");
  
--- 1914,1920 ----
  }
  
  static void
! _outMinMaxAggInfo(StringInfo str, const MinMaxAggInfo *node)
  {
  	WRITE_NODE_TYPE("MINMAXAGGINFO");
  
*************** _outMinMaxAggInfo(StringInfo str, MinMax
*** 1928,1934 ****
  }
  
  static void
! _outPlannerParamItem(StringInfo str, PlannerParamItem *node)
  {
  	WRITE_NODE_TYPE("PLANNERPARAMITEM");
  
--- 1928,1934 ----
  }
  
  static void
! _outPlannerParamItem(StringInfo str, const PlannerParamItem *node)
  {
  	WRITE_NODE_TYPE("PLANNERPARAMITEM");
  
*************** _outPlannerParamItem(StringInfo str, Pla
*** 1943,1949 ****
   *****************************************************************************/
  
  static void
! _outCreateStmt(StringInfo str, CreateStmt *node)
  {
  	WRITE_NODE_TYPE("CREATESTMT");
  
--- 1943,1949 ----
   *****************************************************************************/
  
  static void
! _outCreateStmt(StringInfo str, const CreateStmt *node)
  {
  	WRITE_NODE_TYPE("CREATESTMT");
  
*************** _outCreateStmt(StringInfo str, CreateStm
*** 1959,1976 ****
  }
  
  static void
! _outCreateForeignTableStmt(StringInfo str, CreateForeignTableStmt *node)
  {
  	WRITE_NODE_TYPE("CREATEFOREIGNTABLESTMT");
  
! 	_outCreateStmt(str, (CreateStmt *) &node->base);
  
  	WRITE_STRING_FIELD(servername);
  	WRITE_NODE_FIELD(options);
  }
  
  static void
! _outIndexStmt(StringInfo str, IndexStmt *node)
  {
  	WRITE_NODE_TYPE("INDEXSTMT");
  
--- 1959,1976 ----
  }
  
  static void
! _outCreateForeignTableStmt(StringInfo str, const CreateForeignTableStmt *node)
  {
  	WRITE_NODE_TYPE("CREATEFOREIGNTABLESTMT");
  
! 	_outCreateStmt(str, (const CreateStmt *) &node->base);
  
  	WRITE_STRING_FIELD(servername);
  	WRITE_NODE_FIELD(options);
  }
  
  static void
! _outIndexStmt(StringInfo str, const IndexStmt *node)
  {
  	WRITE_NODE_TYPE("INDEXSTMT");
  
*************** _outIndexStmt(StringInfo str, IndexStmt
*** 1993,1999 ****
  }
  
  static void
! _outNotifyStmt(StringInfo str, NotifyStmt *node)
  {
  	WRITE_NODE_TYPE("NOTIFY");
  
--- 1993,1999 ----
  }
  
  static void
! _outNotifyStmt(StringInfo str, const NotifyStmt *node)
  {
  	WRITE_NODE_TYPE("NOTIFY");
  
*************** _outNotifyStmt(StringInfo str, NotifyStm
*** 2002,2008 ****
  }
  
  static void
! _outDeclareCursorStmt(StringInfo str, DeclareCursorStmt *node)
  {
  	WRITE_NODE_TYPE("DECLARECURSOR");
  
--- 2002,2008 ----
  }
  
  static void
! _outDeclareCursorStmt(StringInfo str, const DeclareCursorStmt *node)
  {
  	WRITE_NODE_TYPE("DECLARECURSOR");
  
*************** _outDeclareCursorStmt(StringInfo str, De
*** 2012,2018 ****
  }
  
  static void
! _outSelectStmt(StringInfo str, SelectStmt *node)
  {
  	WRITE_NODE_TYPE("SELECT");
  
--- 2012,2018 ----
  }
  
  static void
! _outSelectStmt(StringInfo str, const SelectStmt *node)
  {
  	WRITE_NODE_TYPE("SELECT");
  
*************** _outSelectStmt(StringInfo str, SelectStm
*** 2037,2043 ****
  }
  
  static void
! _outFuncCall(StringInfo str, FuncCall *node)
  {
  	WRITE_NODE_TYPE("FUNCCALL");
  
--- 2037,2043 ----
  }
  
  static void
! _outFuncCall(StringInfo str, const FuncCall *node)
  {
  	WRITE_NODE_TYPE("FUNCCALL");
  
*************** _outFuncCall(StringInfo str, FuncCall *n
*** 2052,2058 ****
  }
  
  static void
! _outDefElem(StringInfo str, DefElem *node)
  {
  	WRITE_NODE_TYPE("DEFELEM");
  
--- 2052,2058 ----
  }
  
  static void
! _outDefElem(StringInfo str, const DefElem *node)
  {
  	WRITE_NODE_TYPE("DEFELEM");
  
*************** _outDefElem(StringInfo str, DefElem *nod
*** 2063,2069 ****
  }
  
  static void
! _outInhRelation(StringInfo str, InhRelation *node)
  {
  	WRITE_NODE_TYPE("INHRELATION");
  
--- 2063,2069 ----
  }
  
  static void
! _outInhRelation(StringInfo str, const InhRelation *node)
  {
  	WRITE_NODE_TYPE("INHRELATION");
  
*************** _outInhRelation(StringInfo str, InhRelat
*** 2072,2078 ****
  }
  
  static void
! _outLockingClause(StringInfo str, LockingClause *node)
  {
  	WRITE_NODE_TYPE("LOCKINGCLAUSE");
  
--- 2072,2078 ----
  }
  
  static void
! _outLockingClause(StringInfo str, const LockingClause *node)
  {
  	WRITE_NODE_TYPE("LOCKINGCLAUSE");
  
*************** _outLockingClause(StringInfo str, Lockin
*** 2082,2088 ****
  }
  
  static void
! _outXmlSerialize(StringInfo str, XmlSerialize *node)
  {
  	WRITE_NODE_TYPE("XMLSERIALIZE");
  
--- 2082,2088 ----
  }
  
  static void
! _outXmlSerialize(StringInfo str, const XmlSerialize *node)
  {
  	WRITE_NODE_TYPE("XMLSERIALIZE");
  
*************** _outXmlSerialize(StringInfo str, XmlSeri
*** 2093,2099 ****
  }
  
  static void
! _outColumnDef(StringInfo str, ColumnDef *node)
  {
  	WRITE_NODE_TYPE("COLUMNDEF");
  
--- 2093,2099 ----
  }
  
  static void
! _outColumnDef(StringInfo str, const ColumnDef *node)
  {
  	WRITE_NODE_TYPE("COLUMNDEF");
  
*************** _outColumnDef(StringInfo str, ColumnDef
*** 2113,2119 ****
  }
  
  static void
! _outTypeName(StringInfo str, TypeName *node)
  {
  	WRITE_NODE_TYPE("TYPENAME");
  
--- 2113,2119 ----
  }
  
  static void
! _outTypeName(StringInfo str, const TypeName *node)
  {
  	WRITE_NODE_TYPE("TYPENAME");
  
*************** _outTypeName(StringInfo str, TypeName *n
*** 2128,2134 ****
  }
  
  static void
! _outTypeCast(StringInfo str, TypeCast *node)
  {
  	WRITE_NODE_TYPE("TYPECAST");
  
--- 2128,2134 ----
  }
  
  static void
! _outTypeCast(StringInfo str, const TypeCast *node)
  {
  	WRITE_NODE_TYPE("TYPECAST");
  
*************** _outTypeCast(StringInfo str, TypeCast *n
*** 2138,2144 ****
  }
  
  static void
! _outCollateClause(StringInfo str, CollateClause *node)
  {
  	WRITE_NODE_TYPE("COLLATECLAUSE");
  
--- 2138,2144 ----
  }
  
  static void
! _outCollateClause(StringInfo str, const CollateClause *node)
  {
  	WRITE_NODE_TYPE("COLLATECLAUSE");
  
*************** _outCollateClause(StringInfo str, Collat
*** 2148,2154 ****
  }
  
  static void
! _outIndexElem(StringInfo str, IndexElem *node)
  {
  	WRITE_NODE_TYPE("INDEXELEM");
  
--- 2148,2154 ----
  }
  
  static void
! _outIndexElem(StringInfo str, const IndexElem *node)
  {
  	WRITE_NODE_TYPE("INDEXELEM");
  
*************** _outIndexElem(StringInfo str, IndexElem
*** 2162,2168 ****
  }
  
  static void
! _outQuery(StringInfo str, Query *node)
  {
  	WRITE_NODE_TYPE("QUERY");
  
--- 2162,2168 ----
  }
  
  static void
! _outQuery(StringInfo str, const Query *node)
  {
  	WRITE_NODE_TYPE("QUERY");
  
*************** _outQuery(StringInfo str, Query *node)
*** 2222,2228 ****
  }
  
  static void
! _outSortGroupClause(StringInfo str, SortGroupClause *node)
  {
  	WRITE_NODE_TYPE("SORTGROUPCLAUSE");
  
--- 2222,2228 ----
  }
  
  static void
! _outSortGroupClause(StringInfo str, const SortGroupClause *node)
  {
  	WRITE_NODE_TYPE("SORTGROUPCLAUSE");
  
*************** _outSortGroupClause(StringInfo str, Sort
*** 2234,2240 ****
  }
  
  static void
! _outWindowClause(StringInfo str, WindowClause *node)
  {
  	WRITE_NODE_TYPE("WINDOWCLAUSE");
  
--- 2234,2240 ----
  }
  
  static void
! _outWindowClause(StringInfo str, const WindowClause *node)
  {
  	WRITE_NODE_TYPE("WINDOWCLAUSE");
  
*************** _outWindowClause(StringInfo str, WindowC
*** 2250,2256 ****
  }
  
  static void
! _outRowMarkClause(StringInfo str, RowMarkClause *node)
  {
  	WRITE_NODE_TYPE("ROWMARKCLAUSE");
  
--- 2250,2256 ----
  }
  
  static void
! _outRowMarkClause(StringInfo str, const RowMarkClause *node)
  {
  	WRITE_NODE_TYPE("ROWMARKCLAUSE");
  
*************** _outRowMarkClause(StringInfo str, RowMar
*** 2261,2267 ****
  }
  
  static void
! _outWithClause(StringInfo str, WithClause *node)
  {
  	WRITE_NODE_TYPE("WITHCLAUSE");
  
--- 2261,2267 ----
  }
  
  static void
! _outWithClause(StringInfo str, const WithClause *node)
  {
  	WRITE_NODE_TYPE("WITHCLAUSE");
  
*************** _outWithClause(StringInfo str, WithClaus
*** 2271,2277 ****
  }
  
  static void
! _outCommonTableExpr(StringInfo str, CommonTableExpr *node)
  {
  	WRITE_NODE_TYPE("COMMONTABLEEXPR");
  
--- 2271,2277 ----
  }
  
  static void
! _outCommonTableExpr(StringInfo str, const CommonTableExpr *node)
  {
  	WRITE_NODE_TYPE("COMMONTABLEEXPR");
  
*************** _outCommonTableExpr(StringInfo str, Comm
*** 2288,2294 ****
  }
  
  static void
! _outSetOperationStmt(StringInfo str, SetOperationStmt *node)
  {
  	WRITE_NODE_TYPE("SETOPERATIONSTMT");
  
--- 2288,2294 ----
  }
  
  static void
! _outSetOperationStmt(StringInfo str, const SetOperationStmt *node)
  {
  	WRITE_NODE_TYPE("SETOPERATIONSTMT");
  
*************** _outSetOperationStmt(StringInfo str, Set
*** 2303,2309 ****
  }
  
  static void
! _outRangeTblEntry(StringInfo str, RangeTblEntry *node)
  {
  	WRITE_NODE_TYPE("RTE");
  
--- 2303,2309 ----
  }
  
  static void
! _outRangeTblEntry(StringInfo str, const RangeTblEntry *node)
  {
  	WRITE_NODE_TYPE("RTE");
  
*************** _outRangeTblEntry(StringInfo str, RangeT
*** 2357,2363 ****
  }
  
  static void
! _outAExpr(StringInfo str, A_Expr *node)
  {
  	WRITE_NODE_TYPE("AEXPR");
  
--- 2357,2363 ----
  }
  
  static void
! _outAExpr(StringInfo str, const A_Expr *node)
  {
  	WRITE_NODE_TYPE("AEXPR");
  
*************** _outAExpr(StringInfo str, A_Expr *node)
*** 2413,2419 ****
  }
  
  static void
! _outValue(StringInfo str, Value *value)
  {
  	switch (value->type)
  	{
--- 2413,2419 ----
  }
  
  static void
! _outValue(StringInfo str, const Value *value)
  {
  	switch (value->type)
  	{
*************** _outValue(StringInfo str, Value *value)
*** 2448,2454 ****
  }
  
  static void
! _outColumnRef(StringInfo str, ColumnRef *node)
  {
  	WRITE_NODE_TYPE("COLUMNREF");
  
--- 2448,2454 ----
  }
  
  static void
! _outColumnRef(StringInfo str, const ColumnRef *node)
  {
  	WRITE_NODE_TYPE("COLUMNREF");
  
*************** _outColumnRef(StringInfo str, ColumnRef
*** 2457,2463 ****
  }
  
  static void
! _outParamRef(StringInfo str, ParamRef *node)
  {
  	WRITE_NODE_TYPE("PARAMREF");
  
--- 2457,2463 ----
  }
  
  static void
! _outParamRef(StringInfo str, const ParamRef *node)
  {
  	WRITE_NODE_TYPE("PARAMREF");
  
*************** _outParamRef(StringInfo str, ParamRef *n
*** 2466,2472 ****
  }
  
  static void
! _outAConst(StringInfo str, A_Const *node)
  {
  	WRITE_NODE_TYPE("A_CONST");
  
--- 2466,2472 ----
  }
  
  static void
! _outAConst(StringInfo str, const A_Const *node)
  {
  	WRITE_NODE_TYPE("A_CONST");
  
*************** _outAConst(StringInfo str, A_Const *node
*** 2476,2488 ****
  }
  
  static void
! _outA_Star(StringInfo str, A_Star *node)
  {
  	WRITE_NODE_TYPE("A_STAR");
  }
  
  static void
! _outA_Indices(StringInfo str, A_Indices *node)
  {
  	WRITE_NODE_TYPE("A_INDICES");
  
--- 2476,2488 ----
  }
  
  static void
! _outA_Star(StringInfo str, const A_Star *node)
  {
  	WRITE_NODE_TYPE("A_STAR");
  }
  
  static void
! _outA_Indices(StringInfo str, const A_Indices *node)
  {
  	WRITE_NODE_TYPE("A_INDICES");
  
*************** _outA_Indices(StringInfo str, A_Indices
*** 2491,2497 ****
  }
  
  static void
! _outA_Indirection(StringInfo str, A_Indirection *node)
  {
  	WRITE_NODE_TYPE("A_INDIRECTION");
  
--- 2491,2497 ----
  }
  
  static void
! _outA_Indirection(StringInfo str, const A_Indirection *node)
  {
  	WRITE_NODE_TYPE("A_INDIRECTION");
  
*************** _outA_Indirection(StringInfo str, A_Indi
*** 2500,2506 ****
  }
  
  static void
! _outA_ArrayExpr(StringInfo str, A_ArrayExpr *node)
  {
  	WRITE_NODE_TYPE("A_ARRAYEXPR");
  
--- 2500,2506 ----
  }
  
  static void
! _outA_ArrayExpr(StringInfo str, const A_ArrayExpr *node)
  {
  	WRITE_NODE_TYPE("A_ARRAYEXPR");
  
*************** _outA_ArrayExpr(StringInfo str, A_ArrayE
*** 2509,2515 ****
  }
  
  static void
! _outResTarget(StringInfo str, ResTarget *node)
  {
  	WRITE_NODE_TYPE("RESTARGET");
  
--- 2509,2515 ----
  }
  
  static void
! _outResTarget(StringInfo str, const ResTarget *node)
  {
  	WRITE_NODE_TYPE("RESTARGET");
  
*************** _outResTarget(StringInfo str, ResTarget
*** 2520,2526 ****
  }
  
  static void
! _outSortBy(StringInfo str, SortBy *node)
  {
  	WRITE_NODE_TYPE("SORTBY");
  
--- 2520,2526 ----
  }
  
  static void
! _outSortBy(StringInfo str, const SortBy *node)
  {
  	WRITE_NODE_TYPE("SORTBY");
  
*************** _outSortBy(StringInfo str, SortBy *node)
*** 2532,2538 ****
  }
  
  static void
! _outWindowDef(StringInfo str, WindowDef *node)
  {
  	WRITE_NODE_TYPE("WINDOWDEF");
  
--- 2532,2538 ----
  }
  
  static void
! _outWindowDef(StringInfo str, const WindowDef *node)
  {
  	WRITE_NODE_TYPE("WINDOWDEF");
  
*************** _outWindowDef(StringInfo str, WindowDef
*** 2547,2553 ****
  }
  
  static void
! _outRangeSubselect(StringInfo str, RangeSubselect *node)
  {
  	WRITE_NODE_TYPE("RANGESUBSELECT");
  
--- 2547,2553 ----
  }
  
  static void
! _outRangeSubselect(StringInfo str, const RangeSubselect *node)
  {
  	WRITE_NODE_TYPE("RANGESUBSELECT");
  
*************** _outRangeSubselect(StringInfo str, Range
*** 2556,2562 ****
  }
  
  static void
! _outRangeFunction(StringInfo str, RangeFunction *node)
  {
  	WRITE_NODE_TYPE("RANGEFUNCTION");
  
--- 2556,2562 ----
  }
  
  static void
! _outRangeFunction(StringInfo str, const RangeFunction *node)
  {
  	WRITE_NODE_TYPE("RANGEFUNCTION");
  
*************** _outRangeFunction(StringInfo str, RangeF
*** 2566,2572 ****
  }
  
  static void
! _outConstraint(StringInfo str, Constraint *node)
  {
  	WRITE_NODE_TYPE("CONSTRAINT");
  
--- 2566,2572 ----
  }
  
  static void
! _outConstraint(StringInfo str, const Constraint *node)
  {
  	WRITE_NODE_TYPE("CONSTRAINT");
  
*************** _outConstraint(StringInfo str, Constrain
*** 2667,2673 ****
   *	  converts a Node into ascii string and append it to 'str'
   */
  static void
! _outNode(StringInfo str, void *obj)
  {
  	if (obj == NULL)
  		appendStringInfo(str, "<>");
--- 2667,2673 ----
   *	  converts a Node into ascii string and append it to 'str'
   */
  static void
! _outNode(StringInfo str, const void *obj)
  {
  	if (obj == NULL)
  		appendStringInfo(str, "<>");
*************** _outNode(StringInfo str, void *obj)
*** 3167,3173 ****
   *	   returns the ascii representation of the Node as a palloc'd string
   */
  char *
! nodeToString(void *obj)
  {
  	StringInfoData str;
  
--- 3167,3173 ----
   *	   returns the ascii representation of the Node as a palloc'd string
   */
  char *
! nodeToString(const void *obj)
  {
  	StringInfoData str;
  
diff --git a/src/backend/nodes/print.c b/src/backend/nodes/print.c
new file mode 100644
index 5fe4fd5..2d60767
*** a/src/backend/nodes/print.c
--- b/src/backend/nodes/print.c
***************
*** 31,37 ****
   *	  print contents of Node to stdout
   */
  void
! print(void *obj)
  {
  	char	   *s;
  	char	   *f;
--- 31,37 ----
   *	  print contents of Node to stdout
   */
  void
! print(const void *obj)
  {
  	char	   *s;
  	char	   *f;
*************** print(void *obj)
*** 49,55 ****
   *	  pretty-print contents of Node to stdout
   */
  void
! pprint(void *obj)
  {
  	char	   *s;
  	char	   *f;
--- 49,55 ----
   *	  pretty-print contents of Node to stdout
   */
  void
! pprint(const void *obj)
  {
  	char	   *s;
  	char	   *f;
*************** pprint(void *obj)
*** 67,73 ****
   *	  send pretty-printed contents of Node to postmaster log
   */
  void
! elog_node_display(int lev, const char *title, void *obj, bool pretty)
  {
  	char	   *s;
  	char	   *f;
--- 67,73 ----
   *	  send pretty-printed contents of Node to postmaster log
   */
  void
! elog_node_display(int lev, const char *title, const void *obj, bool pretty)
  {
  	char	   *s;
  	char	   *f;
*************** pretty_format_node_dump(const char *dump
*** 249,257 ****
   *	  print contents of range table
   */
  void
! print_rt(List *rtable)
  {
! 	ListCell   *l;
  	int			i = 1;
  
  	printf("resno\trefname  \trelid\tinFromCl\n");
--- 249,257 ----
   *	  print contents of range table
   */
  void
! print_rt(const List *rtable)
  {
! 	const ListCell   *l;
  	int			i = 1;
  
  	printf("resno\trefname  \trelid\tinFromCl\n");
*************** print_rt(List *rtable)
*** 304,310 ****
   *	  print an expression
   */
  void
! print_expr(Node *expr, List *rtable)
  {
  	if (expr == NULL)
  	{
--- 304,310 ----
   *	  print an expression
   */
  void
! print_expr(const Node *expr, const List *rtable)
  {
  	if (expr == NULL)
  	{
*************** print_expr(Node *expr, List *rtable)
*** 314,320 ****
  
  	if (IsA(expr, Var))
  	{
! 		Var		   *var = (Var *) expr;
  		char	   *relname,
  				   *attname;
  
--- 314,320 ----
  
  	if (IsA(expr, Var))
  	{
! 		const Var		   *var = (const Var *) expr;
  		char	   *relname,
  				   *attname;
  
*************** print_expr(Node *expr, List *rtable)
*** 348,354 ****
  	}
  	else if (IsA(expr, Const))
  	{
! 		Const	   *c = (Const *) expr;
  		Oid			typoutput;
  		bool		typIsVarlena;
  		char	   *outputstr;
--- 348,354 ----
  	}
  	else if (IsA(expr, Const))
  	{
! 		const Const	   *c = (const Const *) expr;
  		Oid			typoutput;
  		bool		typIsVarlena;
  		char	   *outputstr;
*************** print_expr(Node *expr, List *rtable)
*** 368,393 ****
  	}
  	else if (IsA(expr, OpExpr))
  	{
! 		OpExpr	   *e = (OpExpr *) expr;
  		char	   *opname;
  
  		opname = get_opname(e->opno);
  		if (list_length(e->args) > 1)
  		{
! 			print_expr(get_leftop((Expr *) e), rtable);
  			printf(" %s ", ((opname != NULL) ? opname : "(invalid operator)"));
! 			print_expr(get_rightop((Expr *) e), rtable);
  		}
  		else
  		{
  			/* we print prefix and postfix ops the same... */
  			printf("%s ", ((opname != NULL) ? opname : "(invalid operator)"));
! 			print_expr(get_leftop((Expr *) e), rtable);
  		}
  	}
  	else if (IsA(expr, FuncExpr))
  	{
! 		FuncExpr   *e = (FuncExpr *) expr;
  		char	   *funcname;
  		ListCell   *l;
  
--- 368,393 ----
  	}
  	else if (IsA(expr, OpExpr))
  	{
! 		const OpExpr	   *e = (const OpExpr *) expr;
  		char	   *opname;
  
  		opname = get_opname(e->opno);
  		if (list_length(e->args) > 1)
  		{
! 			print_expr(get_leftop((const Expr *) e), rtable);
  			printf(" %s ", ((opname != NULL) ? opname : "(invalid operator)"));
! 			print_expr(get_rightop((const Expr *) e), rtable);
  		}
  		else
  		{
  			/* we print prefix and postfix ops the same... */
  			printf("%s ", ((opname != NULL) ? opname : "(invalid operator)"));
! 			print_expr(get_leftop((const Expr *) e), rtable);
  		}
  	}
  	else if (IsA(expr, FuncExpr))
  	{
! 		const FuncExpr   *e = (const FuncExpr *) expr;
  		char	   *funcname;
  		ListCell   *l;
  
*************** print_expr(Node *expr, List *rtable)
*** 410,418 ****
   *	  pathkeys list of PathKeys
   */
  void
! print_pathkeys(List *pathkeys, List *rtable)
  {
! 	ListCell   *i;
  
  	printf("(");
  	foreach(i, pathkeys)
--- 410,418 ----
   *	  pathkeys list of PathKeys
   */
  void
! print_pathkeys(const List *pathkeys, const List *rtable)
  {
! 	const ListCell   *i;
  
  	printf("(");
  	foreach(i, pathkeys)
*************** print_pathkeys(List *pathkeys, List *rta
*** 450,458 ****
   *	  print targetlist in a more legible way.
   */
  void
! print_tl(List *tlist, List *rtable)
  {
! 	ListCell   *tl;
  
  	printf("(\n");
  	foreach(tl, tlist)
--- 450,458 ----
   *	  print targetlist in a more legible way.
   */
  void
! print_tl(const List *tlist, const List *rtable)
  {
! 	const ListCell   *tl;
  
  	printf("(\n");
  	foreach(tl, tlist)
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c
new file mode 100644
index 20e315e..31df3f8
*** a/src/backend/optimizer/util/clauses.c
--- b/src/backend/optimizer/util/clauses.c
*************** make_opclause(Oid opno, Oid opresulttype
*** 181,189 ****
   *		or (op expr)
   */
  Node *
! get_leftop(Expr *clause)
  {
! 	OpExpr	   *expr = (OpExpr *) clause;
  
  	if (expr->args != NIL)
  		return linitial(expr->args);
--- 181,189 ----
   *		or (op expr)
   */
  Node *
! get_leftop(const Expr *clause)
  {
! 	const OpExpr	   *expr = (const OpExpr *) clause;
  
  	if (expr->args != NIL)
  		return linitial(expr->args);
*************** get_leftop(Expr *clause)
*** 198,206 ****
   * NB: result will be NULL if applied to a unary op clause.
   */
  Node *
! get_rightop(Expr *clause)
  {
! 	OpExpr	   *expr = (OpExpr *) clause;
  
  	if (list_length(expr->args) >= 2)
  		return lsecond(expr->args);
--- 198,206 ----
   * NB: result will be NULL if applied to a unary op clause.
   */
  Node *
! get_rightop(const Expr *clause)
  {
! 	const OpExpr	   *expr = (const OpExpr *) clause;
  
  	if (list_length(expr->args) >= 2)
  		return lsecond(expr->args);
diff --git a/src/include/nodes/nodeFuncs.h b/src/include/nodes/nodeFuncs.h
new file mode 100644
index 591f2a9..4980dd8
*** a/src/include/nodes/nodeFuncs.h
--- b/src/include/nodes/nodeFuncs.h
***************
*** 26,42 ****
  #define QTW_DONT_COPY_QUERY			0x20		/* do not copy top Query */
  
  
! extern Oid	exprType(Node *expr);
! extern int32 exprTypmod(Node *expr);
! extern bool exprIsLengthCoercion(Node *expr, int32 *coercedTypmod);
  extern bool expression_returns_set(Node *clause);
  
! extern Oid	exprCollation(Node *expr);
! extern Oid	exprInputCollation(Node *expr);
  extern void exprSetCollation(Node *expr, Oid collation);
  extern void exprSetInputCollation(Node *expr, Oid inputcollation);
  
! extern int	exprLocation(Node *expr);
  
  extern bool expression_tree_walker(Node *node, bool (*walker) (),
  											   void *context);
--- 26,42 ----
  #define QTW_DONT_COPY_QUERY			0x20		/* do not copy top Query */
  
  
! extern Oid	exprType(const Node *expr);
! extern int32 exprTypmod(const Node *expr);
! extern bool exprIsLengthCoercion(const Node *expr, int32 *coercedTypmod);
  extern bool expression_returns_set(Node *clause);
  
! extern Oid	exprCollation(const Node *expr);
! extern Oid	exprInputCollation(const Node *expr);
  extern void exprSetCollation(Node *expr, Oid collation);
  extern void exprSetInputCollation(Node *expr, Oid inputcollation);
  
! extern int	exprLocation(const Node *expr);
  
  extern bool expression_tree_walker(Node *node, bool (*walker) (),
  											   void *context);
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
new file mode 100644
index 824d8b5..895a897
*** a/src/include/nodes/nodes.h
--- b/src/include/nodes/nodes.h
*************** typedef struct Node
*** 439,445 ****
  	NodeTag		type;
  } Node;
  
! #define nodeTag(nodeptr)		(((Node*)(nodeptr))->type)
  
  /*
   * newNode -
--- 439,445 ----
  	NodeTag		type;
  } Node;
  
! #define nodeTag(nodeptr)		(((const Node*)(nodeptr))->type)
  
  /*
   * newNode -
*************** extern PGDLLIMPORT Node *newNodeMacroHol
*** 495,501 ****
  /*
   * nodes/{outfuncs.c,print.c}
   */
! extern char *nodeToString(void *obj);
  
  /*
   * nodes/{readfuncs.c,read.c}
--- 495,501 ----
  /*
   * nodes/{outfuncs.c,print.c}
   */
! extern char *nodeToString(const void *obj);
  
  /*
   * nodes/{readfuncs.c,read.c}
*************** extern void *stringToNode(char *str);
*** 505,516 ****
  /*
   * nodes/copyfuncs.c
   */
! extern void *copyObject(void *obj);
  
  /*
   * nodes/equalfuncs.c
   */
! extern bool equal(void *a, void *b);
  
  
  /*
--- 505,516 ----
  /*
   * nodes/copyfuncs.c
   */
! extern void *copyObject(const void *obj);
  
  /*
   * nodes/equalfuncs.c
   */
! extern bool equal(const void *a, const void *b);
  
  
  /*
diff --git a/src/include/nodes/pg_list.h b/src/include/nodes/pg_list.h
new file mode 100644
index 38b94aa..0ddbd21
*** a/src/include/nodes/pg_list.h
--- b/src/include/nodes/pg_list.h
*************** struct ListCell
*** 77,83 ****
  #ifdef USE_INLINE
  
  static inline ListCell *
! list_head(List *l)
  {
  	return l ? l->head : NULL;
  }
--- 77,83 ----
  #ifdef USE_INLINE
  
  static inline ListCell *
! list_head(const List *l)
  {
  	return l ? l->head : NULL;
  }
*************** list_tail(List *l)
*** 89,95 ****
  }
  
  static inline int
! list_length(List *l)
  {
  	return l ? l->length : 0;
  }
--- 89,95 ----
  }
  
  static inline int
! list_length(const List *l)
  {
  	return l ? l->length : 0;
  }
*************** list_length(List *l)
*** 97,103 ****
  
  extern ListCell *list_head(List *l);
  extern ListCell *list_tail(List *l);
! extern int	list_length(List *l);
  #endif   /* USE_INLINE */
  
  /*
--- 97,103 ----
  
  extern ListCell *list_head(List *l);
  extern ListCell *list_tail(List *l);
! extern int	list_length(const List *l);
  #endif   /* USE_INLINE */
  
  /*
*************** extern List *lcons_oid(Oid datum, List *
*** 206,219 ****
  extern List *list_concat(List *list1, List *list2);
  extern List *list_truncate(List *list, int new_size);
  
! extern void *list_nth(List *list, int n);
! extern int	list_nth_int(List *list, int n);
! extern Oid	list_nth_oid(List *list, int n);
  
! extern bool list_member(List *list, void *datum);
! extern bool list_member_ptr(List *list, void *datum);
! extern bool list_member_int(List *list, int datum);
! extern bool list_member_oid(List *list, Oid datum);
  
  extern List *list_delete(List *list, void *datum);
  extern List *list_delete_ptr(List *list, void *datum);
--- 206,219 ----
  extern List *list_concat(List *list1, List *list2);
  extern List *list_truncate(List *list, int new_size);
  
! extern void *list_nth(const List *list, int n);
! extern int	list_nth_int(const List *list, int n);
! extern Oid	list_nth_oid(const List *list, int n);
  
! extern bool list_member(const List *list, const void *datum);
! extern bool list_member_ptr(const List *list, const void *datum);
! extern bool list_member_int(const List *list, int datum);
! extern bool list_member_oid(const List *list, Oid datum);
  
  extern List *list_delete(List *list, void *datum);
  extern List *list_delete_ptr(List *list, void *datum);
*************** extern List *list_delete_oid(List *list,
*** 222,240 ****
  extern List *list_delete_first(List *list);
  extern List *list_delete_cell(List *list, ListCell *cell, ListCell *prev);
  
! extern List *list_union(List *list1, List *list2);
! extern List *list_union_ptr(List *list1, List *list2);
! extern List *list_union_int(List *list1, List *list2);
! extern List *list_union_oid(List *list1, List *list2);
  
! extern List *list_intersection(List *list1, List *list2);
  
  /* currently, there's no need for list_intersection_int etc */
  
! extern List *list_difference(List *list1, List *list2);
! extern List *list_difference_ptr(List *list1, List *list2);
! extern List *list_difference_int(List *list1, List *list2);
! extern List *list_difference_oid(List *list1, List *list2);
  
  extern List *list_append_unique(List *list, void *datum);
  extern List *list_append_unique_ptr(List *list, void *datum);
--- 222,240 ----
  extern List *list_delete_first(List *list);
  extern List *list_delete_cell(List *list, ListCell *cell, ListCell *prev);
  
! extern List *list_union(const List *list1, const List *list2);
! extern List *list_union_ptr(const List *list1, const List *list2);
! extern List *list_union_int(const List *list1, const List *list2);
! extern List *list_union_oid(const List *list1, const List *list2);
  
! extern List *list_intersection(const List *list1, const List *list2);
  
  /* currently, there's no need for list_intersection_int etc */
  
! extern List *list_difference(const List *list1, const List *list2);
! extern List *list_difference_ptr(const List *list1, const List *list2);
! extern List *list_difference_int(const List *list1, const List *list2);
! extern List *list_difference_oid(const List *list1, const List *list2);
  
  extern List *list_append_unique(List *list, void *datum);
  extern List *list_append_unique_ptr(List *list, void *datum);
*************** extern List *list_concat_unique_oid(List
*** 249,256 ****
  extern void list_free(List *list);
  extern void list_free_deep(List *list);
  
! extern List *list_copy(List *list);
! extern List *list_copy_tail(List *list, int nskip);
  
  /*
   * To ease migration to the new list API, a set of compatibility
--- 249,256 ----
  extern void list_free(List *list);
  extern void list_free_deep(List *list);
  
! extern List *list_copy(const List *list);
! extern List *list_copy_tail(const List *list, int nskip);
  
  /*
   * To ease migration to the new list API, a set of compatibility
diff --git a/src/include/nodes/print.h b/src/include/nodes/print.h
new file mode 100644
index 8bac7b0..f4e0ff3
*** a/src/include/nodes/print.h
--- b/src/include/nodes/print.h
***************
*** 19,34 ****
  
  #define nodeDisplay(x)		pprint(x)
  
! extern void print(void *obj);
! extern void pprint(void *obj);
  extern void elog_node_display(int lev, const char *title,
! 				  void *obj, bool pretty);
  extern char *format_node_dump(const char *dump);
  extern char *pretty_format_node_dump(const char *dump);
! extern void print_rt(List *rtable);
! extern void print_expr(Node *expr, List *rtable);
! extern void print_pathkeys(List *pathkeys, List *rtable);
! extern void print_tl(List *tlist, List *rtable);
  extern void print_slot(TupleTableSlot *slot);
  
  #endif   /* PRINT_H */
--- 19,34 ----
  
  #define nodeDisplay(x)		pprint(x)
  
! extern void print(const void *obj);
! extern void pprint(const void *obj);
  extern void elog_node_display(int lev, const char *title,
! 				  const void *obj, bool pretty);
  extern char *format_node_dump(const char *dump);
  extern char *pretty_format_node_dump(const char *dump);
! extern void print_rt(const List *rtable);
! extern void print_expr(const Node *expr, const List *rtable);
! extern void print_pathkeys(const List *pathkeys, const List *rtable);
! extern void print_tl(const List *tlist, const List *rtable);
  extern void print_slot(TupleTableSlot *slot);
  
  #endif   /* PRINT_H */
diff --git a/src/include/optimizer/clauses.h b/src/include/optimizer/clauses.h
new file mode 100644
index 4cef7fa..7b8ee51
*** a/src/include/optimizer/clauses.h
--- b/src/include/optimizer/clauses.h
*************** typedef struct
*** 31,38 ****
  extern Expr *make_opclause(Oid opno, Oid opresulttype, bool opretset,
  			  Expr *leftop, Expr *rightop,
  			  Oid opcollid, Oid inputcollid);
! extern Node *get_leftop(Expr *clause);
! extern Node *get_rightop(Expr *clause);
  
  extern bool not_clause(Node *clause);
  extern Expr *make_notclause(Expr *notclause);
--- 31,38 ----
  extern Expr *make_opclause(Oid opno, Oid opresulttype, bool opretset,
  			  Expr *leftop, Expr *rightop,
  			  Oid opcollid, Oid inputcollid);
! extern Node *get_leftop(const Expr *clause);
! extern Node *get_rightop(const Expr *clause);
  
  extern bool not_clause(Node *clause);
  extern Expr *make_notclause(Expr *notclause);
#14Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Robert Haas (#12)
Re: const correctness

Robert Haas <robertmhaas@gmail.com> wrote:

So what happens when someone wants to use list_nth in one of the
outfuncs? Would we then rip all these back out?

If we just go this far and don't create a separate const flavor of
the one function and two macros, then we would at least need to rip
out the const keyword on the parameter of the affected function(s).

Or would we then bite the bullet and duplicate the code?

I'm not sure we shouldn't go that far right up front. The entire
body of the only duplicated function is:

return l ? l->head : NULL;

As cloned code goes, I've seen worse.

Of the two new macros, one has three lines of body, the other has
one line.

If people aren't inclined to support this on the grounds of API
clarity, maybe we should do some sort of benchmark run while we have
a patch which applies cleanly before writing off the possible
performance impact, but I'm not sure what makes a good stress-test
for the affected code.

-Kevin

#15Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kevin Grittner (#14)
Re: const correctness

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:

If people aren't inclined to support this on the grounds of API
clarity, maybe we should do some sort of benchmark run while we have
a patch which applies cleanly before writing off the possible
performance impact, but I'm not sure what makes a good stress-test
for the affected code.

I don't doubt that just duplicating macros and inlineable functions is
a wash performance-wise (in fact, in principle it shouldn't change
the generated code at all). My objection is the one Robert already
noted: it takes extra brain cells to remember which function/macro
to use, and I have seen not a shred of evidence that that extra
development/maintenance effort will be repaid.

I think that "const" works materially better in C++ where you can
overload foo(struct *) and foo(const struct *) and let the compiler sort
out which is being called. In C, the impedance match is a lot worse,
so you have to pick and choose where const is worth the trouble.

regards, tom lane

#16Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Tom Lane (#15)
Re: const correctness

Tom Lane <tgl@sss.pgh.pa.us> wrote:

I don't doubt that just duplicating macros and inlineable
functions is a wash performance-wise (in fact, in principle it
shouldn't change the generated code at all).

I had the impression that compilers these days could sometimes
better optimize across calls to functions with const parameters,
because previously-referenced elements of the structures could be
trusted to be unchanged across the call. I'm not talking about
calls to the inlineable function or macros themselves, but the
higher level functions which can then use const.

My objection is the one Robert already noted: it takes extra brain
cells to remember which function/macro to use, and I have seen not
a shred of evidence that that extra development/maintenance effort
will be repaid.

Well, for me at least, seeing a parameter flagged as const helps me
be sure that it will be use only for input to the function, and thus
more quickly grasp the semantics of the API. For someone who is
already familiar with an API, I doubt it helps much; and it may be
one of those cognitive differences that just exist between people.

As far as which to use when there is a const and a non-const version
-- how is that unclear? For me it seems intuitively obvious
(although perhaps my intuition is off-base) that I would use const
when I didn't want the called function to change what was pointed at
by the parameter. Maybe you're looking at the slippery slope more
than this one function and two macros, though.

In C, the impedance match is a lot worse, so you have to pick and
choose where const is worth the trouble.

Agreed. And I'm not sure how much of what Thomas is proposing is
worth it; it just seems prudent to consider it while the offer is
being made to do the work.

-Kevin

#17Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Kevin Grittner (#16)
Re: const correctness

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:

In C, the impedance match is a lot worse, so you have to pick and
choose where const is worth the trouble.

Agreed. And I'm not sure how much of what Thomas is proposing is
worth it; it just seems prudent to consider it while the offer is
being made to do the work.

If the gain is for human readers of the API rather than the compiler and
some level of automated checking, what about this trick:

#define constp

Then you can use it wherever you want to instruct readers that the
parameter is a constant, it's now a noise word as far as the compiler is
concerned (thanks to the precompiler replacing it with an empty string).

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

#18Florian Pflug
fgp@phlo.org
In reply to: Tom Lane (#15)
Re: const correctness

On Nov9, 2011, at 22:38 , Tom Lane wrote:

I think that "const" works materially better in C++ where you can
overload foo(struct *) and foo(const struct *) and let the compiler sort
out which is being called. In C, the impedance match is a lot worse,
so you have to pick and choose where const is worth the trouble.

Yup. In fact, C++ even *forces* you to use const in a few instances - you
aren't, for example, allowed to call non-const member functions on temporary
objects (i.e., myclass().nonconstmember() fails to compile where as
myclass().constmember() works as expected). Also, in C++ const influences
actual run-time behaviour - there's a very real difference in the life-time
of temporary objects depending on whether they're assigned to a const or
a non-const reference.

So, while C++ and C are similar in a lot of aspects, the situation regarding
const is very different.

best regards,
Florian Pflug

#19Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Thomas Munro (#13)
Re: const correctness

Thomas Munro <munro@ip9.org> wrote:

There is another option: if list_head is changed to take a pointer
to const List and return a pointer to non-const ListCell
(something I was trying to avoid before), then no XXX_const
functions/macros are necessary, and all of the functions from the
first patch can keep their 'const', adding const to 930 lines.

Now that you mention it, I think that's better anyway. Just because
you don't want the *called* function to change something doesn't
seem like it should imply anything about whether the *caller* should
be able to change something. Leave that to the caller unless the
function is quite sure that it is returning a pointer to something
which should be immutable in all cases.

I've attached a new patch, which simply adds the keyword 'const'
in lots of places, no new functions etc. This version generates
no warnings under -Wcast-qual (now that I've read Peter E's thread
and been inspired to fix up some places that previously cast away
const) for all code under backend/nodes. To achieve that I had to
stray outside backend/nodes and change get_leftop and get_rightop
(from clauses.h).

On this end it applies cleanly, compiles without warning, and passes
check-world regression tests.

-Kevin

#20Florian Pflug
fgp@phlo.org
In reply to: Kevin Grittner (#16)
Re: const correctness

On Nov9, 2011, at 22:54 , Kevin Grittner wrote:

Tom Lane <tgl@sss.pgh.pa.us> wrote:

I don't doubt that just duplicating macros and inlineable
functions is a wash performance-wise (in fact, in principle it
shouldn't change the generated code at all).

I had the impression that compilers these days could sometimes
better optimize across calls to functions with const parameters,
because previously-referenced elements of the structures could be
trusted to be unchanged across the call. I'm not talking about
calls to the inlineable function or macros themselves, but the
higher level functions which can then use const.

I don't think that's true. Const (for pointer types) generally only
means "you cannot modify the value through *this* pointer. But there
may very well be other pointers to the same object, and those may
very well be used to modify the value at any time.

So unless both the calling and the called function are in the same
compilation unit, the compiler needs to assume that any non-local
(and even local values whose address was taken previously) value
in the calling function may change as a result of the function call.
Or at least I think so.

If we're concerned about helping the compiler produce better code,
I think we should try to make our code safe under strict aliasing
rules. AFAIK, that generally helps much more than const-correctness.
(Dunno how feasible that is, though)

best regards,
Florian Pflug

#21Tom Lane
tgl@sss.pgh.pa.us
In reply to: Florian Pflug (#20)
Re: const correctness

Florian Pflug <fgp@phlo.org> writes:

If we're concerned about helping the compiler produce better code,
I think we should try to make our code safe under strict aliasing
rules. AFAIK, that generally helps much more than const-correctness.
(Dunno how feasible that is, though)

The last time we talked about that, we gave up and added
-fno-strict-aliasing, mainly because nobody trusted gcc to warn us about
violations of the aliasing rules. That was quite some time ago though.
Perhaps recent gcc versions do better?

regards, tom lane

#22Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kevin Grittner (#19)
Re: const correctness

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:

Thomas Munro <munro@ip9.org> wrote:

There is another option: if list_head is changed to take a pointer
to const List and return a pointer to non-const ListCell
(something I was trying to avoid before), then no XXX_const
functions/macros are necessary, and all of the functions from the
first patch can keep their 'const', adding const to 930 lines.

Now that you mention it, I think that's better anyway.

IOW, the strchr() trick? If the C standards committee couldn't find
any better answer than that, maybe we shouldn't expect to either.

In general I don't have an objection to adding "const" to individual
routines, so long as it doesn't create propagating requirements to
const-ify other code. This may be the only way to do it.

regards, tom lane

#23Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Tom Lane (#22)
Re: const correctness

Tom Lane <tgl@sss.pgh.pa.us> wrote:

In general I don't have an objection to adding "const" to
individual routines, so long as it doesn't create propagating
requirements to const-ify other code. This may be the only way to
do it.

As I understand it (although I'm no C expert), a "const" qualifier
on a function parameter declaration is a promise that the function
will not modify what is thus qualified. That means that it can't
pass a const parameter to another function as a parameter not also
declared const. It doesn't say anything about the object itself or
what is returned from the function.

So a non-const parameter in can be passed to a const parameter in a
call, but not vice versa. And a variable need not be declared const
to pass it to a function as a const parameter. I don't know if this
meets your conditions for non-propagation.

-Kevin

#24Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Florian Pflug (#20)
Re: const correctness

Florian Pflug <fgp@phlo.org> wrote:

On Nov9, 2011, at 22:54 , Kevin Grittner wrote:

Tom Lane <tgl@sss.pgh.pa.us> wrote:

I don't doubt that just duplicating macros and inlineable
functions is a wash performance-wise (in fact, in principle it
shouldn't change the generated code at all).

I had the impression that compilers these days could sometimes
better optimize across calls to functions with const parameters,
because previously-referenced elements of the structures could be
trusted to be unchanged across the call. I'm not talking about
calls to the inlineable function or macros themselves, but the
higher level functions which can then use const.

I don't think that's true. Const (for pointer types) generally
only means "you cannot modify the value through *this* pointer.
But there may very well be other pointers to the same object, and
those may very well be used to modify the value at any time.

So unless both the calling and the called function are in the same
compilation unit, the compiler needs to assume that any non-local
(and even local values whose address was taken previously) value
in the calling function may change as a result of the function
call. Or at least I think so.

You two seem to be right. I checked some generated code where I
would have expected it to help if it was ever going to, and the
generated code was absolutely identical. It appears that the *only*
real argument for this is to document the function's contract.
Whether the benefit of that outweighs any distraction it causes
seems to be the key argument to be had here.

If we're concerned about helping the compiler produce better code,
I think we should try to make our code safe under strict aliasing
rules. AFAIK, that generally helps much more than
const-correctness. (Dunno how feasible that is, though)

I hacked my configure file to use strict aliasing and -O3, and my
usual set of regression tests passed. (make check-world, make
installcheck-world against a cluster with
default_transaction_isolation = 'serializable' and
max_prepared_transactions = 10, and make -C src/test/isolation
installcheck against the same cluster)

I did get 10 warnings like this:

warning: dereferencing type-punned pointer will break
strict-aliasing rules

I haven't yet compared code or run benchmarks.

Since 9.2 seems to be shaping up mainly as a performance release,
now might be a good time to review these compile options to see how
far we can now safely push them.

-Kevin

#25Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#5)
Re: const correctness

On ons, 2011-11-09 at 10:49 -0500, Tom Lane wrote:

Now admittedly you can hack it, in the same
spirit as the C library functions that are declared to take const
pointers and return non-const pointers to the very same data

Which C library functions do that?

#26Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Peter Eisentraut (#25)
Re: const correctness

Peter Eisentraut <peter_e@gmx.net> wrote:

On ons, 2011-11-09 at 10:49 -0500, Tom Lane wrote:

Now admittedly you can hack it, in the same
spirit as the C library functions that are declared to take const
pointers and return non-const pointers to the very same data

Which C library functions do that?

Tom mentioned the strchr() function, which does do that. I don't
actually find that surprising given my understanding of the
semantics. That means that the function is promising not to modify
the character array, but is not asserting that it knows the
character array to be immutable. Makes sense to me. It's up to the
caller to assign it to a "const char *" if it knows it passed in an
immutable object.

-Kevin

#27Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#25)
Re: const correctness

Peter Eisentraut <peter_e@gmx.net> writes:

On ons, 2011-11-09 at 10:49 -0500, Tom Lane wrote:

Now admittedly you can hack it, in the same
spirit as the C library functions that are declared to take const
pointers and return non-const pointers to the very same data

Which C library functions do that?

strchr() is the classic example, but I believe there are some others.

regards, tom lane

#28Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kevin Grittner (#26)
Re: const correctness

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:

Tom mentioned the strchr() function, which does do that. I don't
actually find that surprising given my understanding of the
semantics. That means that the function is promising not to modify
the character array, but is not asserting that it knows the
character array to be immutable. Makes sense to me. It's up to the
caller to assign it to a "const char *" if it knows it passed in an
immutable object.

The problem with it of course is that mistaken use could have the
effect of casting-away-const, which is exactly what we hoped to prevent.
Still, there may not be a better solution.

regards, tom lane

#29Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Tom Lane (#28)
Re: const correctness

Tom Lane <tgl@sss.pgh.pa.us> wrote:

The problem with it of course is that mistaken use could have the
effect of casting-away-const, which is exactly what we hoped to
prevent. Still, there may not be a better solution.

Yeah, I've come to the conclusion that the compiler doesn't do the
apparently-available optimizations using const precisely because it
is so easy to cast away the property maliciously or accidentally.

-Kevin

#30Bruce Momjian
bruce@momjian.us
In reply to: Kevin Grittner (#29)
Re: const correctness

Kevin Grittner wrote:

Tom Lane <tgl@sss.pgh.pa.us> wrote:

The problem with it of course is that mistaken use could have the
effect of casting-away-const, which is exactly what we hoped to
prevent. Still, there may not be a better solution.

Yeah, I've come to the conclusion that the compiler doesn't do the
apparently-available optimizations using const precisely because it
is so easy to cast away the property maliciously or accidentally.

Right. The compiler would have to look at the function code, and all
functions called by that function, to determine if const was honored ---
not something that is easily done.

I agree that the strchr() approach is best. I realize the patch only
added 1-2 new const functions, but this is only a small area of the code
being patched --- a full solution would have many more complex
duplicates, and awkward changes as we add features.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

#31Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Bruce Momjian (#30)
Re: const correctness

Bruce Momjian <bruce@momjian.us> wrote:

I realize the patch only added 1-2 new const functions

No, version 2 of the patch used the strchr() technique and has
*zero* new functions and *zero* new macros.

but this is only a small area of the code being patched --- a full
solution would have many more complex duplicates, and awkward
changes as we add features.

I'm not convinced of that, and I don't think it really has a bearing
on doing where it can be done with no new functions and no changes
to the code other than adding "const" to existing lines of code.

-Kevin

#32Bruce Momjian
bruce@momjian.us
In reply to: Kevin Grittner (#31)
Re: const correctness

Kevin Grittner wrote:

Bruce Momjian <bruce@momjian.us> wrote:

I realize the patch only added 1-2 new const functions

No, version 2 of the patch used the strchr() technique and has
*zero* new functions and *zero* new macros.

Right. I was referring to the non-strchr() approach in the initial
patch.

but this is only a small area of the code being patched --- a full
solution would have many more complex duplicates, and awkward
changes as we add features.

I'm not convinced of that, and I don't think it really has a bearing
on doing where it can be done with no new functions and no changes
to the code other than adding "const" to existing lines of code.

Right, again I was referring to the non-strchr() approach, e.g. new
functions.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

#33Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Bruce Momjian (#32)
Re: const correctness

Bruce Momjian <bruce@momjian.us> wrote:

No, version 2 of the patch used the strchr() technique and has
*zero* new functions and *zero* new macros.

Right. I was referring to the non-strchr() approach in the
initial patch.

I'm sorry that I misunderstood you.

So, I don't think I've heard any argument against version 2 of this
patch. Does anyone oppose this version? Is any committer willing
to commit it? I'm not sure there's much point putting it into the
CF application, since in spot-checks of object files I thought were
most likely to be affected, I found that identical object code was
generated. It seems to be strictly a matter of whether the code is
more or less readily understood with the patch applied.

-Kevin

#34Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Florian Pflug (#20)
Re: strict aliasing (was: const correctness)

Florian Pflug <fgp@phlo.org> wrote:

If we're concerned about helping the compiler produce better code,
I think we should try to make our code safe under strict aliasing
rules. AFAIK, that generally helps much more than
const-correctness. (Dunno how feasible that is, though)

To get a preliminary feel for how much this might help, I set my
workstation with an i7-2600 and 16GB RAM to run Robert Haas's
pgbench concurrency tests against PostgreSQL built with (default)
-O2 and no strict aliasing versus -O3 and strict aliasing. I
ignored the ten warnings about punning under strict aliasing. Both
builds were with asserts disabled. No other changes from Friday's
HEAD. All runs were at the REPEATABLE READ isolation level. I
scheduled it for a window of time where the box wasn't running any
scheduled maintenance.

The results were interesting. While the small overlap between
samples from the two builds at most levels means that this was
somewhat unlikely to be just sampling noise, there could have been
alignment issues that account for some of the differences. In
short, the strict aliasing build always beat the other with 4
clients or fewer (on this 4 core machine), but always lost with more
than 4 clients.

1 client: +0.8%
2 clients: +2.0%
4 clients: +3.2%
8 clients: -0.9%
16 clients: -0.5%
32 clients: -0.9%

I wouldn't want to make too much out of this without repeating the
tests and trying different hardware, but I'm wondering whether the
abrupt difference at the number of cores makes sense to anybody.
Also, is there something I should do to deal with the warnings
before this would be considered a meaningful test?

Raw numbers:

no-strict-aliasing.1 tps = 7140.253910
no-strict-aliasing.1 tps = 7291.465297
no-strict-aliasing.1 tps = 7219.054359
no-strict-aliasing.2 tps = 16592.613779
no-strict-aliasing.2 tps = 15418.602945
no-strict-aliasing.2 tps = 16826.200551
no-strict-aliasing.4 tps = 48145.694444
no-strict-aliasing.4 tps = 47141.611960
no-strict-aliasing.4 tps = 47263.175254
no-strict-aliasing.8 tps = 93466.397174
no-strict-aliasing.8 tps = 93757.111493
no-strict-aliasing.8 tps = 93422.349453
no-strict-aliasing.16 tps = 88758.623319
no-strict-aliasing.16 tps = 88976.546555
no-strict-aliasing.16 tps = 88521.025343
no-strict-aliasing.32 tps = 87799.019143
no-strict-aliasing.32 tps = 88006.881881
no-strict-aliasing.32 tps = 88295.826711

strict-aliasing.1 tps = 7067.461710
strict-aliasing.1 tps = 7415.244823
strict-aliasing.1 tps = 7277.643321
strict-aliasing.2 tps = 14576.820162
strict-aliasing.2 tps = 16928.746994
strict-aliasing.2 tps = 19958.285834
strict-aliasing.4 tps = 48780.830247
strict-aliasing.4 tps = 49067.751657
strict-aliasing.4 tps = 48303.413578
strict-aliasing.8 tps = 93155.601896
strict-aliasing.8 tps = 92279.973490
strict-aliasing.8 tps = 92629.332125
strict-aliasing.16 tps = 88328.799197
strict-aliasing.16 tps = 88283.503270
strict-aliasing.16 tps = 88463.673815
strict-aliasing.32 tps = 87148.701204
strict-aliasing.32 tps = 87398.233624
strict-aliasing.32 tps = 87201.021722

-Kevin

#35Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kevin Grittner (#34)
Re: strict aliasing (was: const correctness)

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:

The results were interesting. While the small overlap between
samples from the two builds at most levels means that this was
somewhat unlikely to be just sampling noise, there could have been
alignment issues that account for some of the differences. In
short, the strict aliasing build always beat the other with 4
clients or fewer (on this 4 core machine), but always lost with more
than 4 clients.

That is *weird*.

Also, is there something I should do to deal with the warnings
before this would be considered a meaningful test?

Dunno ... where were the warnings exactly? Also, did you run the
regression tests (particularly the parallel version) against the
build?

regards, tom lane

#36Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Tom Lane (#35)
Re: strict aliasing (was: const correctness)

Tom Lane <tgl@sss.pgh.pa.us> wrote:

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:

The results were interesting. While the small overlap between
samples from the two builds at most levels means that this was
somewhat unlikely to be just sampling noise, there could have
been alignment issues that account for some of the differences.
In short, the strict aliasing build always beat the other with 4
clients or fewer (on this 4 core machine), but always lost with
more than 4 clients.

That is *weird*.

Yeah, my only theories are that it was an unlucky set of samples
(which seems a little thin looking at the numbers) or that some of
the optimizations in -O3 are about improving pipelining at what
would otherwise be an increase in cycles, but that context switching
breaks up the pipelining enough that it's a net loss at high
concurrency. That doesn't seem quite as thin as the other
explanation, but it's not very satisfying without some sort of
confirmation.

Also, is there something I should do to deal with the warnings
before this would be considered a meaningful test?

Dunno ... where were the warnings exactly?

All 10 were like this:

warning: dereferencing type-punned pointer will break
strict-aliasing rules

The warning is about reading a union using a different type than was
last stored there. It seems like that might sometimes be legitimate
reasons to do that, and that if it was broken with strict aliasing
it might be broken without. But strict aliasing is new territory
for me.

Also, did you run the regression tests (particularly the parallel
version) against the build?

Yes. The normal parallel `make check-world`, the `make
installcheck-world` against an install with
default_transaction_isolation = 'serializable' and
max_prepared_transactions = 10, and `make -C src/test/isolation
installcheck`. All ran without problem.

I'm inclined to try -O3 and -strict-aliasing separately, with a more
iterations; but I want to fix anything that's wrong with the
aliasing first.

-Kevin

#37Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Tom Lane (#35)
Re: strict aliasing (was: const correctness)

Tom Lane <tgl@sss.pgh.pa.us> wrote:

Dunno ... where were the warnings exactly?

Ah, you asked "where", not "what". I don't think I saved that, and
I had to reboot for a new kernel, so I don't have the buffer sitting
around. I'll do a new build and let you know shortly.

-Kevin

#38Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Kevin Grittner (#36)
Re: strict aliasing (was: const correctness)

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> wrote:

Tom Lane <tgl@sss.pgh.pa.us> wrote:

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:

Also, is there something I should do to deal with the warnings
before this would be considered a meaningful test?

Dunno ... where were the warnings exactly?

All 10 were like this:

warning: dereferencing type-punned pointer will break
strict-aliasing rules

From HEAD checkout of a few minutes ago I now see only 9:

parse_type.c: In function *typenameTypeMod*:
parse_type.c:313:4
parse_type.c:318:4
parse_type.c:319:7

guc.c: In function *flatten_set_variable_args*:
guc.c:6036:3
guc.c:6087:7

plpython.c: In function *PLy_plan_status*:
plpython.c:3213:3

btree_utils_var.c: In function *gbt_var_node_truncate*:
btree_utils_var.c:213:2

trgm_gist.c: In function *gtrgm_consistent*:
trgm_gist.c:262:5
trgm_gist.c:262:5

-Kevin

#39Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kevin Grittner (#38)
Re: strict aliasing (was: const correctness)

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:

Tom Lane <tgl@sss.pgh.pa.us> wrote:

Dunno ... where were the warnings exactly?

From HEAD checkout of a few minutes ago I now see only 9:

Hmm ... well, none of those look likely to be in performance-sensitive
areas. But I wonder just how good the trouble-detection code is these
days.

regards, tom lane

#40Alvaro Herrera
alvherre@commandprompt.com
In reply to: Kevin Grittner (#36)
Re: strict aliasing (was: const correctness)

Excerpts from Kevin Grittner's message of lun nov 14 17:30:50 -0300 2011:

Tom Lane <tgl@sss.pgh.pa.us> wrote:

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:

Also, is there something I should do to deal with the warnings
before this would be considered a meaningful test?

Dunno ... where were the warnings exactly?

All 10 were like this:

warning: dereferencing type-punned pointer will break
strict-aliasing rules

Uhm, shouldn't we expect there to be one warning for each use of a Node
using some specific node pointer type as well as something generic such
as inside a ListCell etc?

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#41Martijn van Oosterhout
kleptog@svana.org
In reply to: Alvaro Herrera (#40)
Re: strict aliasing (was: const correctness)

On Mon, Nov 14, 2011 at 06:25:19PM -0300, Alvaro Herrera wrote:

All 10 were like this:

warning: dereferencing type-punned pointer will break
strict-aliasing rules

Uhm, shouldn't we expect there to be one warning for each use of a Node
using some specific node pointer type as well as something generic such
as inside a ListCell etc?

Maybe they're safe? But in any case given the use of Node, a may be an
idea to mark it with attribute((__may_alias__)), that should clear up
most of the problems in that area.

http://ohse.de/uwe/articles/gcc-attributes.html#type-may_alias

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

He who writes carelessly confesses thereby at the very outset that he does
not attach much importance to his own thoughts.

-- Arthur Schopenhauer

#42Andres Freund
andres@anarazel.de
In reply to: Alvaro Herrera (#40)
Re: strict aliasing (was: const correctness)

On Monday, November 14, 2011 10:25:19 PM Alvaro Herrera wrote:

Excerpts from Kevin Grittner's message of lun nov 14 17:30:50 -0300 2011:

Tom Lane <tgl@sss.pgh.pa.us> wrote:

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:

Also, is there something I should do to deal with the warnings
before this would be considered a meaningful test?

Dunno ... where were the warnings exactly?

All 10 were like this:
warning: dereferencing type-punned pointer will break

strict-aliasing rules

Uhm, shouldn't we expect there to be one warning for each use of a Node
using some specific node pointer type as well as something generic such
as inside a ListCell etc?

The case with Node's being accessed by SomethingNode is legal to my knowledge
as the individual memory locations are accessed by variables of the same type.
That follows from the rules "an aggregate or union type that includes one of
the aforementioned types among its members (including, recursively, a member
of a subaggregate or contained union)" and "a type compatible with the
effective type of the object".

And the ListCell case is ok as well unless there is a wrong cast in code using
the ListCell somewhere.

E.g. its afaics safe to do something like:

void do_something_int(int);

int bla;
void* foo = &bla;
...
do_something_int(*(int*)foo);

but

do_something_short(*(short*)foo);
is illegal.

The compiler obviously cant be able to prove all misusage of the void*
pointers in e.g. ListCell's though...

Andres

#43Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#39)
Re: strict aliasing (was: const correctness)

On Monday, November 14, 2011 10:22:52 PM Tom Lane wrote:

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:

Tom Lane <tgl@sss.pgh.pa.us> wrote:

Dunno ... where were the warnings exactly?

From HEAD checkout of a few minutes ago I now see only 9:

Hmm ... well, none of those look likely to be in performance-sensitive
areas. But I wonder just how good the trouble-detection code is these
days.

No idea about how good it is but you can make the detection code more
aggressive by -Wstrict-aliasing=1 (which will produce more false positives).

I don't gcc will ever be able to call all possible misusages. E.g. The List
api is a case where its basically impossible to catch everything (as gcc won't
be able to figure out what the ListCell.data.ptr_value pointed to originally
in the general case).

Andres

#44Florian Weimer
fweimer@bfk.de
In reply to: Andres Freund (#43)
Re: strict aliasing

* Andres Freund:

I don't gcc will ever be able to call all possible misusages. E.g. The
List api is a case where its basically impossible to catch everything
(as gcc won't be able to figure out what the ListCell.data.ptr_value
pointed to originally in the general case).

Correct, if code is not strict-aliasing-safe and you compile with
-f-strict-aliasing, GCC may silently produce wrong code. (Same with
-fwrapv, by the way.)

--
Florian Weimer <fweimer@bfk.de>
BFK edv-consulting GmbH http://www.bfk.de/
Kriegsstraße 100 tel: +49-721-96201-1
D-76133 Karlsruhe fax: +49-721-96201-99

#45Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Florian Weimer (#44)
Re: strict aliasing

Florian Weimer <fweimer@bfk.de> wrote:

* Andres Freund:

I don't gcc will ever be able to call all possible misusages.
E.g. The List api is a case where its basically impossible to
catch everything (as gcc won't be able to figure out what the
ListCell.data.ptr_value pointed to originally in the general
case).

Correct, if code is not strict-aliasing-safe and you compile with
-f-strict-aliasing, GCC may silently produce wrong code. (Same
with -fwrapv, by the way.)

I've spent a little time trying to get my head around what to look
for in terms of unsafe code, but am not really there yet. Meanwhile,
I've run a few more benchmarks of -fstrict-aliasing (without also
changing to the -O3 switch) compared to a normal build. In no
benchmark so far has strict aliasing by itself performed better on
my i7, and in most cases it is slightly worse. (This means that
some of the optimizations in -O3 probably *did* have a small net
positive, since the benchmarks combining both showed a gain as long
as there weren't more clients than cores, and the net loss on just
strict aliasing would account for the decrease at higher client
counts.)

From my reading, it appears that if we get safe code in terms of

strict aliasing, we might be able to use the "restrict" keyword to
get further optimizations which bring it to a net win, but I think
there is currently lower-hanging fruit than monkeying with these
compiler options. I'm letting this go, although I still favor the
const-ifying which started this discussion, on the grounds of API
clarity.

-Kevin

#46Ants Aasma
ants.aasma@eesti.ee
In reply to: Kevin Grittner (#45)
Re: strict aliasing

On Tue, Nov 15, 2011 at 9:02 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:

From my reading, it appears that if we get safe code in terms of
strict aliasing, we might be able to use the "restrict" keyword to
get further optimizations which bring it to a net win, but I think
there is currently lower-hanging fruit than monkeying with these
compiler options.  I'm letting this go, although I still favor the
const-ifying which started this discussion, on the grounds of API
clarity.

Speaking of lower-hanging fruit...

I ran a series of tests to see how different optimization flags
affect performance. I was particularly interested in what effect
link time optimization has. The results are somewhat interesting.

Benchmark machine is my laptop, Intel Core i5 M 540 @ 2.53GHz.
2 cores + hyperthreading for a total of 4 threads. Ubuntu 11.10.
Compiled with GCC 4.6.1-9ubuntu3.

I ran pgbench read only test with scale factor 10, default
options except for shared_buffers = 256MB. The dataset fits fully
in shared buffers.

I tried following configurations:
default: plain old ./configure; make; make install
-O3: what it says on the label
lto: CFLAGS="-O3 -flto" This should do some global optimizations
at link time.
PGO: compiled with CFLAGS="-O3 -fprofile-generate", then ran
pgbench -T 30 on a scalefactor 100 database (IO bound rw load
to mix the profile up a bit). Then did
# sed -i s/-fprofile-generate/-fprofile-use/ src/Makefile.global
and recompiled and installed.
lto + PGO: same as previous, but with added -flto.

Median tps of 3 5 minute runs at different concurrency levels:

-c default -O3 lto PGO lto + PGO
==================================================
1 6753.40 6689.76 6498.37 6614.73 5918.65
2 11600.87 11659.33 12074.63 12957.81 13353.54
4 18852.86 18918.32 19008.89 20006.49 20652.93
8 15232.30 15762.70 14568.06 15880.19 16091.24
16 15693.93 15625.87 16563.91 17088.28 18223.02

Percentage increase from default flags:

-c default -O3 lto PGO lto + PGO
==================================================
1 6753.40 -0.94% -3.78% -2.05% -12.36%
2 11600.87 0.50% 4.08% 11.70% 15.11%
4 18852.86 0.35% 0.83% 6.12% 9.55%
8 15232.30 3.48% -4.36% 4.25% 5.64%
16 15693.93 -0.43% 5.54% 8.88% 16.12%

Concurrency 8 results should probably be ignored - variance was huge,
definitely more than the differences. For other results, variance was
~1%.

I don't know what to make of the single client results, why they seem
to be going in the opposite direction of all other results. Other than
that both profile guided optimization and link time optimization give
a pretty respectable boost. If anyone can suggest some more diverse
workloads to test, I could try to see if the PGO results persist when
profiling and benchmark loads differ more. These results suggest that
giving the compiler information about hot and cold paths results in a
significant improvement in generated code quality.

--
Ants Aasma

#47Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Ants Aasma (#46)
Re: strict aliasing

Ants Aasma <ants.aasma@eesti.ee> wrote:

Concurrency 8 results should probably be ignored - variance was
huge, definitely more than the differences.

I'm not so sure it should be ignored -- one thing I noticed in
looking at the raw numbers from my benchmarks was that the -O2 code
was much more consistent from run to run than the -O3 code. I doubt
that the more aggressive optimizations were developed under NUMA
architecture, and I suspect that the aggressively optimized code may
be more sensitive to whether memory is directly accessed by the core
running the process or routed though the memory controller on
another core. (I hit on this idea this morning when I remembered
seeing similar variations in run times of STREAM against our new
servers with NUMA.)

This suggests that in the long term, it might be worth investigating
whether we can arrange for a connection's process to have some
degree of core affinity and encourage each process to allocate local
memory from RAM controlled by that core. To some extent I would
expect the process-based architecture of PostgreSQL to help with
that, as you would expect a NUMA-aware OS to try to arrange that to
some degree.

-Kevin

#48Robert Haas
robertmhaas@gmail.com
In reply to: Kevin Grittner (#47)
Re: strict aliasing

On Wed, Nov 16, 2011 at 9:47 AM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:

This suggests that in the long term, it might be worth investigating
whether we can arrange for a connection's process to have some
degree of core affinity and encourage each process to allocate local
memory from RAM controlled by that core.  To some extent I would
expect the process-based architecture of PostgreSQL to help with
that, as you would expect a NUMA-aware OS to try to arrange that to
some degree.

I've done some testing on HP/UX-Itanium and have not been able to
demonstrate any significant performance benefit from overriding the
operating system's default policies regarding processor affinity. For
example, I hacked the code to request that the shared memory be
allocated as cell-local memory, then used mpsched with the FILL_TREE
policy to bind everything to a single cell, and sure enough it all ran
in that cell, but it wasn't any better than 4 clients running on
different cells with the shared memory segment allocated interleaved.
This result didn't really make much sense to me, because it seemed
like it SHOULD have helped. So it's possible I did something wrong.
But if so, I couldn't find it. The other possibility is that the OS
is smart enough about moving things around to get good locality that
sticking locality hints on top doesn't really make any difference.
Certainly, I would expect any OS to be smart enough to allocate
backend-local memory on the same processor where the task is running,
and to avoid moving processes between cells more than necessary.

Regarding results instability, on some patch sets I've tried, I've
seen very unstable performance. I've also noticed that a very short
run sometimes gives much higher performance than a longer run. My
working theory is that this is the result of spinlock contention.
Suppose you have a spinlock that is getting passed around very quickly
between, say, 32 processes. Since the data protected by the spinlock
is on the same cache line as the lock, what ideally happens is that
the process gets the lock and then finishes its work and releases the
lock before anyone else tries to pull the cache line away. And at the
beginning of the run, that's what does actually happen. But then for
some reason a process gets context-switched out while it holds the
lock, or maybe it's just that somebody gets unlucky enough to have the
cache line stolen before they can dump the spinlock and can't quite
get it back fast enough. Now people start to pile up trying to get
that spinlock, and that means trouble, because now it's much harder
for any given process to get the cache line and finish its work before
the cache line gets stolen away. So my theory is that now the
performance goes down more or less "permanently", unless or until
there's some momentary break in the action that lets the queue of
people waiting for that spinlock drain out. This is just a wild-ass
guess, and I might be totally wrong...

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#49Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Robert Haas (#48)
Re: strict aliasing

Robert Haas <robertmhaas@gmail.com> wrote:

Kevin Grittner <Kevin.Grittner@wicourts.gov> wrote:

This suggests that in the long term, it might be worth [...]

The other possibility is that the OS is smart enough about moving
things around to get good locality that sticking locality hints on
top doesn't really make any difference. Certainly, I would expect
any OS to be smart enough to allocate backend-local memory on the
same processor where the task is running, and to avoid moving
processes between cells more than necessary.

Right. I'm not sure that it will make any more sense to do this
than to do raw access to a disk partition. I don't think it's a
given that we can do a better job of this than the OS does.

Regarding results instability [...] My working theory is that this
is the result of spinlock contention.

So my theory is that now the performance goes down more or less
"permanently", unless or until there's some momentary break in the
action that lets the queue of people waiting for that spinlock
drain out. This is just a wild-ass guess, and I might be totally
wrong...

Well, I suspect that you're basing that guess on enough evidence
that it's more likely to be right than the wild-assed guesses I've
been throwing out there. :-) I can't say it's inconsistent with
anything I've seen.

-Kevin

#50Peter Eisentraut
peter_e@gmx.net
In reply to: Thomas Munro (#13)
Re: const correctness

On ons, 2011-11-09 at 21:15 +0000, Thomas Munro wrote:

I've attached a new patch, which simply adds the keyword 'const' in
lots of places, no new functions etc. This version generates no
warnings under -Wcast-qual (now that I've read Peter E's thread and
been inspired to fix up some places that previously cast away const)
for all code under backend/nodes. To achieve that I had to stray
outside backend/nodes and change get_leftop and get_rightop (from
clauses.h).

Patch committed.