Coverage Report

Created: 2026-09-28 06:55

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/postgres/bld/src/backend/nodes/copyfuncs.funcs.c
Line
Count
Source
1
/*-------------------------------------------------------------------------
2
 *
3
 * copyfuncs.funcs.c
4
 *    Generated node infrastructure code
5
 *
6
 * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
7
 * Portions Copyright (c) 1994, Regents of the University of California
8
 *
9
 * NOTES
10
 *  ******************************
11
 *  *** DO NOT EDIT THIS FILE! ***
12
 *  ******************************
13
 *
14
 *  It has been GENERATED by src/backend/nodes/gen_node_support.pl
15
 *
16
 *-------------------------------------------------------------------------
17
 */
18
#include "access/amapi.h"
19
#include "access/cmptype.h"
20
#include "access/sdir.h"
21
#include "access/tableam.h"
22
#include "access/tsmapi.h"
23
#include "commands/event_trigger.h"
24
#include "commands/trigger.h"
25
#include "executor/tuptable.h"
26
#include "foreign/fdwapi.h"
27
#include "nodes/bitmapset.h"
28
#include "nodes/execnodes.h"
29
#include "nodes/extensible.h"
30
#include "nodes/lockoptions.h"
31
#include "nodes/miscnodes.h"
32
#include "nodes/nodes.h"
33
#include "nodes/parsenodes.h"
34
#include "nodes/pathnodes.h"
35
#include "nodes/plannodes.h"
36
#include "nodes/primnodes.h"
37
#include "nodes/replnodes.h"
38
#include "nodes/supportnodes.h"
39
#include "nodes/value.h"
40
#include "utils/rel.h"
41
42
static Alias *
43
_copyAlias(const Alias *from)
44
0
{
45
0
  Alias *newnode = makeNode(Alias);
46
47
0
  COPY_STRING_FIELD(aliasname);
48
0
  COPY_NODE_FIELD(colnames);
49
50
0
  return newnode;
51
0
}
52
53
static RangeVar *
54
_copyRangeVar(const RangeVar *from)
55
0
{
56
0
  RangeVar *newnode = makeNode(RangeVar);
57
58
0
  COPY_STRING_FIELD(catalogname);
59
0
  COPY_STRING_FIELD(schemaname);
60
0
  COPY_STRING_FIELD(relname);
61
0
  COPY_SCALAR_FIELD(inh);
62
0
  COPY_SCALAR_FIELD(relpersistence);
63
0
  COPY_NODE_FIELD(alias);
64
0
  COPY_LOCATION_FIELD(location);
65
66
0
  return newnode;
67
0
}
68
69
static TableFunc *
70
_copyTableFunc(const TableFunc *from)
71
0
{
72
0
  TableFunc *newnode = makeNode(TableFunc);
73
74
0
  COPY_SCALAR_FIELD(functype);
75
0
  COPY_NODE_FIELD(ns_uris);
76
0
  COPY_NODE_FIELD(ns_names);
77
0
  COPY_NODE_FIELD(docexpr);
78
0
  COPY_NODE_FIELD(rowexpr);
79
0
  COPY_NODE_FIELD(colnames);
80
0
  COPY_NODE_FIELD(coltypes);
81
0
  COPY_NODE_FIELD(coltypmods);
82
0
  COPY_NODE_FIELD(colcollations);
83
0
  COPY_NODE_FIELD(colexprs);
84
0
  COPY_NODE_FIELD(coldefexprs);
85
0
  COPY_NODE_FIELD(colvalexprs);
86
0
  COPY_NODE_FIELD(passingvalexprs);
87
0
  COPY_BITMAPSET_FIELD(notnulls);
88
0
  COPY_NODE_FIELD(plan);
89
0
  COPY_SCALAR_FIELD(ordinalitycol);
90
0
  COPY_LOCATION_FIELD(location);
91
92
0
  return newnode;
93
0
}
94
95
static IntoClause *
96
_copyIntoClause(const IntoClause *from)
97
0
{
98
0
  IntoClause *newnode = makeNode(IntoClause);
99
100
0
  COPY_NODE_FIELD(rel);
101
0
  COPY_NODE_FIELD(colNames);
102
0
  COPY_STRING_FIELD(accessMethod);
103
0
  COPY_NODE_FIELD(options);
104
0
  COPY_SCALAR_FIELD(onCommit);
105
0
  COPY_STRING_FIELD(tableSpaceName);
106
0
  COPY_NODE_FIELD(viewQuery);
107
0
  COPY_SCALAR_FIELD(skipData);
108
109
0
  return newnode;
110
0
}
111
112
static Var *
113
_copyVar(const Var *from)
114
0
{
115
0
  Var *newnode = makeNode(Var);
116
117
0
  COPY_SCALAR_FIELD(varno);
118
0
  COPY_SCALAR_FIELD(varattno);
119
0
  COPY_SCALAR_FIELD(vartype);
120
0
  COPY_SCALAR_FIELD(vartypmod);
121
0
  COPY_SCALAR_FIELD(varcollid);
122
0
  COPY_BITMAPSET_FIELD(varnullingrels);
123
0
  COPY_SCALAR_FIELD(varlevelsup);
124
0
  COPY_SCALAR_FIELD(varreturningtype);
125
0
  COPY_SCALAR_FIELD(varnosyn);
126
0
  COPY_SCALAR_FIELD(varattnosyn);
127
0
  COPY_LOCATION_FIELD(location);
128
129
0
  return newnode;
130
0
}
131
132
static Param *
133
_copyParam(const Param *from)
134
0
{
135
0
  Param *newnode = makeNode(Param);
136
137
0
  COPY_SCALAR_FIELD(paramkind);
138
0
  COPY_SCALAR_FIELD(paramid);
139
0
  COPY_SCALAR_FIELD(paramtype);
140
0
  COPY_SCALAR_FIELD(paramtypmod);
141
0
  COPY_SCALAR_FIELD(paramcollid);
142
0
  COPY_LOCATION_FIELD(location);
143
144
0
  return newnode;
145
0
}
146
147
static Aggref *
148
_copyAggref(const Aggref *from)
149
0
{
150
0
  Aggref *newnode = makeNode(Aggref);
151
152
0
  COPY_SCALAR_FIELD(aggfnoid);
153
0
  COPY_SCALAR_FIELD(aggtype);
154
0
  COPY_SCALAR_FIELD(aggcollid);
155
0
  COPY_SCALAR_FIELD(inputcollid);
156
0
  COPY_SCALAR_FIELD(aggtranstype);
157
0
  COPY_NODE_FIELD(aggargtypes);
158
0
  COPY_NODE_FIELD(aggdirectargs);
159
0
  COPY_NODE_FIELD(args);
160
0
  COPY_NODE_FIELD(aggorder);
161
0
  COPY_NODE_FIELD(aggdistinct);
162
0
  COPY_NODE_FIELD(aggfilter);
163
0
  COPY_SCALAR_FIELD(aggstar);
164
0
  COPY_SCALAR_FIELD(aggvariadic);
165
0
  COPY_SCALAR_FIELD(aggkind);
166
0
  COPY_SCALAR_FIELD(aggpresorted);
167
0
  COPY_SCALAR_FIELD(agglevelsup);
168
0
  COPY_SCALAR_FIELD(aggsplit);
169
0
  COPY_SCALAR_FIELD(aggno);
170
0
  COPY_SCALAR_FIELD(aggtransno);
171
0
  COPY_LOCATION_FIELD(location);
172
173
0
  return newnode;
174
0
}
175
176
static GroupingFunc *
177
_copyGroupingFunc(const GroupingFunc *from)
178
0
{
179
0
  GroupingFunc *newnode = makeNode(GroupingFunc);
180
181
0
  COPY_NODE_FIELD(args);
182
0
  COPY_NODE_FIELD(refs);
183
0
  COPY_NODE_FIELD(cols);
184
0
  COPY_SCALAR_FIELD(agglevelsup);
185
0
  COPY_LOCATION_FIELD(location);
186
187
0
  return newnode;
188
0
}
189
190
static WindowFunc *
191
_copyWindowFunc(const WindowFunc *from)
192
0
{
193
0
  WindowFunc *newnode = makeNode(WindowFunc);
194
195
0
  COPY_SCALAR_FIELD(winfnoid);
196
0
  COPY_SCALAR_FIELD(wintype);
197
0
  COPY_SCALAR_FIELD(wincollid);
198
0
  COPY_SCALAR_FIELD(inputcollid);
199
0
  COPY_NODE_FIELD(args);
200
0
  COPY_NODE_FIELD(aggfilter);
201
0
  COPY_NODE_FIELD(runCondition);
202
0
  COPY_SCALAR_FIELD(winref);
203
0
  COPY_SCALAR_FIELD(winstar);
204
0
  COPY_SCALAR_FIELD(winagg);
205
0
  COPY_SCALAR_FIELD(ignore_nulls);
206
0
  COPY_LOCATION_FIELD(location);
207
208
0
  return newnode;
209
0
}
210
211
static WindowFuncRunCondition *
212
_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
213
0
{
214
0
  WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
215
216
0
  COPY_SCALAR_FIELD(opno);
217
0
  COPY_SCALAR_FIELD(inputcollid);
218
0
  COPY_SCALAR_FIELD(wfunc_left);
219
0
  COPY_NODE_FIELD(arg);
220
221
0
  return newnode;
222
0
}
223
224
static MergeSupportFunc *
225
_copyMergeSupportFunc(const MergeSupportFunc *from)
226
0
{
227
0
  MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
228
229
0
  COPY_SCALAR_FIELD(msftype);
230
0
  COPY_SCALAR_FIELD(msfcollid);
231
0
  COPY_LOCATION_FIELD(location);
232
233
0
  return newnode;
234
0
}
235
236
static SubscriptingRef *
237
_copySubscriptingRef(const SubscriptingRef *from)
238
0
{
239
0
  SubscriptingRef *newnode = makeNode(SubscriptingRef);
240
241
0
  COPY_SCALAR_FIELD(refcontainertype);
242
0
  COPY_SCALAR_FIELD(refelemtype);
243
0
  COPY_SCALAR_FIELD(refrestype);
244
0
  COPY_SCALAR_FIELD(reftypmod);
245
0
  COPY_SCALAR_FIELD(refcollid);
246
0
  COPY_NODE_FIELD(refupperindexpr);
247
0
  COPY_NODE_FIELD(reflowerindexpr);
248
0
  COPY_NODE_FIELD(refexpr);
249
0
  COPY_NODE_FIELD(refassgnexpr);
250
251
0
  return newnode;
252
0
}
253
254
static FuncExpr *
255
_copyFuncExpr(const FuncExpr *from)
256
0
{
257
0
  FuncExpr *newnode = makeNode(FuncExpr);
258
259
0
  COPY_SCALAR_FIELD(funcid);
260
0
  COPY_SCALAR_FIELD(funcresulttype);
261
0
  COPY_SCALAR_FIELD(funcretset);
262
0
  COPY_SCALAR_FIELD(funcvariadic);
263
0
  COPY_SCALAR_FIELD(funcformat);
264
0
  COPY_SCALAR_FIELD(funccollid);
265
0
  COPY_SCALAR_FIELD(inputcollid);
266
0
  COPY_NODE_FIELD(args);
267
0
  COPY_LOCATION_FIELD(location);
268
269
0
  return newnode;
270
0
}
271
272
static NamedArgExpr *
273
_copyNamedArgExpr(const NamedArgExpr *from)
274
0
{
275
0
  NamedArgExpr *newnode = makeNode(NamedArgExpr);
276
277
0
  COPY_NODE_FIELD(arg);
278
0
  COPY_STRING_FIELD(name);
279
0
  COPY_SCALAR_FIELD(argnumber);
280
0
  COPY_LOCATION_FIELD(location);
281
282
0
  return newnode;
283
0
}
284
285
static OpExpr *
286
_copyOpExpr(const OpExpr *from)
287
0
{
288
0
  OpExpr *newnode = makeNode(OpExpr);
289
290
0
  COPY_SCALAR_FIELD(opno);
291
0
  COPY_SCALAR_FIELD(opfuncid);
292
0
  COPY_SCALAR_FIELD(opresulttype);
293
0
  COPY_SCALAR_FIELD(opretset);
294
0
  COPY_SCALAR_FIELD(opcollid);
295
0
  COPY_SCALAR_FIELD(inputcollid);
296
0
  COPY_NODE_FIELD(args);
297
0
  COPY_LOCATION_FIELD(location);
298
299
0
  return newnode;
300
0
}
301
302
static DistinctExpr *
303
_copyDistinctExpr(const DistinctExpr *from)
304
0
{
305
0
  DistinctExpr *newnode = makeNode(DistinctExpr);
306
307
0
  COPY_SCALAR_FIELD(opno);
308
0
  COPY_SCALAR_FIELD(opfuncid);
309
0
  COPY_SCALAR_FIELD(opresulttype);
310
0
  COPY_SCALAR_FIELD(opretset);
311
0
  COPY_SCALAR_FIELD(opcollid);
312
0
  COPY_SCALAR_FIELD(inputcollid);
313
0
  COPY_NODE_FIELD(args);
314
0
  COPY_LOCATION_FIELD(location);
315
316
0
  return newnode;
317
0
}
318
319
static NullIfExpr *
320
_copyNullIfExpr(const NullIfExpr *from)
321
0
{
322
0
  NullIfExpr *newnode = makeNode(NullIfExpr);
323
324
0
  COPY_SCALAR_FIELD(opno);
325
0
  COPY_SCALAR_FIELD(opfuncid);
326
0
  COPY_SCALAR_FIELD(opresulttype);
327
0
  COPY_SCALAR_FIELD(opretset);
328
0
  COPY_SCALAR_FIELD(opcollid);
329
0
  COPY_SCALAR_FIELD(inputcollid);
330
0
  COPY_NODE_FIELD(args);
331
0
  COPY_LOCATION_FIELD(location);
332
333
0
  return newnode;
334
0
}
335
336
static ScalarArrayOpExpr *
337
_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
338
0
{
339
0
  ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
340
341
0
  COPY_SCALAR_FIELD(opno);
342
0
  COPY_SCALAR_FIELD(opfuncid);
343
0
  COPY_SCALAR_FIELD(hashfuncid);
344
0
  COPY_SCALAR_FIELD(negfuncid);
345
0
  COPY_SCALAR_FIELD(useOr);
346
0
  COPY_SCALAR_FIELD(inputcollid);
347
0
  COPY_NODE_FIELD(args);
348
0
  COPY_LOCATION_FIELD(location);
349
350
0
  return newnode;
351
0
}
352
353
static BoolExpr *
354
_copyBoolExpr(const BoolExpr *from)
355
0
{
356
0
  BoolExpr *newnode = makeNode(BoolExpr);
357
358
0
  COPY_SCALAR_FIELD(boolop);
359
0
  COPY_NODE_FIELD(args);
360
0
  COPY_LOCATION_FIELD(location);
361
362
0
  return newnode;
363
0
}
364
365
static SubLink *
366
_copySubLink(const SubLink *from)
367
0
{
368
0
  SubLink *newnode = makeNode(SubLink);
369
370
0
  COPY_SCALAR_FIELD(subLinkType);
371
0
  COPY_SCALAR_FIELD(subLinkId);
372
0
  COPY_NODE_FIELD(testexpr);
373
0
  COPY_NODE_FIELD(operName);
374
0
  COPY_NODE_FIELD(subselect);
375
0
  COPY_LOCATION_FIELD(location);
376
377
0
  return newnode;
378
0
}
379
380
static SubPlan *
381
_copySubPlan(const SubPlan *from)
382
0
{
383
0
  SubPlan *newnode = makeNode(SubPlan);
384
385
0
  COPY_SCALAR_FIELD(subLinkType);
386
0
  COPY_NODE_FIELD(testexpr);
387
0
  COPY_NODE_FIELD(paramIds);
388
0
  COPY_SCALAR_FIELD(plan_id);
389
0
  COPY_STRING_FIELD(plan_name);
390
0
  COPY_SCALAR_FIELD(firstColType);
391
0
  COPY_SCALAR_FIELD(firstColTypmod);
392
0
  COPY_SCALAR_FIELD(firstColCollation);
393
0
  COPY_SCALAR_FIELD(isInitPlan);
394
0
  COPY_SCALAR_FIELD(useHashTable);
395
0
  COPY_SCALAR_FIELD(unknownEqFalse);
396
0
  COPY_SCALAR_FIELD(parallel_safe);
397
0
  COPY_NODE_FIELD(setParam);
398
0
  COPY_NODE_FIELD(parParam);
399
0
  COPY_NODE_FIELD(args);
400
0
  COPY_SCALAR_FIELD(disabled_nodes);
401
0
  COPY_SCALAR_FIELD(startup_cost);
402
0
  COPY_SCALAR_FIELD(per_call_cost);
403
404
0
  return newnode;
405
0
}
406
407
static AlternativeSubPlan *
408
_copyAlternativeSubPlan(const AlternativeSubPlan *from)
409
0
{
410
0
  AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
411
412
0
  COPY_NODE_FIELD(subplans);
413
414
0
  return newnode;
415
0
}
416
417
static FieldSelect *
418
_copyFieldSelect(const FieldSelect *from)
419
0
{
420
0
  FieldSelect *newnode = makeNode(FieldSelect);
421
422
0
  COPY_NODE_FIELD(arg);
423
0
  COPY_SCALAR_FIELD(fieldnum);
424
0
  COPY_SCALAR_FIELD(resulttype);
425
0
  COPY_SCALAR_FIELD(resulttypmod);
426
0
  COPY_SCALAR_FIELD(resultcollid);
427
428
0
  return newnode;
429
0
}
430
431
static FieldStore *
432
_copyFieldStore(const FieldStore *from)
433
0
{
434
0
  FieldStore *newnode = makeNode(FieldStore);
435
436
0
  COPY_NODE_FIELD(arg);
437
0
  COPY_NODE_FIELD(newvals);
438
0
  COPY_NODE_FIELD(fieldnums);
439
0
  COPY_SCALAR_FIELD(resulttype);
440
441
0
  return newnode;
442
0
}
443
444
static RelabelType *
445
_copyRelabelType(const RelabelType *from)
446
0
{
447
0
  RelabelType *newnode = makeNode(RelabelType);
448
449
0
  COPY_NODE_FIELD(arg);
450
0
  COPY_SCALAR_FIELD(resulttype);
451
0
  COPY_SCALAR_FIELD(resulttypmod);
452
0
  COPY_SCALAR_FIELD(resultcollid);
453
0
  COPY_SCALAR_FIELD(relabelformat);
454
0
  COPY_LOCATION_FIELD(location);
455
456
0
  return newnode;
457
0
}
458
459
static CoerceViaIO *
460
_copyCoerceViaIO(const CoerceViaIO *from)
461
0
{
462
0
  CoerceViaIO *newnode = makeNode(CoerceViaIO);
463
464
0
  COPY_NODE_FIELD(arg);
465
0
  COPY_SCALAR_FIELD(resulttype);
466
0
  COPY_SCALAR_FIELD(resultcollid);
467
0
  COPY_SCALAR_FIELD(coerceformat);
468
0
  COPY_LOCATION_FIELD(location);
469
470
0
  return newnode;
471
0
}
472
473
static ArrayCoerceExpr *
474
_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
475
0
{
476
0
  ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
477
478
0
  COPY_NODE_FIELD(arg);
479
0
  COPY_NODE_FIELD(elemexpr);
480
0
  COPY_SCALAR_FIELD(resulttype);
481
0
  COPY_SCALAR_FIELD(resulttypmod);
482
0
  COPY_SCALAR_FIELD(resultcollid);
483
0
  COPY_SCALAR_FIELD(coerceformat);
484
0
  COPY_LOCATION_FIELD(location);
485
486
0
  return newnode;
487
0
}
488
489
static ConvertRowtypeExpr *
490
_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
491
0
{
492
0
  ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
493
494
0
  COPY_NODE_FIELD(arg);
495
0
  COPY_SCALAR_FIELD(resulttype);
496
0
  COPY_SCALAR_FIELD(convertformat);
497
0
  COPY_LOCATION_FIELD(location);
498
499
0
  return newnode;
500
0
}
501
502
static CollateExpr *
503
_copyCollateExpr(const CollateExpr *from)
504
0
{
505
0
  CollateExpr *newnode = makeNode(CollateExpr);
506
507
0
  COPY_NODE_FIELD(arg);
508
0
  COPY_SCALAR_FIELD(collOid);
509
0
  COPY_LOCATION_FIELD(location);
510
511
0
  return newnode;
512
0
}
513
514
static CaseExpr *
515
_copyCaseExpr(const CaseExpr *from)
516
0
{
517
0
  CaseExpr *newnode = makeNode(CaseExpr);
518
519
0
  COPY_SCALAR_FIELD(casetype);
520
0
  COPY_SCALAR_FIELD(casecollid);
521
0
  COPY_NODE_FIELD(arg);
522
0
  COPY_NODE_FIELD(args);
523
0
  COPY_NODE_FIELD(defresult);
524
0
  COPY_LOCATION_FIELD(location);
525
526
0
  return newnode;
527
0
}
528
529
static CaseWhen *
530
_copyCaseWhen(const CaseWhen *from)
531
0
{
532
0
  CaseWhen *newnode = makeNode(CaseWhen);
533
534
0
  COPY_NODE_FIELD(expr);
535
0
  COPY_NODE_FIELD(result);
536
0
  COPY_LOCATION_FIELD(location);
537
538
0
  return newnode;
539
0
}
540
541
static CaseTestExpr *
542
_copyCaseTestExpr(const CaseTestExpr *from)
543
0
{
544
0
  CaseTestExpr *newnode = makeNode(CaseTestExpr);
545
546
0
  COPY_SCALAR_FIELD(typeId);
547
0
  COPY_SCALAR_FIELD(typeMod);
548
0
  COPY_SCALAR_FIELD(collation);
549
550
0
  return newnode;
551
0
}
552
553
static ArrayExpr *
554
_copyArrayExpr(const ArrayExpr *from)
555
0
{
556
0
  ArrayExpr *newnode = makeNode(ArrayExpr);
557
558
0
  COPY_SCALAR_FIELD(array_typeid);
559
0
  COPY_SCALAR_FIELD(array_collid);
560
0
  COPY_SCALAR_FIELD(element_typeid);
561
0
  COPY_NODE_FIELD(elements);
562
0
  COPY_SCALAR_FIELD(multidims);
563
0
  COPY_LOCATION_FIELD(list_start);
564
0
  COPY_LOCATION_FIELD(list_end);
565
0
  COPY_LOCATION_FIELD(location);
566
567
0
  return newnode;
568
0
}
569
570
static RowExpr *
571
_copyRowExpr(const RowExpr *from)
572
0
{
573
0
  RowExpr *newnode = makeNode(RowExpr);
574
575
0
  COPY_NODE_FIELD(args);
576
0
  COPY_SCALAR_FIELD(row_typeid);
577
0
  COPY_SCALAR_FIELD(row_format);
578
0
  COPY_NODE_FIELD(colnames);
579
0
  COPY_LOCATION_FIELD(location);
580
581
0
  return newnode;
582
0
}
583
584
static RowCompareExpr *
585
_copyRowCompareExpr(const RowCompareExpr *from)
586
0
{
587
0
  RowCompareExpr *newnode = makeNode(RowCompareExpr);
588
589
0
  COPY_SCALAR_FIELD(cmptype);
590
0
  COPY_NODE_FIELD(opnos);
591
0
  COPY_NODE_FIELD(opfamilies);
592
0
  COPY_NODE_FIELD(inputcollids);
593
0
  COPY_NODE_FIELD(largs);
594
0
  COPY_NODE_FIELD(rargs);
595
596
0
  return newnode;
597
0
}
598
599
static CoalesceExpr *
600
_copyCoalesceExpr(const CoalesceExpr *from)
601
0
{
602
0
  CoalesceExpr *newnode = makeNode(CoalesceExpr);
603
604
0
  COPY_SCALAR_FIELD(coalescetype);
605
0
  COPY_SCALAR_FIELD(coalescecollid);
606
0
  COPY_NODE_FIELD(args);
607
0
  COPY_LOCATION_FIELD(location);
608
609
0
  return newnode;
610
0
}
611
612
static MinMaxExpr *
613
_copyMinMaxExpr(const MinMaxExpr *from)
614
0
{
615
0
  MinMaxExpr *newnode = makeNode(MinMaxExpr);
616
617
0
  COPY_SCALAR_FIELD(minmaxtype);
618
0
  COPY_SCALAR_FIELD(minmaxcollid);
619
0
  COPY_SCALAR_FIELD(inputcollid);
620
0
  COPY_SCALAR_FIELD(op);
621
0
  COPY_NODE_FIELD(args);
622
0
  COPY_LOCATION_FIELD(location);
623
624
0
  return newnode;
625
0
}
626
627
static SQLValueFunction *
628
_copySQLValueFunction(const SQLValueFunction *from)
629
0
{
630
0
  SQLValueFunction *newnode = makeNode(SQLValueFunction);
631
632
0
  COPY_SCALAR_FIELD(op);
633
0
  COPY_SCALAR_FIELD(type);
634
0
  COPY_SCALAR_FIELD(typmod);
635
0
  COPY_LOCATION_FIELD(location);
636
637
0
  return newnode;
638
0
}
639
640
static XmlExpr *
641
_copyXmlExpr(const XmlExpr *from)
642
0
{
643
0
  XmlExpr *newnode = makeNode(XmlExpr);
644
645
0
  COPY_SCALAR_FIELD(op);
646
0
  COPY_STRING_FIELD(name);
647
0
  COPY_NODE_FIELD(named_args);
648
0
  COPY_NODE_FIELD(arg_names);
649
0
  COPY_NODE_FIELD(args);
650
0
  COPY_SCALAR_FIELD(xmloption);
651
0
  COPY_SCALAR_FIELD(indent);
652
0
  COPY_SCALAR_FIELD(type);
653
0
  COPY_SCALAR_FIELD(typmod);
654
0
  COPY_LOCATION_FIELD(location);
655
656
0
  return newnode;
657
0
}
658
659
static JsonFormat *
660
_copyJsonFormat(const JsonFormat *from)
661
0
{
662
0
  JsonFormat *newnode = makeNode(JsonFormat);
663
664
0
  COPY_SCALAR_FIELD(format_type);
665
0
  COPY_SCALAR_FIELD(encoding);
666
0
  COPY_LOCATION_FIELD(location);
667
668
0
  return newnode;
669
0
}
670
671
static JsonReturning *
672
_copyJsonReturning(const JsonReturning *from)
673
0
{
674
0
  JsonReturning *newnode = makeNode(JsonReturning);
675
676
0
  COPY_NODE_FIELD(format);
677
0
  COPY_SCALAR_FIELD(typid);
678
0
  COPY_SCALAR_FIELD(typmod);
679
680
0
  return newnode;
681
0
}
682
683
static JsonValueExpr *
684
_copyJsonValueExpr(const JsonValueExpr *from)
685
0
{
686
0
  JsonValueExpr *newnode = makeNode(JsonValueExpr);
687
688
0
  COPY_NODE_FIELD(raw_expr);
689
0
  COPY_NODE_FIELD(formatted_expr);
690
0
  COPY_NODE_FIELD(format);
691
692
0
  return newnode;
693
0
}
694
695
static JsonConstructorExpr *
696
_copyJsonConstructorExpr(const JsonConstructorExpr *from)
697
0
{
698
0
  JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
699
700
0
  COPY_SCALAR_FIELD(type);
701
0
  COPY_NODE_FIELD(args);
702
0
  COPY_NODE_FIELD(func);
703
0
  COPY_NODE_FIELD(coercion);
704
0
  COPY_NODE_FIELD(returning);
705
0
  COPY_NODE_FIELD(orig_query);
706
0
  COPY_NODE_FIELD(format);
707
0
  COPY_SCALAR_FIELD(absent_on_null);
708
0
  COPY_SCALAR_FIELD(unique);
709
0
  COPY_LOCATION_FIELD(location);
710
711
0
  return newnode;
712
0
}
713
714
static JsonIsPredicate *
715
_copyJsonIsPredicate(const JsonIsPredicate *from)
716
0
{
717
0
  JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
718
719
0
  COPY_NODE_FIELD(expr);
720
0
  COPY_NODE_FIELD(format);
721
0
  COPY_SCALAR_FIELD(item_type);
722
0
  COPY_SCALAR_FIELD(unique_keys);
723
0
  COPY_SCALAR_FIELD(exprBaseType);
724
0
  COPY_LOCATION_FIELD(location);
725
726
0
  return newnode;
727
0
}
728
729
static JsonBehavior *
730
_copyJsonBehavior(const JsonBehavior *from)
731
0
{
732
0
  JsonBehavior *newnode = makeNode(JsonBehavior);
733
734
0
  COPY_SCALAR_FIELD(btype);
735
0
  COPY_NODE_FIELD(expr);
736
0
  COPY_SCALAR_FIELD(coerce);
737
0
  COPY_LOCATION_FIELD(location);
738
739
0
  return newnode;
740
0
}
741
742
static JsonExpr *
743
_copyJsonExpr(const JsonExpr *from)
744
0
{
745
0
  JsonExpr *newnode = makeNode(JsonExpr);
746
747
0
  COPY_SCALAR_FIELD(op);
748
0
  COPY_STRING_FIELD(column_name);
749
0
  COPY_NODE_FIELD(formatted_expr);
750
0
  COPY_NODE_FIELD(format);
751
0
  COPY_NODE_FIELD(path_spec);
752
0
  COPY_NODE_FIELD(returning);
753
0
  COPY_NODE_FIELD(passing_names);
754
0
  COPY_NODE_FIELD(passing_values);
755
0
  COPY_NODE_FIELD(on_empty);
756
0
  COPY_NODE_FIELD(on_error);
757
0
  COPY_SCALAR_FIELD(use_io_coercion);
758
0
  COPY_SCALAR_FIELD(use_json_coercion);
759
0
  COPY_SCALAR_FIELD(wrapper);
760
0
  COPY_SCALAR_FIELD(omit_quotes);
761
0
  COPY_SCALAR_FIELD(collation);
762
0
  COPY_LOCATION_FIELD(location);
763
764
0
  return newnode;
765
0
}
766
767
static JsonTablePath *
768
_copyJsonTablePath(const JsonTablePath *from)
769
0
{
770
0
  JsonTablePath *newnode = makeNode(JsonTablePath);
771
772
0
  COPY_NODE_FIELD(value);
773
0
  COPY_STRING_FIELD(name);
774
775
0
  return newnode;
776
0
}
777
778
static JsonTablePathScan *
779
_copyJsonTablePathScan(const JsonTablePathScan *from)
780
0
{
781
0
  JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
782
783
0
  COPY_NODE_FIELD(path);
784
0
  COPY_SCALAR_FIELD(errorOnError);
785
0
  COPY_NODE_FIELD(child);
786
0
  COPY_SCALAR_FIELD(outerJoin);
787
0
  COPY_SCALAR_FIELD(colMin);
788
0
  COPY_SCALAR_FIELD(colMax);
789
790
0
  return newnode;
791
0
}
792
793
static JsonTableSiblingJoin *
794
_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
795
0
{
796
0
  JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
797
798
0
  COPY_NODE_FIELD(lplan);
799
0
  COPY_NODE_FIELD(rplan);
800
0
  COPY_SCALAR_FIELD(cross);
801
802
0
  return newnode;
803
0
}
804
805
static NullTest *
806
_copyNullTest(const NullTest *from)
807
0
{
808
0
  NullTest *newnode = makeNode(NullTest);
809
810
0
  COPY_NODE_FIELD(arg);
811
0
  COPY_SCALAR_FIELD(nulltesttype);
812
0
  COPY_SCALAR_FIELD(argisrow);
813
0
  COPY_LOCATION_FIELD(location);
814
815
0
  return newnode;
816
0
}
817
818
static BooleanTest *
819
_copyBooleanTest(const BooleanTest *from)
820
0
{
821
0
  BooleanTest *newnode = makeNode(BooleanTest);
822
823
0
  COPY_NODE_FIELD(arg);
824
0
  COPY_SCALAR_FIELD(booltesttype);
825
0
  COPY_LOCATION_FIELD(location);
826
827
0
  return newnode;
828
0
}
829
830
static MergeAction *
831
_copyMergeAction(const MergeAction *from)
832
0
{
833
0
  MergeAction *newnode = makeNode(MergeAction);
834
835
0
  COPY_SCALAR_FIELD(matchKind);
836
0
  COPY_SCALAR_FIELD(commandType);
837
0
  COPY_SCALAR_FIELD(override);
838
0
  COPY_NODE_FIELD(qual);
839
0
  COPY_NODE_FIELD(targetList);
840
0
  COPY_NODE_FIELD(updateColnos);
841
842
0
  return newnode;
843
0
}
844
845
static CoerceToDomain *
846
_copyCoerceToDomain(const CoerceToDomain *from)
847
0
{
848
0
  CoerceToDomain *newnode = makeNode(CoerceToDomain);
849
850
0
  COPY_NODE_FIELD(arg);
851
0
  COPY_SCALAR_FIELD(resulttype);
852
0
  COPY_SCALAR_FIELD(resulttypmod);
853
0
  COPY_SCALAR_FIELD(resultcollid);
854
0
  COPY_SCALAR_FIELD(coercionformat);
855
0
  COPY_LOCATION_FIELD(location);
856
857
0
  return newnode;
858
0
}
859
860
static CoerceToDomainValue *
861
_copyCoerceToDomainValue(const CoerceToDomainValue *from)
862
0
{
863
0
  CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
864
865
0
  COPY_SCALAR_FIELD(typeId);
866
0
  COPY_SCALAR_FIELD(typeMod);
867
0
  COPY_SCALAR_FIELD(collation);
868
0
  COPY_LOCATION_FIELD(location);
869
870
0
  return newnode;
871
0
}
872
873
static SetToDefault *
874
_copySetToDefault(const SetToDefault *from)
875
0
{
876
0
  SetToDefault *newnode = makeNode(SetToDefault);
877
878
0
  COPY_SCALAR_FIELD(typeId);
879
0
  COPY_SCALAR_FIELD(typeMod);
880
0
  COPY_SCALAR_FIELD(collation);
881
0
  COPY_LOCATION_FIELD(location);
882
883
0
  return newnode;
884
0
}
885
886
static CurrentOfExpr *
887
_copyCurrentOfExpr(const CurrentOfExpr *from)
888
0
{
889
0
  CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
890
891
0
  COPY_SCALAR_FIELD(cvarno);
892
0
  COPY_STRING_FIELD(cursor_name);
893
0
  COPY_SCALAR_FIELD(cursor_param);
894
895
0
  return newnode;
896
0
}
897
898
static NextValueExpr *
899
_copyNextValueExpr(const NextValueExpr *from)
900
0
{
901
0
  NextValueExpr *newnode = makeNode(NextValueExpr);
902
903
0
  COPY_SCALAR_FIELD(seqid);
904
0
  COPY_SCALAR_FIELD(typeId);
905
906
0
  return newnode;
907
0
}
908
909
static InferenceElem *
910
_copyInferenceElem(const InferenceElem *from)
911
0
{
912
0
  InferenceElem *newnode = makeNode(InferenceElem);
913
914
0
  COPY_NODE_FIELD(expr);
915
0
  COPY_SCALAR_FIELD(infercollid);
916
0
  COPY_SCALAR_FIELD(inferopclass);
917
918
0
  return newnode;
919
0
}
920
921
static ReturningExpr *
922
_copyReturningExpr(const ReturningExpr *from)
923
0
{
924
0
  ReturningExpr *newnode = makeNode(ReturningExpr);
925
926
0
  COPY_SCALAR_FIELD(retlevelsup);
927
0
  COPY_SCALAR_FIELD(retold);
928
0
  COPY_NODE_FIELD(retexpr);
929
930
0
  return newnode;
931
0
}
932
933
static TargetEntry *
934
_copyTargetEntry(const TargetEntry *from)
935
0
{
936
0
  TargetEntry *newnode = makeNode(TargetEntry);
937
938
0
  COPY_NODE_FIELD(expr);
939
0
  COPY_SCALAR_FIELD(resno);
940
0
  COPY_STRING_FIELD(resname);
941
0
  COPY_SCALAR_FIELD(ressortgroupref);
942
0
  COPY_SCALAR_FIELD(resorigtbl);
943
0
  COPY_SCALAR_FIELD(resorigcol);
944
0
  COPY_SCALAR_FIELD(resjunk);
945
946
0
  return newnode;
947
0
}
948
949
static RangeTblRef *
950
_copyRangeTblRef(const RangeTblRef *from)
951
0
{
952
0
  RangeTblRef *newnode = makeNode(RangeTblRef);
953
954
0
  COPY_SCALAR_FIELD(rtindex);
955
956
0
  return newnode;
957
0
}
958
959
static JoinExpr *
960
_copyJoinExpr(const JoinExpr *from)
961
0
{
962
0
  JoinExpr *newnode = makeNode(JoinExpr);
963
964
0
  COPY_SCALAR_FIELD(jointype);
965
0
  COPY_SCALAR_FIELD(isNatural);
966
0
  COPY_NODE_FIELD(larg);
967
0
  COPY_NODE_FIELD(rarg);
968
0
  COPY_NODE_FIELD(usingClause);
969
0
  COPY_NODE_FIELD(join_using_alias);
970
0
  COPY_NODE_FIELD(quals);
971
0
  COPY_NODE_FIELD(alias);
972
0
  COPY_SCALAR_FIELD(rtindex);
973
974
0
  return newnode;
975
0
}
976
977
static FromExpr *
978
_copyFromExpr(const FromExpr *from)
979
0
{
980
0
  FromExpr *newnode = makeNode(FromExpr);
981
982
0
  COPY_NODE_FIELD(fromlist);
983
0
  COPY_NODE_FIELD(quals);
984
985
0
  return newnode;
986
0
}
987
988
static OnConflictExpr *
989
_copyOnConflictExpr(const OnConflictExpr *from)
990
0
{
991
0
  OnConflictExpr *newnode = makeNode(OnConflictExpr);
992
993
0
  COPY_SCALAR_FIELD(action);
994
0
  COPY_NODE_FIELD(arbiterElems);
995
0
  COPY_NODE_FIELD(arbiterWhere);
996
0
  COPY_SCALAR_FIELD(constraint);
997
0
  COPY_SCALAR_FIELD(lockStrength);
998
0
  COPY_NODE_FIELD(onConflictSet);
999
0
  COPY_NODE_FIELD(onConflictWhere);
1000
0
  COPY_SCALAR_FIELD(exclRelIndex);
1001
0
  COPY_NODE_FIELD(exclRelTlist);
1002
1003
0
  return newnode;
1004
0
}
1005
1006
static Query *
1007
_copyQuery(const Query *from)
1008
0
{
1009
0
  Query *newnode = makeNode(Query);
1010
1011
0
  COPY_SCALAR_FIELD(commandType);
1012
0
  COPY_SCALAR_FIELD(querySource);
1013
0
  COPY_SCALAR_FIELD(queryId);
1014
0
  COPY_SCALAR_FIELD(canSetTag);
1015
0
  COPY_NODE_FIELD(utilityStmt);
1016
0
  COPY_SCALAR_FIELD(resultRelation);
1017
0
  COPY_SCALAR_FIELD(hasAggs);
1018
0
  COPY_SCALAR_FIELD(hasWindowFuncs);
1019
0
  COPY_SCALAR_FIELD(hasTargetSRFs);
1020
0
  COPY_SCALAR_FIELD(hasSubLinks);
1021
0
  COPY_SCALAR_FIELD(hasDistinctOn);
1022
0
  COPY_SCALAR_FIELD(hasRecursive);
1023
0
  COPY_SCALAR_FIELD(hasModifyingCTE);
1024
0
  COPY_SCALAR_FIELD(hasForUpdate);
1025
0
  COPY_SCALAR_FIELD(hasRowSecurity);
1026
0
  COPY_SCALAR_FIELD(hasGroupRTE);
1027
0
  COPY_SCALAR_FIELD(isReturn);
1028
0
  COPY_NODE_FIELD(cteList);
1029
0
  COPY_NODE_FIELD(rtable);
1030
0
  COPY_NODE_FIELD(rteperminfos);
1031
0
  COPY_NODE_FIELD(jointree);
1032
0
  COPY_NODE_FIELD(mergeActionList);
1033
0
  COPY_SCALAR_FIELD(mergeTargetRelation);
1034
0
  COPY_NODE_FIELD(mergeJoinCondition);
1035
0
  COPY_NODE_FIELD(targetList);
1036
0
  COPY_SCALAR_FIELD(override);
1037
0
  COPY_NODE_FIELD(onConflict);
1038
0
  COPY_STRING_FIELD(returningOldAlias);
1039
0
  COPY_STRING_FIELD(returningNewAlias);
1040
0
  COPY_NODE_FIELD(returningList);
1041
0
  COPY_NODE_FIELD(groupClause);
1042
0
  COPY_SCALAR_FIELD(groupDistinct);
1043
0
  COPY_NODE_FIELD(groupingSets);
1044
0
  COPY_NODE_FIELD(havingQual);
1045
0
  COPY_NODE_FIELD(windowClause);
1046
0
  COPY_NODE_FIELD(distinctClause);
1047
0
  COPY_NODE_FIELD(sortClause);
1048
0
  COPY_NODE_FIELD(limitOffset);
1049
0
  COPY_NODE_FIELD(limitCount);
1050
0
  COPY_SCALAR_FIELD(limitOption);
1051
0
  COPY_NODE_FIELD(rowMarks);
1052
0
  COPY_NODE_FIELD(setOperations);
1053
0
  COPY_NODE_FIELD(constraintDeps);
1054
0
  COPY_NODE_FIELD(withCheckOptions);
1055
0
  COPY_LOCATION_FIELD(stmt_location);
1056
0
  COPY_LOCATION_FIELD(stmt_len);
1057
1058
0
  return newnode;
1059
0
}
1060
1061
static TypeName *
1062
_copyTypeName(const TypeName *from)
1063
0
{
1064
0
  TypeName *newnode = makeNode(TypeName);
1065
1066
0
  COPY_NODE_FIELD(names);
1067
0
  COPY_SCALAR_FIELD(typeOid);
1068
0
  COPY_SCALAR_FIELD(setof);
1069
0
  COPY_SCALAR_FIELD(pct_type);
1070
0
  COPY_NODE_FIELD(typmods);
1071
0
  COPY_SCALAR_FIELD(typemod);
1072
0
  COPY_NODE_FIELD(arrayBounds);
1073
0
  COPY_LOCATION_FIELD(location);
1074
1075
0
  return newnode;
1076
0
}
1077
1078
static ColumnRef *
1079
_copyColumnRef(const ColumnRef *from)
1080
0
{
1081
0
  ColumnRef *newnode = makeNode(ColumnRef);
1082
1083
0
  COPY_NODE_FIELD(fields);
1084
0
  COPY_LOCATION_FIELD(location);
1085
1086
0
  return newnode;
1087
0
}
1088
1089
static ParamRef *
1090
_copyParamRef(const ParamRef *from)
1091
0
{
1092
0
  ParamRef *newnode = makeNode(ParamRef);
1093
1094
0
  COPY_SCALAR_FIELD(number);
1095
0
  COPY_LOCATION_FIELD(location);
1096
1097
0
  return newnode;
1098
0
}
1099
1100
static A_Expr *
1101
_copyA_Expr(const A_Expr *from)
1102
0
{
1103
0
  A_Expr *newnode = makeNode(A_Expr);
1104
1105
0
  COPY_SCALAR_FIELD(kind);
1106
0
  COPY_NODE_FIELD(name);
1107
0
  COPY_NODE_FIELD(lexpr);
1108
0
  COPY_NODE_FIELD(rexpr);
1109
0
  COPY_LOCATION_FIELD(rexpr_list_start);
1110
0
  COPY_LOCATION_FIELD(rexpr_list_end);
1111
0
  COPY_LOCATION_FIELD(location);
1112
1113
0
  return newnode;
1114
0
}
1115
1116
static TypeCast *
1117
_copyTypeCast(const TypeCast *from)
1118
0
{
1119
0
  TypeCast *newnode = makeNode(TypeCast);
1120
1121
0
  COPY_NODE_FIELD(arg);
1122
0
  COPY_NODE_FIELD(typeName);
1123
0
  COPY_LOCATION_FIELD(location);
1124
1125
0
  return newnode;
1126
0
}
1127
1128
static CollateClause *
1129
_copyCollateClause(const CollateClause *from)
1130
0
{
1131
0
  CollateClause *newnode = makeNode(CollateClause);
1132
1133
0
  COPY_NODE_FIELD(arg);
1134
0
  COPY_NODE_FIELD(collname);
1135
0
  COPY_LOCATION_FIELD(location);
1136
1137
0
  return newnode;
1138
0
}
1139
1140
static RoleSpec *
1141
_copyRoleSpec(const RoleSpec *from)
1142
0
{
1143
0
  RoleSpec *newnode = makeNode(RoleSpec);
1144
1145
0
  COPY_SCALAR_FIELD(roletype);
1146
0
  COPY_STRING_FIELD(rolename);
1147
0
  COPY_LOCATION_FIELD(location);
1148
1149
0
  return newnode;
1150
0
}
1151
1152
static FuncCall *
1153
_copyFuncCall(const FuncCall *from)
1154
0
{
1155
0
  FuncCall *newnode = makeNode(FuncCall);
1156
1157
0
  COPY_NODE_FIELD(funcname);
1158
0
  COPY_NODE_FIELD(args);
1159
0
  COPY_NODE_FIELD(agg_order);
1160
0
  COPY_NODE_FIELD(agg_filter);
1161
0
  COPY_NODE_FIELD(over);
1162
0
  COPY_SCALAR_FIELD(ignore_nulls);
1163
0
  COPY_SCALAR_FIELD(agg_within_group);
1164
0
  COPY_SCALAR_FIELD(agg_star);
1165
0
  COPY_SCALAR_FIELD(agg_distinct);
1166
0
  COPY_SCALAR_FIELD(func_variadic);
1167
0
  COPY_SCALAR_FIELD(funcformat);
1168
0
  COPY_LOCATION_FIELD(location);
1169
1170
0
  return newnode;
1171
0
}
1172
1173
static A_Star *
1174
_copyA_Star(const A_Star *from)
1175
0
{
1176
0
  A_Star *newnode = makeNode(A_Star);
1177
1178
1179
0
  return newnode;
1180
0
}
1181
1182
static A_Indices *
1183
_copyA_Indices(const A_Indices *from)
1184
0
{
1185
0
  A_Indices *newnode = makeNode(A_Indices);
1186
1187
0
  COPY_SCALAR_FIELD(is_slice);
1188
0
  COPY_NODE_FIELD(lidx);
1189
0
  COPY_NODE_FIELD(uidx);
1190
1191
0
  return newnode;
1192
0
}
1193
1194
static A_Indirection *
1195
_copyA_Indirection(const A_Indirection *from)
1196
0
{
1197
0
  A_Indirection *newnode = makeNode(A_Indirection);
1198
1199
0
  COPY_NODE_FIELD(arg);
1200
0
  COPY_NODE_FIELD(indirection);
1201
1202
0
  return newnode;
1203
0
}
1204
1205
static A_ArrayExpr *
1206
_copyA_ArrayExpr(const A_ArrayExpr *from)
1207
0
{
1208
0
  A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
1209
1210
0
  COPY_NODE_FIELD(elements);
1211
0
  COPY_LOCATION_FIELD(list_start);
1212
0
  COPY_LOCATION_FIELD(list_end);
1213
0
  COPY_LOCATION_FIELD(location);
1214
1215
0
  return newnode;
1216
0
}
1217
1218
static ResTarget *
1219
_copyResTarget(const ResTarget *from)
1220
0
{
1221
0
  ResTarget *newnode = makeNode(ResTarget);
1222
1223
0
  COPY_STRING_FIELD(name);
1224
0
  COPY_NODE_FIELD(indirection);
1225
0
  COPY_NODE_FIELD(val);
1226
0
  COPY_LOCATION_FIELD(location);
1227
1228
0
  return newnode;
1229
0
}
1230
1231
static MultiAssignRef *
1232
_copyMultiAssignRef(const MultiAssignRef *from)
1233
0
{
1234
0
  MultiAssignRef *newnode = makeNode(MultiAssignRef);
1235
1236
0
  COPY_NODE_FIELD(source);
1237
0
  COPY_SCALAR_FIELD(colno);
1238
0
  COPY_SCALAR_FIELD(ncolumns);
1239
1240
0
  return newnode;
1241
0
}
1242
1243
static SortBy *
1244
_copySortBy(const SortBy *from)
1245
0
{
1246
0
  SortBy *newnode = makeNode(SortBy);
1247
1248
0
  COPY_NODE_FIELD(node);
1249
0
  COPY_SCALAR_FIELD(sortby_dir);
1250
0
  COPY_SCALAR_FIELD(sortby_nulls);
1251
0
  COPY_NODE_FIELD(useOp);
1252
0
  COPY_LOCATION_FIELD(location);
1253
1254
0
  return newnode;
1255
0
}
1256
1257
static WindowDef *
1258
_copyWindowDef(const WindowDef *from)
1259
0
{
1260
0
  WindowDef *newnode = makeNode(WindowDef);
1261
1262
0
  COPY_STRING_FIELD(name);
1263
0
  COPY_STRING_FIELD(refname);
1264
0
  COPY_NODE_FIELD(partitionClause);
1265
0
  COPY_NODE_FIELD(orderClause);
1266
0
  COPY_SCALAR_FIELD(frameOptions);
1267
0
  COPY_NODE_FIELD(startOffset);
1268
0
  COPY_NODE_FIELD(endOffset);
1269
0
  COPY_LOCATION_FIELD(location);
1270
1271
0
  return newnode;
1272
0
}
1273
1274
static RangeSubselect *
1275
_copyRangeSubselect(const RangeSubselect *from)
1276
0
{
1277
0
  RangeSubselect *newnode = makeNode(RangeSubselect);
1278
1279
0
  COPY_SCALAR_FIELD(lateral);
1280
0
  COPY_NODE_FIELD(subquery);
1281
0
  COPY_NODE_FIELD(alias);
1282
1283
0
  return newnode;
1284
0
}
1285
1286
static RangeFunction *
1287
_copyRangeFunction(const RangeFunction *from)
1288
0
{
1289
0
  RangeFunction *newnode = makeNode(RangeFunction);
1290
1291
0
  COPY_SCALAR_FIELD(lateral);
1292
0
  COPY_SCALAR_FIELD(ordinality);
1293
0
  COPY_SCALAR_FIELD(is_rowsfrom);
1294
0
  COPY_NODE_FIELD(functions);
1295
0
  COPY_NODE_FIELD(alias);
1296
0
  COPY_NODE_FIELD(coldeflist);
1297
1298
0
  return newnode;
1299
0
}
1300
1301
static RangeTableFunc *
1302
_copyRangeTableFunc(const RangeTableFunc *from)
1303
0
{
1304
0
  RangeTableFunc *newnode = makeNode(RangeTableFunc);
1305
1306
0
  COPY_SCALAR_FIELD(lateral);
1307
0
  COPY_NODE_FIELD(docexpr);
1308
0
  COPY_NODE_FIELD(rowexpr);
1309
0
  COPY_NODE_FIELD(namespaces);
1310
0
  COPY_NODE_FIELD(columns);
1311
0
  COPY_NODE_FIELD(alias);
1312
0
  COPY_LOCATION_FIELD(location);
1313
1314
0
  return newnode;
1315
0
}
1316
1317
static RangeTableFuncCol *
1318
_copyRangeTableFuncCol(const RangeTableFuncCol *from)
1319
0
{
1320
0
  RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
1321
1322
0
  COPY_STRING_FIELD(colname);
1323
0
  COPY_NODE_FIELD(typeName);
1324
0
  COPY_SCALAR_FIELD(for_ordinality);
1325
0
  COPY_SCALAR_FIELD(is_not_null);
1326
0
  COPY_NODE_FIELD(colexpr);
1327
0
  COPY_NODE_FIELD(coldefexpr);
1328
0
  COPY_LOCATION_FIELD(location);
1329
1330
0
  return newnode;
1331
0
}
1332
1333
static RangeTableSample *
1334
_copyRangeTableSample(const RangeTableSample *from)
1335
0
{
1336
0
  RangeTableSample *newnode = makeNode(RangeTableSample);
1337
1338
0
  COPY_NODE_FIELD(relation);
1339
0
  COPY_NODE_FIELD(method);
1340
0
  COPY_NODE_FIELD(args);
1341
0
  COPY_NODE_FIELD(repeatable);
1342
0
  COPY_LOCATION_FIELD(location);
1343
1344
0
  return newnode;
1345
0
}
1346
1347
static ColumnDef *
1348
_copyColumnDef(const ColumnDef *from)
1349
0
{
1350
0
  ColumnDef *newnode = makeNode(ColumnDef);
1351
1352
0
  COPY_STRING_FIELD(colname);
1353
0
  COPY_NODE_FIELD(typeName);
1354
0
  COPY_STRING_FIELD(compression);
1355
0
  COPY_SCALAR_FIELD(inhcount);
1356
0
  COPY_SCALAR_FIELD(is_local);
1357
0
  COPY_SCALAR_FIELD(is_not_null);
1358
0
  COPY_SCALAR_FIELD(is_from_type);
1359
0
  COPY_SCALAR_FIELD(storage);
1360
0
  COPY_STRING_FIELD(storage_name);
1361
0
  COPY_NODE_FIELD(raw_default);
1362
0
  COPY_NODE_FIELD(cooked_default);
1363
0
  COPY_SCALAR_FIELD(identity);
1364
0
  COPY_NODE_FIELD(identitySequence);
1365
0
  COPY_SCALAR_FIELD(generated);
1366
0
  COPY_NODE_FIELD(collClause);
1367
0
  COPY_SCALAR_FIELD(collOid);
1368
0
  COPY_NODE_FIELD(constraints);
1369
0
  COPY_NODE_FIELD(fdwoptions);
1370
0
  COPY_LOCATION_FIELD(location);
1371
1372
0
  return newnode;
1373
0
}
1374
1375
static TableLikeClause *
1376
_copyTableLikeClause(const TableLikeClause *from)
1377
0
{
1378
0
  TableLikeClause *newnode = makeNode(TableLikeClause);
1379
1380
0
  COPY_NODE_FIELD(relation);
1381
0
  COPY_SCALAR_FIELD(options);
1382
0
  COPY_SCALAR_FIELD(relationOid);
1383
1384
0
  return newnode;
1385
0
}
1386
1387
static IndexElem *
1388
_copyIndexElem(const IndexElem *from)
1389
0
{
1390
0
  IndexElem *newnode = makeNode(IndexElem);
1391
1392
0
  COPY_STRING_FIELD(name);
1393
0
  COPY_NODE_FIELD(expr);
1394
0
  COPY_STRING_FIELD(indexcolname);
1395
0
  COPY_NODE_FIELD(collation);
1396
0
  COPY_NODE_FIELD(opclass);
1397
0
  COPY_NODE_FIELD(opclassopts);
1398
0
  COPY_SCALAR_FIELD(ordering);
1399
0
  COPY_SCALAR_FIELD(nulls_ordering);
1400
0
  COPY_LOCATION_FIELD(location);
1401
1402
0
  return newnode;
1403
0
}
1404
1405
static DefElem *
1406
_copyDefElem(const DefElem *from)
1407
0
{
1408
0
  DefElem *newnode = makeNode(DefElem);
1409
1410
0
  COPY_STRING_FIELD(defnamespace);
1411
0
  COPY_STRING_FIELD(defname);
1412
0
  COPY_NODE_FIELD(arg);
1413
0
  COPY_SCALAR_FIELD(defaction);
1414
0
  COPY_LOCATION_FIELD(location);
1415
1416
0
  return newnode;
1417
0
}
1418
1419
static LockingClause *
1420
_copyLockingClause(const LockingClause *from)
1421
0
{
1422
0
  LockingClause *newnode = makeNode(LockingClause);
1423
1424
0
  COPY_NODE_FIELD(lockedRels);
1425
0
  COPY_SCALAR_FIELD(strength);
1426
0
  COPY_SCALAR_FIELD(waitPolicy);
1427
1428
0
  return newnode;
1429
0
}
1430
1431
static XmlSerialize *
1432
_copyXmlSerialize(const XmlSerialize *from)
1433
0
{
1434
0
  XmlSerialize *newnode = makeNode(XmlSerialize);
1435
1436
0
  COPY_SCALAR_FIELD(xmloption);
1437
0
  COPY_NODE_FIELD(expr);
1438
0
  COPY_NODE_FIELD(typeName);
1439
0
  COPY_SCALAR_FIELD(indent);
1440
0
  COPY_LOCATION_FIELD(location);
1441
1442
0
  return newnode;
1443
0
}
1444
1445
static PartitionElem *
1446
_copyPartitionElem(const PartitionElem *from)
1447
0
{
1448
0
  PartitionElem *newnode = makeNode(PartitionElem);
1449
1450
0
  COPY_STRING_FIELD(name);
1451
0
  COPY_NODE_FIELD(expr);
1452
0
  COPY_NODE_FIELD(collation);
1453
0
  COPY_NODE_FIELD(opclass);
1454
0
  COPY_LOCATION_FIELD(location);
1455
1456
0
  return newnode;
1457
0
}
1458
1459
static PartitionSpec *
1460
_copyPartitionSpec(const PartitionSpec *from)
1461
0
{
1462
0
  PartitionSpec *newnode = makeNode(PartitionSpec);
1463
1464
0
  COPY_SCALAR_FIELD(strategy);
1465
0
  COPY_NODE_FIELD(partParams);
1466
0
  COPY_LOCATION_FIELD(location);
1467
1468
0
  return newnode;
1469
0
}
1470
1471
static PartitionBoundSpec *
1472
_copyPartitionBoundSpec(const PartitionBoundSpec *from)
1473
0
{
1474
0
  PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
1475
1476
0
  COPY_SCALAR_FIELD(strategy);
1477
0
  COPY_SCALAR_FIELD(is_default);
1478
0
  COPY_SCALAR_FIELD(modulus);
1479
0
  COPY_SCALAR_FIELD(remainder);
1480
0
  COPY_NODE_FIELD(listdatums);
1481
0
  COPY_NODE_FIELD(lowerdatums);
1482
0
  COPY_NODE_FIELD(upperdatums);
1483
0
  COPY_LOCATION_FIELD(location);
1484
1485
0
  return newnode;
1486
0
}
1487
1488
static PartitionRangeDatum *
1489
_copyPartitionRangeDatum(const PartitionRangeDatum *from)
1490
0
{
1491
0
  PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
1492
1493
0
  COPY_SCALAR_FIELD(kind);
1494
0
  COPY_NODE_FIELD(value);
1495
0
  COPY_LOCATION_FIELD(location);
1496
1497
0
  return newnode;
1498
0
}
1499
1500
static PartitionCmd *
1501
_copyPartitionCmd(const PartitionCmd *from)
1502
0
{
1503
0
  PartitionCmd *newnode = makeNode(PartitionCmd);
1504
1505
0
  COPY_NODE_FIELD(name);
1506
0
  COPY_NODE_FIELD(bound);
1507
0
  COPY_SCALAR_FIELD(concurrent);
1508
1509
0
  return newnode;
1510
0
}
1511
1512
static RangeTblEntry *
1513
_copyRangeTblEntry(const RangeTblEntry *from)
1514
0
{
1515
0
  RangeTblEntry *newnode = makeNode(RangeTblEntry);
1516
1517
0
  COPY_NODE_FIELD(alias);
1518
0
  COPY_NODE_FIELD(eref);
1519
0
  COPY_SCALAR_FIELD(rtekind);
1520
0
  COPY_SCALAR_FIELD(relid);
1521
0
  COPY_SCALAR_FIELD(inh);
1522
0
  COPY_SCALAR_FIELD(relkind);
1523
0
  COPY_SCALAR_FIELD(rellockmode);
1524
0
  COPY_SCALAR_FIELD(perminfoindex);
1525
0
  COPY_NODE_FIELD(tablesample);
1526
0
  COPY_NODE_FIELD(subquery);
1527
0
  COPY_SCALAR_FIELD(security_barrier);
1528
0
  COPY_SCALAR_FIELD(jointype);
1529
0
  COPY_SCALAR_FIELD(joinmergedcols);
1530
0
  COPY_NODE_FIELD(joinaliasvars);
1531
0
  COPY_NODE_FIELD(joinleftcols);
1532
0
  COPY_NODE_FIELD(joinrightcols);
1533
0
  COPY_NODE_FIELD(join_using_alias);
1534
0
  COPY_NODE_FIELD(functions);
1535
0
  COPY_SCALAR_FIELD(funcordinality);
1536
0
  COPY_NODE_FIELD(tablefunc);
1537
0
  COPY_NODE_FIELD(values_lists);
1538
0
  COPY_STRING_FIELD(ctename);
1539
0
  COPY_SCALAR_FIELD(ctelevelsup);
1540
0
  COPY_SCALAR_FIELD(self_reference);
1541
0
  COPY_NODE_FIELD(coltypes);
1542
0
  COPY_NODE_FIELD(coltypmods);
1543
0
  COPY_NODE_FIELD(colcollations);
1544
0
  COPY_STRING_FIELD(enrname);
1545
0
  COPY_SCALAR_FIELD(enrtuples);
1546
0
  COPY_NODE_FIELD(groupexprs);
1547
0
  COPY_SCALAR_FIELD(lateral);
1548
0
  COPY_SCALAR_FIELD(inFromCl);
1549
0
  COPY_NODE_FIELD(securityQuals);
1550
1551
0
  return newnode;
1552
0
}
1553
1554
static RTEPermissionInfo *
1555
_copyRTEPermissionInfo(const RTEPermissionInfo *from)
1556
0
{
1557
0
  RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
1558
1559
0
  COPY_SCALAR_FIELD(relid);
1560
0
  COPY_SCALAR_FIELD(inh);
1561
0
  COPY_SCALAR_FIELD(requiredPerms);
1562
0
  COPY_SCALAR_FIELD(checkAsUser);
1563
0
  COPY_BITMAPSET_FIELD(selectedCols);
1564
0
  COPY_BITMAPSET_FIELD(insertedCols);
1565
0
  COPY_BITMAPSET_FIELD(updatedCols);
1566
1567
0
  return newnode;
1568
0
}
1569
1570
static RangeTblFunction *
1571
_copyRangeTblFunction(const RangeTblFunction *from)
1572
0
{
1573
0
  RangeTblFunction *newnode = makeNode(RangeTblFunction);
1574
1575
0
  COPY_NODE_FIELD(funcexpr);
1576
0
  COPY_SCALAR_FIELD(funccolcount);
1577
0
  COPY_NODE_FIELD(funccolnames);
1578
0
  COPY_NODE_FIELD(funccoltypes);
1579
0
  COPY_NODE_FIELD(funccoltypmods);
1580
0
  COPY_NODE_FIELD(funccolcollations);
1581
0
  COPY_BITMAPSET_FIELD(funcparams);
1582
1583
0
  return newnode;
1584
0
}
1585
1586
static TableSampleClause *
1587
_copyTableSampleClause(const TableSampleClause *from)
1588
0
{
1589
0
  TableSampleClause *newnode = makeNode(TableSampleClause);
1590
1591
0
  COPY_SCALAR_FIELD(tsmhandler);
1592
0
  COPY_NODE_FIELD(args);
1593
0
  COPY_NODE_FIELD(repeatable);
1594
1595
0
  return newnode;
1596
0
}
1597
1598
static WithCheckOption *
1599
_copyWithCheckOption(const WithCheckOption *from)
1600
0
{
1601
0
  WithCheckOption *newnode = makeNode(WithCheckOption);
1602
1603
0
  COPY_SCALAR_FIELD(kind);
1604
0
  COPY_STRING_FIELD(relname);
1605
0
  COPY_STRING_FIELD(polname);
1606
0
  COPY_NODE_FIELD(qual);
1607
0
  COPY_SCALAR_FIELD(cascaded);
1608
1609
0
  return newnode;
1610
0
}
1611
1612
static SortGroupClause *
1613
_copySortGroupClause(const SortGroupClause *from)
1614
0
{
1615
0
  SortGroupClause *newnode = makeNode(SortGroupClause);
1616
1617
0
  COPY_SCALAR_FIELD(tleSortGroupRef);
1618
0
  COPY_SCALAR_FIELD(eqop);
1619
0
  COPY_SCALAR_FIELD(sortop);
1620
0
  COPY_SCALAR_FIELD(reverse_sort);
1621
0
  COPY_SCALAR_FIELD(nulls_first);
1622
0
  COPY_SCALAR_FIELD(hashable);
1623
1624
0
  return newnode;
1625
0
}
1626
1627
static GroupingSet *
1628
_copyGroupingSet(const GroupingSet *from)
1629
0
{
1630
0
  GroupingSet *newnode = makeNode(GroupingSet);
1631
1632
0
  COPY_SCALAR_FIELD(kind);
1633
0
  COPY_NODE_FIELD(content);
1634
0
  COPY_LOCATION_FIELD(location);
1635
1636
0
  return newnode;
1637
0
}
1638
1639
static WindowClause *
1640
_copyWindowClause(const WindowClause *from)
1641
0
{
1642
0
  WindowClause *newnode = makeNode(WindowClause);
1643
1644
0
  COPY_STRING_FIELD(name);
1645
0
  COPY_STRING_FIELD(refname);
1646
0
  COPY_NODE_FIELD(partitionClause);
1647
0
  COPY_NODE_FIELD(orderClause);
1648
0
  COPY_SCALAR_FIELD(frameOptions);
1649
0
  COPY_NODE_FIELD(startOffset);
1650
0
  COPY_NODE_FIELD(endOffset);
1651
0
  COPY_SCALAR_FIELD(startInRangeFunc);
1652
0
  COPY_SCALAR_FIELD(endInRangeFunc);
1653
0
  COPY_SCALAR_FIELD(inRangeColl);
1654
0
  COPY_SCALAR_FIELD(inRangeAsc);
1655
0
  COPY_SCALAR_FIELD(inRangeNullsFirst);
1656
0
  COPY_SCALAR_FIELD(winref);
1657
0
  COPY_SCALAR_FIELD(copiedOrder);
1658
1659
0
  return newnode;
1660
0
}
1661
1662
static RowMarkClause *
1663
_copyRowMarkClause(const RowMarkClause *from)
1664
0
{
1665
0
  RowMarkClause *newnode = makeNode(RowMarkClause);
1666
1667
0
  COPY_SCALAR_FIELD(rti);
1668
0
  COPY_SCALAR_FIELD(strength);
1669
0
  COPY_SCALAR_FIELD(waitPolicy);
1670
0
  COPY_SCALAR_FIELD(pushedDown);
1671
1672
0
  return newnode;
1673
0
}
1674
1675
static WithClause *
1676
_copyWithClause(const WithClause *from)
1677
0
{
1678
0
  WithClause *newnode = makeNode(WithClause);
1679
1680
0
  COPY_NODE_FIELD(ctes);
1681
0
  COPY_SCALAR_FIELD(recursive);
1682
0
  COPY_LOCATION_FIELD(location);
1683
1684
0
  return newnode;
1685
0
}
1686
1687
static InferClause *
1688
_copyInferClause(const InferClause *from)
1689
0
{
1690
0
  InferClause *newnode = makeNode(InferClause);
1691
1692
0
  COPY_NODE_FIELD(indexElems);
1693
0
  COPY_NODE_FIELD(whereClause);
1694
0
  COPY_STRING_FIELD(conname);
1695
0
  COPY_LOCATION_FIELD(location);
1696
1697
0
  return newnode;
1698
0
}
1699
1700
static OnConflictClause *
1701
_copyOnConflictClause(const OnConflictClause *from)
1702
0
{
1703
0
  OnConflictClause *newnode = makeNode(OnConflictClause);
1704
1705
0
  COPY_SCALAR_FIELD(action);
1706
0
  COPY_NODE_FIELD(infer);
1707
0
  COPY_SCALAR_FIELD(lockStrength);
1708
0
  COPY_NODE_FIELD(targetList);
1709
0
  COPY_NODE_FIELD(whereClause);
1710
0
  COPY_LOCATION_FIELD(location);
1711
1712
0
  return newnode;
1713
0
}
1714
1715
static CTESearchClause *
1716
_copyCTESearchClause(const CTESearchClause *from)
1717
0
{
1718
0
  CTESearchClause *newnode = makeNode(CTESearchClause);
1719
1720
0
  COPY_NODE_FIELD(search_col_list);
1721
0
  COPY_SCALAR_FIELD(search_breadth_first);
1722
0
  COPY_STRING_FIELD(search_seq_column);
1723
0
  COPY_LOCATION_FIELD(location);
1724
1725
0
  return newnode;
1726
0
}
1727
1728
static CTECycleClause *
1729
_copyCTECycleClause(const CTECycleClause *from)
1730
0
{
1731
0
  CTECycleClause *newnode = makeNode(CTECycleClause);
1732
1733
0
  COPY_NODE_FIELD(cycle_col_list);
1734
0
  COPY_STRING_FIELD(cycle_mark_column);
1735
0
  COPY_NODE_FIELD(cycle_mark_value);
1736
0
  COPY_NODE_FIELD(cycle_mark_default);
1737
0
  COPY_STRING_FIELD(cycle_path_column);
1738
0
  COPY_LOCATION_FIELD(location);
1739
0
  COPY_SCALAR_FIELD(cycle_mark_type);
1740
0
  COPY_SCALAR_FIELD(cycle_mark_typmod);
1741
0
  COPY_SCALAR_FIELD(cycle_mark_collation);
1742
0
  COPY_SCALAR_FIELD(cycle_mark_neop);
1743
1744
0
  return newnode;
1745
0
}
1746
1747
static CommonTableExpr *
1748
_copyCommonTableExpr(const CommonTableExpr *from)
1749
0
{
1750
0
  CommonTableExpr *newnode = makeNode(CommonTableExpr);
1751
1752
0
  COPY_STRING_FIELD(ctename);
1753
0
  COPY_NODE_FIELD(aliascolnames);
1754
0
  COPY_SCALAR_FIELD(ctematerialized);
1755
0
  COPY_NODE_FIELD(ctequery);
1756
0
  COPY_NODE_FIELD(search_clause);
1757
0
  COPY_NODE_FIELD(cycle_clause);
1758
0
  COPY_LOCATION_FIELD(location);
1759
0
  COPY_SCALAR_FIELD(cterecursive);
1760
0
  COPY_SCALAR_FIELD(cterefcount);
1761
0
  COPY_NODE_FIELD(ctecolnames);
1762
0
  COPY_NODE_FIELD(ctecoltypes);
1763
0
  COPY_NODE_FIELD(ctecoltypmods);
1764
0
  COPY_NODE_FIELD(ctecolcollations);
1765
1766
0
  return newnode;
1767
0
}
1768
1769
static MergeWhenClause *
1770
_copyMergeWhenClause(const MergeWhenClause *from)
1771
0
{
1772
0
  MergeWhenClause *newnode = makeNode(MergeWhenClause);
1773
1774
0
  COPY_SCALAR_FIELD(matchKind);
1775
0
  COPY_SCALAR_FIELD(commandType);
1776
0
  COPY_SCALAR_FIELD(override);
1777
0
  COPY_NODE_FIELD(condition);
1778
0
  COPY_NODE_FIELD(targetList);
1779
0
  COPY_NODE_FIELD(values);
1780
1781
0
  return newnode;
1782
0
}
1783
1784
static ReturningOption *
1785
_copyReturningOption(const ReturningOption *from)
1786
0
{
1787
0
  ReturningOption *newnode = makeNode(ReturningOption);
1788
1789
0
  COPY_SCALAR_FIELD(option);
1790
0
  COPY_STRING_FIELD(value);
1791
0
  COPY_LOCATION_FIELD(location);
1792
1793
0
  return newnode;
1794
0
}
1795
1796
static ReturningClause *
1797
_copyReturningClause(const ReturningClause *from)
1798
0
{
1799
0
  ReturningClause *newnode = makeNode(ReturningClause);
1800
1801
0
  COPY_NODE_FIELD(options);
1802
0
  COPY_NODE_FIELD(exprs);
1803
1804
0
  return newnode;
1805
0
}
1806
1807
static TriggerTransition *
1808
_copyTriggerTransition(const TriggerTransition *from)
1809
0
{
1810
0
  TriggerTransition *newnode = makeNode(TriggerTransition);
1811
1812
0
  COPY_STRING_FIELD(name);
1813
0
  COPY_SCALAR_FIELD(isNew);
1814
0
  COPY_SCALAR_FIELD(isTable);
1815
1816
0
  return newnode;
1817
0
}
1818
1819
static JsonOutput *
1820
_copyJsonOutput(const JsonOutput *from)
1821
0
{
1822
0
  JsonOutput *newnode = makeNode(JsonOutput);
1823
1824
0
  COPY_NODE_FIELD(typeName);
1825
0
  COPY_NODE_FIELD(returning);
1826
1827
0
  return newnode;
1828
0
}
1829
1830
static JsonArgument *
1831
_copyJsonArgument(const JsonArgument *from)
1832
0
{
1833
0
  JsonArgument *newnode = makeNode(JsonArgument);
1834
1835
0
  COPY_NODE_FIELD(val);
1836
0
  COPY_STRING_FIELD(name);
1837
1838
0
  return newnode;
1839
0
}
1840
1841
static JsonFuncExpr *
1842
_copyJsonFuncExpr(const JsonFuncExpr *from)
1843
0
{
1844
0
  JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
1845
1846
0
  COPY_SCALAR_FIELD(op);
1847
0
  COPY_STRING_FIELD(column_name);
1848
0
  COPY_NODE_FIELD(context_item);
1849
0
  COPY_NODE_FIELD(pathspec);
1850
0
  COPY_NODE_FIELD(passing);
1851
0
  COPY_NODE_FIELD(output);
1852
0
  COPY_NODE_FIELD(on_empty);
1853
0
  COPY_NODE_FIELD(on_error);
1854
0
  COPY_SCALAR_FIELD(wrapper);
1855
0
  COPY_SCALAR_FIELD(quotes);
1856
0
  COPY_LOCATION_FIELD(location);
1857
1858
0
  return newnode;
1859
0
}
1860
1861
static JsonTablePathSpec *
1862
_copyJsonTablePathSpec(const JsonTablePathSpec *from)
1863
0
{
1864
0
  JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
1865
1866
0
  COPY_NODE_FIELD(string);
1867
0
  COPY_STRING_FIELD(name);
1868
0
  COPY_LOCATION_FIELD(name_location);
1869
0
  COPY_LOCATION_FIELD(location);
1870
1871
0
  return newnode;
1872
0
}
1873
1874
static JsonTablePlanSpec *
1875
_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
1876
0
{
1877
0
  JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
1878
1879
0
  COPY_SCALAR_FIELD(plan_type);
1880
0
  COPY_SCALAR_FIELD(join_type);
1881
0
  COPY_STRING_FIELD(pathname);
1882
0
  COPY_NODE_FIELD(plan1);
1883
0
  COPY_NODE_FIELD(plan2);
1884
0
  COPY_LOCATION_FIELD(location);
1885
1886
0
  return newnode;
1887
0
}
1888
1889
static JsonTable *
1890
_copyJsonTable(const JsonTable *from)
1891
0
{
1892
0
  JsonTable *newnode = makeNode(JsonTable);
1893
1894
0
  COPY_NODE_FIELD(context_item);
1895
0
  COPY_NODE_FIELD(pathspec);
1896
0
  COPY_NODE_FIELD(passing);
1897
0
  COPY_NODE_FIELD(columns);
1898
0
  COPY_NODE_FIELD(planspec);
1899
0
  COPY_NODE_FIELD(on_error);
1900
0
  COPY_NODE_FIELD(alias);
1901
0
  COPY_SCALAR_FIELD(lateral);
1902
0
  COPY_LOCATION_FIELD(location);
1903
1904
0
  return newnode;
1905
0
}
1906
1907
static JsonTableColumn *
1908
_copyJsonTableColumn(const JsonTableColumn *from)
1909
0
{
1910
0
  JsonTableColumn *newnode = makeNode(JsonTableColumn);
1911
1912
0
  COPY_SCALAR_FIELD(coltype);
1913
0
  COPY_STRING_FIELD(name);
1914
0
  COPY_NODE_FIELD(typeName);
1915
0
  COPY_NODE_FIELD(pathspec);
1916
0
  COPY_NODE_FIELD(format);
1917
0
  COPY_SCALAR_FIELD(wrapper);
1918
0
  COPY_SCALAR_FIELD(quotes);
1919
0
  COPY_NODE_FIELD(columns);
1920
0
  COPY_NODE_FIELD(on_empty);
1921
0
  COPY_NODE_FIELD(on_error);
1922
0
  COPY_LOCATION_FIELD(location);
1923
1924
0
  return newnode;
1925
0
}
1926
1927
static JsonKeyValue *
1928
_copyJsonKeyValue(const JsonKeyValue *from)
1929
0
{
1930
0
  JsonKeyValue *newnode = makeNode(JsonKeyValue);
1931
1932
0
  COPY_NODE_FIELD(key);
1933
0
  COPY_NODE_FIELD(value);
1934
1935
0
  return newnode;
1936
0
}
1937
1938
static JsonParseExpr *
1939
_copyJsonParseExpr(const JsonParseExpr *from)
1940
0
{
1941
0
  JsonParseExpr *newnode = makeNode(JsonParseExpr);
1942
1943
0
  COPY_NODE_FIELD(expr);
1944
0
  COPY_NODE_FIELD(output);
1945
0
  COPY_SCALAR_FIELD(unique_keys);
1946
0
  COPY_LOCATION_FIELD(location);
1947
1948
0
  return newnode;
1949
0
}
1950
1951
static JsonScalarExpr *
1952
_copyJsonScalarExpr(const JsonScalarExpr *from)
1953
0
{
1954
0
  JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
1955
1956
0
  COPY_NODE_FIELD(expr);
1957
0
  COPY_NODE_FIELD(output);
1958
0
  COPY_LOCATION_FIELD(location);
1959
1960
0
  return newnode;
1961
0
}
1962
1963
static JsonSerializeExpr *
1964
_copyJsonSerializeExpr(const JsonSerializeExpr *from)
1965
0
{
1966
0
  JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
1967
1968
0
  COPY_NODE_FIELD(expr);
1969
0
  COPY_NODE_FIELD(output);
1970
0
  COPY_LOCATION_FIELD(location);
1971
1972
0
  return newnode;
1973
0
}
1974
1975
static JsonObjectConstructor *
1976
_copyJsonObjectConstructor(const JsonObjectConstructor *from)
1977
0
{
1978
0
  JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
1979
1980
0
  COPY_NODE_FIELD(exprs);
1981
0
  COPY_NODE_FIELD(output);
1982
0
  COPY_SCALAR_FIELD(absent_on_null);
1983
0
  COPY_SCALAR_FIELD(unique);
1984
0
  COPY_LOCATION_FIELD(location);
1985
1986
0
  return newnode;
1987
0
}
1988
1989
static JsonArrayConstructor *
1990
_copyJsonArrayConstructor(const JsonArrayConstructor *from)
1991
0
{
1992
0
  JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
1993
1994
0
  COPY_NODE_FIELD(exprs);
1995
0
  COPY_NODE_FIELD(output);
1996
0
  COPY_SCALAR_FIELD(absent_on_null);
1997
0
  COPY_LOCATION_FIELD(location);
1998
1999
0
  return newnode;
2000
0
}
2001
2002
static JsonArrayQueryConstructor *
2003
_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
2004
0
{
2005
0
  JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
2006
2007
0
  COPY_NODE_FIELD(query);
2008
0
  COPY_NODE_FIELD(output);
2009
0
  COPY_NODE_FIELD(format);
2010
0
  COPY_SCALAR_FIELD(absent_on_null);
2011
0
  COPY_LOCATION_FIELD(location);
2012
2013
0
  return newnode;
2014
0
}
2015
2016
static JsonAggConstructor *
2017
_copyJsonAggConstructor(const JsonAggConstructor *from)
2018
0
{
2019
0
  JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
2020
2021
0
  COPY_NODE_FIELD(output);
2022
0
  COPY_NODE_FIELD(agg_filter);
2023
0
  COPY_NODE_FIELD(agg_order);
2024
0
  COPY_NODE_FIELD(over);
2025
0
  COPY_LOCATION_FIELD(location);
2026
2027
0
  return newnode;
2028
0
}
2029
2030
static JsonObjectAgg *
2031
_copyJsonObjectAgg(const JsonObjectAgg *from)
2032
0
{
2033
0
  JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
2034
2035
0
  COPY_NODE_FIELD(constructor);
2036
0
  COPY_NODE_FIELD(arg);
2037
0
  COPY_SCALAR_FIELD(absent_on_null);
2038
0
  COPY_SCALAR_FIELD(unique);
2039
2040
0
  return newnode;
2041
0
}
2042
2043
static JsonArrayAgg *
2044
_copyJsonArrayAgg(const JsonArrayAgg *from)
2045
0
{
2046
0
  JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
2047
2048
0
  COPY_NODE_FIELD(constructor);
2049
0
  COPY_NODE_FIELD(arg);
2050
0
  COPY_SCALAR_FIELD(absent_on_null);
2051
2052
0
  return newnode;
2053
0
}
2054
2055
static RawStmt *
2056
_copyRawStmt(const RawStmt *from)
2057
0
{
2058
0
  RawStmt *newnode = makeNode(RawStmt);
2059
2060
0
  COPY_NODE_FIELD(stmt);
2061
0
  COPY_LOCATION_FIELD(stmt_location);
2062
0
  COPY_LOCATION_FIELD(stmt_len);
2063
2064
0
  return newnode;
2065
0
}
2066
2067
static InsertStmt *
2068
_copyInsertStmt(const InsertStmt *from)
2069
0
{
2070
0
  InsertStmt *newnode = makeNode(InsertStmt);
2071
2072
0
  COPY_NODE_FIELD(relation);
2073
0
  COPY_NODE_FIELD(cols);
2074
0
  COPY_NODE_FIELD(selectStmt);
2075
0
  COPY_NODE_FIELD(onConflictClause);
2076
0
  COPY_NODE_FIELD(returningClause);
2077
0
  COPY_NODE_FIELD(withClause);
2078
0
  COPY_SCALAR_FIELD(override);
2079
2080
0
  return newnode;
2081
0
}
2082
2083
static DeleteStmt *
2084
_copyDeleteStmt(const DeleteStmt *from)
2085
0
{
2086
0
  DeleteStmt *newnode = makeNode(DeleteStmt);
2087
2088
0
  COPY_NODE_FIELD(relation);
2089
0
  COPY_NODE_FIELD(usingClause);
2090
0
  COPY_NODE_FIELD(whereClause);
2091
0
  COPY_NODE_FIELD(returningClause);
2092
0
  COPY_NODE_FIELD(withClause);
2093
2094
0
  return newnode;
2095
0
}
2096
2097
static UpdateStmt *
2098
_copyUpdateStmt(const UpdateStmt *from)
2099
0
{
2100
0
  UpdateStmt *newnode = makeNode(UpdateStmt);
2101
2102
0
  COPY_NODE_FIELD(relation);
2103
0
  COPY_NODE_FIELD(targetList);
2104
0
  COPY_NODE_FIELD(whereClause);
2105
0
  COPY_NODE_FIELD(fromClause);
2106
0
  COPY_NODE_FIELD(returningClause);
2107
0
  COPY_NODE_FIELD(withClause);
2108
2109
0
  return newnode;
2110
0
}
2111
2112
static MergeStmt *
2113
_copyMergeStmt(const MergeStmt *from)
2114
0
{
2115
0
  MergeStmt *newnode = makeNode(MergeStmt);
2116
2117
0
  COPY_NODE_FIELD(relation);
2118
0
  COPY_NODE_FIELD(sourceRelation);
2119
0
  COPY_NODE_FIELD(joinCondition);
2120
0
  COPY_NODE_FIELD(mergeWhenClauses);
2121
0
  COPY_NODE_FIELD(returningClause);
2122
0
  COPY_NODE_FIELD(withClause);
2123
2124
0
  return newnode;
2125
0
}
2126
2127
static SelectStmt *
2128
_copySelectStmt(const SelectStmt *from)
2129
0
{
2130
0
  SelectStmt *newnode = makeNode(SelectStmt);
2131
2132
0
  COPY_NODE_FIELD(distinctClause);
2133
0
  COPY_NODE_FIELD(intoClause);
2134
0
  COPY_NODE_FIELD(targetList);
2135
0
  COPY_NODE_FIELD(fromClause);
2136
0
  COPY_NODE_FIELD(whereClause);
2137
0
  COPY_NODE_FIELD(groupClause);
2138
0
  COPY_SCALAR_FIELD(groupDistinct);
2139
0
  COPY_NODE_FIELD(havingClause);
2140
0
  COPY_NODE_FIELD(windowClause);
2141
0
  COPY_NODE_FIELD(valuesLists);
2142
0
  COPY_NODE_FIELD(sortClause);
2143
0
  COPY_NODE_FIELD(limitOffset);
2144
0
  COPY_NODE_FIELD(limitCount);
2145
0
  COPY_SCALAR_FIELD(limitOption);
2146
0
  COPY_NODE_FIELD(lockingClause);
2147
0
  COPY_NODE_FIELD(withClause);
2148
0
  COPY_SCALAR_FIELD(op);
2149
0
  COPY_SCALAR_FIELD(all);
2150
0
  COPY_NODE_FIELD(larg);
2151
0
  COPY_NODE_FIELD(rarg);
2152
2153
0
  return newnode;
2154
0
}
2155
2156
static SetOperationStmt *
2157
_copySetOperationStmt(const SetOperationStmt *from)
2158
0
{
2159
0
  SetOperationStmt *newnode = makeNode(SetOperationStmt);
2160
2161
0
  COPY_SCALAR_FIELD(op);
2162
0
  COPY_SCALAR_FIELD(all);
2163
0
  COPY_NODE_FIELD(larg);
2164
0
  COPY_NODE_FIELD(rarg);
2165
0
  COPY_NODE_FIELD(colTypes);
2166
0
  COPY_NODE_FIELD(colTypmods);
2167
0
  COPY_NODE_FIELD(colCollations);
2168
0
  COPY_NODE_FIELD(groupClauses);
2169
2170
0
  return newnode;
2171
0
}
2172
2173
static ReturnStmt *
2174
_copyReturnStmt(const ReturnStmt *from)
2175
0
{
2176
0
  ReturnStmt *newnode = makeNode(ReturnStmt);
2177
2178
0
  COPY_NODE_FIELD(returnval);
2179
2180
0
  return newnode;
2181
0
}
2182
2183
static PLAssignStmt *
2184
_copyPLAssignStmt(const PLAssignStmt *from)
2185
0
{
2186
0
  PLAssignStmt *newnode = makeNode(PLAssignStmt);
2187
2188
0
  COPY_STRING_FIELD(name);
2189
0
  COPY_NODE_FIELD(indirection);
2190
0
  COPY_SCALAR_FIELD(nnames);
2191
0
  COPY_NODE_FIELD(val);
2192
0
  COPY_LOCATION_FIELD(location);
2193
2194
0
  return newnode;
2195
0
}
2196
2197
static CreateSchemaStmt *
2198
_copyCreateSchemaStmt(const CreateSchemaStmt *from)
2199
0
{
2200
0
  CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
2201
2202
0
  COPY_STRING_FIELD(schemaname);
2203
0
  COPY_NODE_FIELD(authrole);
2204
0
  COPY_NODE_FIELD(schemaElts);
2205
0
  COPY_SCALAR_FIELD(if_not_exists);
2206
2207
0
  return newnode;
2208
0
}
2209
2210
static AlterTableStmt *
2211
_copyAlterTableStmt(const AlterTableStmt *from)
2212
0
{
2213
0
  AlterTableStmt *newnode = makeNode(AlterTableStmt);
2214
2215
0
  COPY_NODE_FIELD(relation);
2216
0
  COPY_NODE_FIELD(cmds);
2217
0
  COPY_SCALAR_FIELD(objtype);
2218
0
  COPY_SCALAR_FIELD(missing_ok);
2219
2220
0
  return newnode;
2221
0
}
2222
2223
static AlterTableCmd *
2224
_copyAlterTableCmd(const AlterTableCmd *from)
2225
0
{
2226
0
  AlterTableCmd *newnode = makeNode(AlterTableCmd);
2227
2228
0
  COPY_SCALAR_FIELD(subtype);
2229
0
  COPY_STRING_FIELD(name);
2230
0
  COPY_SCALAR_FIELD(num);
2231
0
  COPY_NODE_FIELD(newowner);
2232
0
  COPY_NODE_FIELD(def);
2233
0
  COPY_SCALAR_FIELD(behavior);
2234
0
  COPY_SCALAR_FIELD(missing_ok);
2235
0
  COPY_SCALAR_FIELD(recurse);
2236
2237
0
  return newnode;
2238
0
}
2239
2240
static ATAlterConstraint *
2241
_copyATAlterConstraint(const ATAlterConstraint *from)
2242
0
{
2243
0
  ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
2244
2245
0
  COPY_STRING_FIELD(conname);
2246
0
  COPY_SCALAR_FIELD(alterEnforceability);
2247
0
  COPY_SCALAR_FIELD(is_enforced);
2248
0
  COPY_SCALAR_FIELD(alterDeferrability);
2249
0
  COPY_SCALAR_FIELD(deferrable);
2250
0
  COPY_SCALAR_FIELD(initdeferred);
2251
0
  COPY_SCALAR_FIELD(alterInheritability);
2252
0
  COPY_SCALAR_FIELD(noinherit);
2253
2254
0
  return newnode;
2255
0
}
2256
2257
static ReplicaIdentityStmt *
2258
_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
2259
0
{
2260
0
  ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
2261
2262
0
  COPY_SCALAR_FIELD(identity_type);
2263
0
  COPY_STRING_FIELD(name);
2264
2265
0
  return newnode;
2266
0
}
2267
2268
static AlterCollationStmt *
2269
_copyAlterCollationStmt(const AlterCollationStmt *from)
2270
0
{
2271
0
  AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
2272
2273
0
  COPY_NODE_FIELD(collname);
2274
2275
0
  return newnode;
2276
0
}
2277
2278
static AlterDomainStmt *
2279
_copyAlterDomainStmt(const AlterDomainStmt *from)
2280
0
{
2281
0
  AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
2282
2283
0
  COPY_SCALAR_FIELD(subtype);
2284
0
  COPY_NODE_FIELD(typeName);
2285
0
  COPY_STRING_FIELD(name);
2286
0
  COPY_NODE_FIELD(def);
2287
0
  COPY_SCALAR_FIELD(behavior);
2288
0
  COPY_SCALAR_FIELD(missing_ok);
2289
2290
0
  return newnode;
2291
0
}
2292
2293
static GrantStmt *
2294
_copyGrantStmt(const GrantStmt *from)
2295
0
{
2296
0
  GrantStmt *newnode = makeNode(GrantStmt);
2297
2298
0
  COPY_SCALAR_FIELD(is_grant);
2299
0
  COPY_SCALAR_FIELD(targtype);
2300
0
  COPY_SCALAR_FIELD(objtype);
2301
0
  COPY_NODE_FIELD(objects);
2302
0
  COPY_NODE_FIELD(privileges);
2303
0
  COPY_NODE_FIELD(grantees);
2304
0
  COPY_SCALAR_FIELD(grant_option);
2305
0
  COPY_NODE_FIELD(grantor);
2306
0
  COPY_SCALAR_FIELD(behavior);
2307
2308
0
  return newnode;
2309
0
}
2310
2311
static ObjectWithArgs *
2312
_copyObjectWithArgs(const ObjectWithArgs *from)
2313
0
{
2314
0
  ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
2315
2316
0
  COPY_NODE_FIELD(objname);
2317
0
  COPY_NODE_FIELD(objargs);
2318
0
  COPY_NODE_FIELD(objfuncargs);
2319
0
  COPY_SCALAR_FIELD(args_unspecified);
2320
2321
0
  return newnode;
2322
0
}
2323
2324
static AccessPriv *
2325
_copyAccessPriv(const AccessPriv *from)
2326
0
{
2327
0
  AccessPriv *newnode = makeNode(AccessPriv);
2328
2329
0
  COPY_STRING_FIELD(priv_name);
2330
0
  COPY_NODE_FIELD(cols);
2331
2332
0
  return newnode;
2333
0
}
2334
2335
static GrantRoleStmt *
2336
_copyGrantRoleStmt(const GrantRoleStmt *from)
2337
0
{
2338
0
  GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
2339
2340
0
  COPY_NODE_FIELD(granted_roles);
2341
0
  COPY_NODE_FIELD(grantee_roles);
2342
0
  COPY_SCALAR_FIELD(is_grant);
2343
0
  COPY_NODE_FIELD(opt);
2344
0
  COPY_NODE_FIELD(grantor);
2345
0
  COPY_SCALAR_FIELD(behavior);
2346
2347
0
  return newnode;
2348
0
}
2349
2350
static AlterDefaultPrivilegesStmt *
2351
_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
2352
0
{
2353
0
  AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
2354
2355
0
  COPY_NODE_FIELD(options);
2356
0
  COPY_NODE_FIELD(action);
2357
2358
0
  return newnode;
2359
0
}
2360
2361
static CopyStmt *
2362
_copyCopyStmt(const CopyStmt *from)
2363
0
{
2364
0
  CopyStmt *newnode = makeNode(CopyStmt);
2365
2366
0
  COPY_NODE_FIELD(relation);
2367
0
  COPY_NODE_FIELD(query);
2368
0
  COPY_NODE_FIELD(attlist);
2369
0
  COPY_SCALAR_FIELD(is_from);
2370
0
  COPY_SCALAR_FIELD(is_program);
2371
0
  COPY_STRING_FIELD(filename);
2372
0
  COPY_NODE_FIELD(options);
2373
0
  COPY_NODE_FIELD(whereClause);
2374
2375
0
  return newnode;
2376
0
}
2377
2378
static VariableSetStmt *
2379
_copyVariableSetStmt(const VariableSetStmt *from)
2380
0
{
2381
0
  VariableSetStmt *newnode = makeNode(VariableSetStmt);
2382
2383
0
  COPY_SCALAR_FIELD(kind);
2384
0
  COPY_STRING_FIELD(name);
2385
0
  COPY_NODE_FIELD(args);
2386
0
  COPY_SCALAR_FIELD(jumble_args);
2387
0
  COPY_SCALAR_FIELD(is_local);
2388
0
  COPY_LOCATION_FIELD(location);
2389
2390
0
  return newnode;
2391
0
}
2392
2393
static VariableShowStmt *
2394
_copyVariableShowStmt(const VariableShowStmt *from)
2395
0
{
2396
0
  VariableShowStmt *newnode = makeNode(VariableShowStmt);
2397
2398
0
  COPY_STRING_FIELD(name);
2399
2400
0
  return newnode;
2401
0
}
2402
2403
static CreateStmt *
2404
_copyCreateStmt(const CreateStmt *from)
2405
0
{
2406
0
  CreateStmt *newnode = makeNode(CreateStmt);
2407
2408
0
  COPY_NODE_FIELD(relation);
2409
0
  COPY_NODE_FIELD(tableElts);
2410
0
  COPY_NODE_FIELD(inhRelations);
2411
0
  COPY_NODE_FIELD(partbound);
2412
0
  COPY_NODE_FIELD(partspec);
2413
0
  COPY_NODE_FIELD(ofTypename);
2414
0
  COPY_NODE_FIELD(constraints);
2415
0
  COPY_NODE_FIELD(nnconstraints);
2416
0
  COPY_NODE_FIELD(options);
2417
0
  COPY_SCALAR_FIELD(oncommit);
2418
0
  COPY_STRING_FIELD(tablespacename);
2419
0
  COPY_STRING_FIELD(accessMethod);
2420
0
  COPY_SCALAR_FIELD(if_not_exists);
2421
2422
0
  return newnode;
2423
0
}
2424
2425
static Constraint *
2426
_copyConstraint(const Constraint *from)
2427
0
{
2428
0
  Constraint *newnode = makeNode(Constraint);
2429
2430
0
  COPY_SCALAR_FIELD(contype);
2431
0
  COPY_STRING_FIELD(conname);
2432
0
  COPY_SCALAR_FIELD(deferrable);
2433
0
  COPY_SCALAR_FIELD(initdeferred);
2434
0
  COPY_SCALAR_FIELD(is_enforced);
2435
0
  COPY_SCALAR_FIELD(skip_validation);
2436
0
  COPY_SCALAR_FIELD(initially_valid);
2437
0
  COPY_SCALAR_FIELD(is_no_inherit);
2438
0
  COPY_NODE_FIELD(raw_expr);
2439
0
  COPY_STRING_FIELD(cooked_expr);
2440
0
  COPY_SCALAR_FIELD(generated_when);
2441
0
  COPY_SCALAR_FIELD(generated_kind);
2442
0
  COPY_SCALAR_FIELD(nulls_not_distinct);
2443
0
  COPY_NODE_FIELD(keys);
2444
0
  COPY_SCALAR_FIELD(without_overlaps);
2445
0
  COPY_NODE_FIELD(including);
2446
0
  COPY_NODE_FIELD(exclusions);
2447
0
  COPY_NODE_FIELD(options);
2448
0
  COPY_STRING_FIELD(indexname);
2449
0
  COPY_STRING_FIELD(indexspace);
2450
0
  COPY_SCALAR_FIELD(reset_default_tblspc);
2451
0
  COPY_STRING_FIELD(access_method);
2452
0
  COPY_NODE_FIELD(where_clause);
2453
0
  COPY_NODE_FIELD(pktable);
2454
0
  COPY_NODE_FIELD(fk_attrs);
2455
0
  COPY_NODE_FIELD(pk_attrs);
2456
0
  COPY_SCALAR_FIELD(fk_with_period);
2457
0
  COPY_SCALAR_FIELD(pk_with_period);
2458
0
  COPY_SCALAR_FIELD(fk_matchtype);
2459
0
  COPY_SCALAR_FIELD(fk_upd_action);
2460
0
  COPY_SCALAR_FIELD(fk_del_action);
2461
0
  COPY_NODE_FIELD(fk_del_set_cols);
2462
0
  COPY_NODE_FIELD(old_conpfeqop);
2463
0
  COPY_SCALAR_FIELD(old_pktable_oid);
2464
0
  COPY_LOCATION_FIELD(location);
2465
2466
0
  return newnode;
2467
0
}
2468
2469
static CreateTableSpaceStmt *
2470
_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
2471
0
{
2472
0
  CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
2473
2474
0
  COPY_STRING_FIELD(tablespacename);
2475
0
  COPY_NODE_FIELD(owner);
2476
0
  COPY_STRING_FIELD(location);
2477
0
  COPY_NODE_FIELD(options);
2478
2479
0
  return newnode;
2480
0
}
2481
2482
static DropTableSpaceStmt *
2483
_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
2484
0
{
2485
0
  DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
2486
2487
0
  COPY_STRING_FIELD(tablespacename);
2488
0
  COPY_SCALAR_FIELD(missing_ok);
2489
2490
0
  return newnode;
2491
0
}
2492
2493
static AlterTableSpaceOptionsStmt *
2494
_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
2495
0
{
2496
0
  AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
2497
2498
0
  COPY_STRING_FIELD(tablespacename);
2499
0
  COPY_NODE_FIELD(options);
2500
0
  COPY_SCALAR_FIELD(isReset);
2501
2502
0
  return newnode;
2503
0
}
2504
2505
static AlterTableMoveAllStmt *
2506
_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
2507
0
{
2508
0
  AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
2509
2510
0
  COPY_STRING_FIELD(orig_tablespacename);
2511
0
  COPY_SCALAR_FIELD(objtype);
2512
0
  COPY_NODE_FIELD(roles);
2513
0
  COPY_STRING_FIELD(new_tablespacename);
2514
0
  COPY_SCALAR_FIELD(nowait);
2515
2516
0
  return newnode;
2517
0
}
2518
2519
static CreateExtensionStmt *
2520
_copyCreateExtensionStmt(const CreateExtensionStmt *from)
2521
0
{
2522
0
  CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
2523
2524
0
  COPY_STRING_FIELD(extname);
2525
0
  COPY_SCALAR_FIELD(if_not_exists);
2526
0
  COPY_NODE_FIELD(options);
2527
2528
0
  return newnode;
2529
0
}
2530
2531
static AlterExtensionStmt *
2532
_copyAlterExtensionStmt(const AlterExtensionStmt *from)
2533
0
{
2534
0
  AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
2535
2536
0
  COPY_STRING_FIELD(extname);
2537
0
  COPY_NODE_FIELD(options);
2538
2539
0
  return newnode;
2540
0
}
2541
2542
static AlterExtensionContentsStmt *
2543
_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
2544
0
{
2545
0
  AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
2546
2547
0
  COPY_STRING_FIELD(extname);
2548
0
  COPY_SCALAR_FIELD(action);
2549
0
  COPY_SCALAR_FIELD(objtype);
2550
0
  COPY_NODE_FIELD(object);
2551
2552
0
  return newnode;
2553
0
}
2554
2555
static CreateFdwStmt *
2556
_copyCreateFdwStmt(const CreateFdwStmt *from)
2557
0
{
2558
0
  CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
2559
2560
0
  COPY_STRING_FIELD(fdwname);
2561
0
  COPY_NODE_FIELD(func_options);
2562
0
  COPY_NODE_FIELD(options);
2563
2564
0
  return newnode;
2565
0
}
2566
2567
static AlterFdwStmt *
2568
_copyAlterFdwStmt(const AlterFdwStmt *from)
2569
0
{
2570
0
  AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
2571
2572
0
  COPY_STRING_FIELD(fdwname);
2573
0
  COPY_NODE_FIELD(func_options);
2574
0
  COPY_NODE_FIELD(options);
2575
2576
0
  return newnode;
2577
0
}
2578
2579
static CreateForeignServerStmt *
2580
_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
2581
0
{
2582
0
  CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
2583
2584
0
  COPY_STRING_FIELD(servername);
2585
0
  COPY_STRING_FIELD(servertype);
2586
0
  COPY_STRING_FIELD(version);
2587
0
  COPY_STRING_FIELD(fdwname);
2588
0
  COPY_SCALAR_FIELD(if_not_exists);
2589
0
  COPY_NODE_FIELD(options);
2590
2591
0
  return newnode;
2592
0
}
2593
2594
static AlterForeignServerStmt *
2595
_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
2596
0
{
2597
0
  AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
2598
2599
0
  COPY_STRING_FIELD(servername);
2600
0
  COPY_STRING_FIELD(version);
2601
0
  COPY_NODE_FIELD(options);
2602
0
  COPY_SCALAR_FIELD(has_version);
2603
2604
0
  return newnode;
2605
0
}
2606
2607
static CreateForeignTableStmt *
2608
_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
2609
0
{
2610
0
  CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
2611
2612
0
  COPY_NODE_FIELD(base.relation);
2613
0
  COPY_NODE_FIELD(base.tableElts);
2614
0
  COPY_NODE_FIELD(base.inhRelations);
2615
0
  COPY_NODE_FIELD(base.partbound);
2616
0
  COPY_NODE_FIELD(base.partspec);
2617
0
  COPY_NODE_FIELD(base.ofTypename);
2618
0
  COPY_NODE_FIELD(base.constraints);
2619
0
  COPY_NODE_FIELD(base.nnconstraints);
2620
0
  COPY_NODE_FIELD(base.options);
2621
0
  COPY_SCALAR_FIELD(base.oncommit);
2622
0
  COPY_STRING_FIELD(base.tablespacename);
2623
0
  COPY_STRING_FIELD(base.accessMethod);
2624
0
  COPY_SCALAR_FIELD(base.if_not_exists);
2625
0
  COPY_STRING_FIELD(servername);
2626
0
  COPY_NODE_FIELD(options);
2627
2628
0
  return newnode;
2629
0
}
2630
2631
static CreateUserMappingStmt *
2632
_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
2633
0
{
2634
0
  CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
2635
2636
0
  COPY_NODE_FIELD(user);
2637
0
  COPY_STRING_FIELD(servername);
2638
0
  COPY_SCALAR_FIELD(if_not_exists);
2639
0
  COPY_NODE_FIELD(options);
2640
2641
0
  return newnode;
2642
0
}
2643
2644
static AlterUserMappingStmt *
2645
_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
2646
0
{
2647
0
  AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
2648
2649
0
  COPY_NODE_FIELD(user);
2650
0
  COPY_STRING_FIELD(servername);
2651
0
  COPY_NODE_FIELD(options);
2652
2653
0
  return newnode;
2654
0
}
2655
2656
static DropUserMappingStmt *
2657
_copyDropUserMappingStmt(const DropUserMappingStmt *from)
2658
0
{
2659
0
  DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
2660
2661
0
  COPY_NODE_FIELD(user);
2662
0
  COPY_STRING_FIELD(servername);
2663
0
  COPY_SCALAR_FIELD(missing_ok);
2664
2665
0
  return newnode;
2666
0
}
2667
2668
static ImportForeignSchemaStmt *
2669
_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
2670
0
{
2671
0
  ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
2672
2673
0
  COPY_STRING_FIELD(server_name);
2674
0
  COPY_STRING_FIELD(remote_schema);
2675
0
  COPY_STRING_FIELD(local_schema);
2676
0
  COPY_SCALAR_FIELD(list_type);
2677
0
  COPY_NODE_FIELD(table_list);
2678
0
  COPY_NODE_FIELD(options);
2679
2680
0
  return newnode;
2681
0
}
2682
2683
static CreatePolicyStmt *
2684
_copyCreatePolicyStmt(const CreatePolicyStmt *from)
2685
0
{
2686
0
  CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
2687
2688
0
  COPY_STRING_FIELD(policy_name);
2689
0
  COPY_NODE_FIELD(table);
2690
0
  COPY_STRING_FIELD(cmd_name);
2691
0
  COPY_SCALAR_FIELD(permissive);
2692
0
  COPY_NODE_FIELD(roles);
2693
0
  COPY_NODE_FIELD(qual);
2694
0
  COPY_NODE_FIELD(with_check);
2695
2696
0
  return newnode;
2697
0
}
2698
2699
static AlterPolicyStmt *
2700
_copyAlterPolicyStmt(const AlterPolicyStmt *from)
2701
0
{
2702
0
  AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
2703
2704
0
  COPY_STRING_FIELD(policy_name);
2705
0
  COPY_NODE_FIELD(table);
2706
0
  COPY_NODE_FIELD(roles);
2707
0
  COPY_NODE_FIELD(qual);
2708
0
  COPY_NODE_FIELD(with_check);
2709
2710
0
  return newnode;
2711
0
}
2712
2713
static CreateAmStmt *
2714
_copyCreateAmStmt(const CreateAmStmt *from)
2715
0
{
2716
0
  CreateAmStmt *newnode = makeNode(CreateAmStmt);
2717
2718
0
  COPY_STRING_FIELD(amname);
2719
0
  COPY_NODE_FIELD(handler_name);
2720
0
  COPY_SCALAR_FIELD(amtype);
2721
2722
0
  return newnode;
2723
0
}
2724
2725
static CreateTrigStmt *
2726
_copyCreateTrigStmt(const CreateTrigStmt *from)
2727
0
{
2728
0
  CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
2729
2730
0
  COPY_SCALAR_FIELD(replace);
2731
0
  COPY_SCALAR_FIELD(isconstraint);
2732
0
  COPY_STRING_FIELD(trigname);
2733
0
  COPY_NODE_FIELD(relation);
2734
0
  COPY_NODE_FIELD(funcname);
2735
0
  COPY_NODE_FIELD(args);
2736
0
  COPY_SCALAR_FIELD(row);
2737
0
  COPY_SCALAR_FIELD(timing);
2738
0
  COPY_SCALAR_FIELD(events);
2739
0
  COPY_NODE_FIELD(columns);
2740
0
  COPY_NODE_FIELD(whenClause);
2741
0
  COPY_NODE_FIELD(transitionRels);
2742
0
  COPY_SCALAR_FIELD(deferrable);
2743
0
  COPY_SCALAR_FIELD(initdeferred);
2744
0
  COPY_NODE_FIELD(constrrel);
2745
2746
0
  return newnode;
2747
0
}
2748
2749
static CreateEventTrigStmt *
2750
_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
2751
0
{
2752
0
  CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
2753
2754
0
  COPY_STRING_FIELD(trigname);
2755
0
  COPY_STRING_FIELD(eventname);
2756
0
  COPY_NODE_FIELD(whenclause);
2757
0
  COPY_NODE_FIELD(funcname);
2758
2759
0
  return newnode;
2760
0
}
2761
2762
static AlterEventTrigStmt *
2763
_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
2764
0
{
2765
0
  AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
2766
2767
0
  COPY_STRING_FIELD(trigname);
2768
0
  COPY_SCALAR_FIELD(tgenabled);
2769
2770
0
  return newnode;
2771
0
}
2772
2773
static CreatePLangStmt *
2774
_copyCreatePLangStmt(const CreatePLangStmt *from)
2775
0
{
2776
0
  CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
2777
2778
0
  COPY_SCALAR_FIELD(replace);
2779
0
  COPY_STRING_FIELD(plname);
2780
0
  COPY_NODE_FIELD(plhandler);
2781
0
  COPY_NODE_FIELD(plinline);
2782
0
  COPY_NODE_FIELD(plvalidator);
2783
0
  COPY_SCALAR_FIELD(pltrusted);
2784
2785
0
  return newnode;
2786
0
}
2787
2788
static CreateRoleStmt *
2789
_copyCreateRoleStmt(const CreateRoleStmt *from)
2790
0
{
2791
0
  CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
2792
2793
0
  COPY_SCALAR_FIELD(stmt_type);
2794
0
  COPY_STRING_FIELD(role);
2795
0
  COPY_NODE_FIELD(options);
2796
2797
0
  return newnode;
2798
0
}
2799
2800
static AlterRoleStmt *
2801
_copyAlterRoleStmt(const AlterRoleStmt *from)
2802
0
{
2803
0
  AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
2804
2805
0
  COPY_NODE_FIELD(role);
2806
0
  COPY_NODE_FIELD(options);
2807
0
  COPY_SCALAR_FIELD(action);
2808
2809
0
  return newnode;
2810
0
}
2811
2812
static AlterRoleSetStmt *
2813
_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
2814
0
{
2815
0
  AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
2816
2817
0
  COPY_NODE_FIELD(role);
2818
0
  COPY_STRING_FIELD(database);
2819
0
  COPY_NODE_FIELD(setstmt);
2820
2821
0
  return newnode;
2822
0
}
2823
2824
static DropRoleStmt *
2825
_copyDropRoleStmt(const DropRoleStmt *from)
2826
0
{
2827
0
  DropRoleStmt *newnode = makeNode(DropRoleStmt);
2828
2829
0
  COPY_NODE_FIELD(roles);
2830
0
  COPY_SCALAR_FIELD(missing_ok);
2831
2832
0
  return newnode;
2833
0
}
2834
2835
static CreateSeqStmt *
2836
_copyCreateSeqStmt(const CreateSeqStmt *from)
2837
0
{
2838
0
  CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
2839
2840
0
  COPY_NODE_FIELD(sequence);
2841
0
  COPY_NODE_FIELD(options);
2842
0
  COPY_SCALAR_FIELD(ownerId);
2843
0
  COPY_SCALAR_FIELD(for_identity);
2844
0
  COPY_SCALAR_FIELD(if_not_exists);
2845
2846
0
  return newnode;
2847
0
}
2848
2849
static AlterSeqStmt *
2850
_copyAlterSeqStmt(const AlterSeqStmt *from)
2851
0
{
2852
0
  AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
2853
2854
0
  COPY_NODE_FIELD(sequence);
2855
0
  COPY_NODE_FIELD(options);
2856
0
  COPY_SCALAR_FIELD(for_identity);
2857
0
  COPY_SCALAR_FIELD(missing_ok);
2858
2859
0
  return newnode;
2860
0
}
2861
2862
static DefineStmt *
2863
_copyDefineStmt(const DefineStmt *from)
2864
0
{
2865
0
  DefineStmt *newnode = makeNode(DefineStmt);
2866
2867
0
  COPY_SCALAR_FIELD(kind);
2868
0
  COPY_SCALAR_FIELD(oldstyle);
2869
0
  COPY_NODE_FIELD(defnames);
2870
0
  COPY_NODE_FIELD(args);
2871
0
  COPY_NODE_FIELD(definition);
2872
0
  COPY_SCALAR_FIELD(if_not_exists);
2873
0
  COPY_SCALAR_FIELD(replace);
2874
2875
0
  return newnode;
2876
0
}
2877
2878
static CreateDomainStmt *
2879
_copyCreateDomainStmt(const CreateDomainStmt *from)
2880
0
{
2881
0
  CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
2882
2883
0
  COPY_NODE_FIELD(domainname);
2884
0
  COPY_NODE_FIELD(typeName);
2885
0
  COPY_NODE_FIELD(collClause);
2886
0
  COPY_NODE_FIELD(constraints);
2887
2888
0
  return newnode;
2889
0
}
2890
2891
static CreateOpClassStmt *
2892
_copyCreateOpClassStmt(const CreateOpClassStmt *from)
2893
0
{
2894
0
  CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
2895
2896
0
  COPY_NODE_FIELD(opclassname);
2897
0
  COPY_NODE_FIELD(opfamilyname);
2898
0
  COPY_STRING_FIELD(amname);
2899
0
  COPY_NODE_FIELD(datatype);
2900
0
  COPY_NODE_FIELD(items);
2901
0
  COPY_SCALAR_FIELD(isDefault);
2902
2903
0
  return newnode;
2904
0
}
2905
2906
static CreateOpClassItem *
2907
_copyCreateOpClassItem(const CreateOpClassItem *from)
2908
0
{
2909
0
  CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
2910
2911
0
  COPY_SCALAR_FIELD(itemtype);
2912
0
  COPY_NODE_FIELD(name);
2913
0
  COPY_SCALAR_FIELD(number);
2914
0
  COPY_NODE_FIELD(order_family);
2915
0
  COPY_NODE_FIELD(class_args);
2916
0
  COPY_NODE_FIELD(storedtype);
2917
2918
0
  return newnode;
2919
0
}
2920
2921
static CreateOpFamilyStmt *
2922
_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
2923
0
{
2924
0
  CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
2925
2926
0
  COPY_NODE_FIELD(opfamilyname);
2927
0
  COPY_STRING_FIELD(amname);
2928
2929
0
  return newnode;
2930
0
}
2931
2932
static AlterOpFamilyStmt *
2933
_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
2934
0
{
2935
0
  AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
2936
2937
0
  COPY_NODE_FIELD(opfamilyname);
2938
0
  COPY_STRING_FIELD(amname);
2939
0
  COPY_SCALAR_FIELD(isDrop);
2940
0
  COPY_NODE_FIELD(items);
2941
2942
0
  return newnode;
2943
0
}
2944
2945
static DropStmt *
2946
_copyDropStmt(const DropStmt *from)
2947
0
{
2948
0
  DropStmt *newnode = makeNode(DropStmt);
2949
2950
0
  COPY_NODE_FIELD(objects);
2951
0
  COPY_SCALAR_FIELD(removeType);
2952
0
  COPY_SCALAR_FIELD(behavior);
2953
0
  COPY_SCALAR_FIELD(missing_ok);
2954
0
  COPY_SCALAR_FIELD(concurrent);
2955
2956
0
  return newnode;
2957
0
}
2958
2959
static TruncateStmt *
2960
_copyTruncateStmt(const TruncateStmt *from)
2961
0
{
2962
0
  TruncateStmt *newnode = makeNode(TruncateStmt);
2963
2964
0
  COPY_NODE_FIELD(relations);
2965
0
  COPY_SCALAR_FIELD(restart_seqs);
2966
0
  COPY_SCALAR_FIELD(behavior);
2967
2968
0
  return newnode;
2969
0
}
2970
2971
static CommentStmt *
2972
_copyCommentStmt(const CommentStmt *from)
2973
0
{
2974
0
  CommentStmt *newnode = makeNode(CommentStmt);
2975
2976
0
  COPY_SCALAR_FIELD(objtype);
2977
0
  COPY_NODE_FIELD(object);
2978
0
  COPY_STRING_FIELD(comment);
2979
2980
0
  return newnode;
2981
0
}
2982
2983
static SecLabelStmt *
2984
_copySecLabelStmt(const SecLabelStmt *from)
2985
0
{
2986
0
  SecLabelStmt *newnode = makeNode(SecLabelStmt);
2987
2988
0
  COPY_SCALAR_FIELD(objtype);
2989
0
  COPY_NODE_FIELD(object);
2990
0
  COPY_STRING_FIELD(provider);
2991
0
  COPY_STRING_FIELD(label);
2992
2993
0
  return newnode;
2994
0
}
2995
2996
static DeclareCursorStmt *
2997
_copyDeclareCursorStmt(const DeclareCursorStmt *from)
2998
0
{
2999
0
  DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
3000
3001
0
  COPY_STRING_FIELD(portalname);
3002
0
  COPY_SCALAR_FIELD(options);
3003
0
  COPY_NODE_FIELD(query);
3004
3005
0
  return newnode;
3006
0
}
3007
3008
static ClosePortalStmt *
3009
_copyClosePortalStmt(const ClosePortalStmt *from)
3010
0
{
3011
0
  ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
3012
3013
0
  COPY_STRING_FIELD(portalname);
3014
3015
0
  return newnode;
3016
0
}
3017
3018
static FetchStmt *
3019
_copyFetchStmt(const FetchStmt *from)
3020
0
{
3021
0
  FetchStmt *newnode = makeNode(FetchStmt);
3022
3023
0
  COPY_SCALAR_FIELD(direction);
3024
0
  COPY_SCALAR_FIELD(howMany);
3025
0
  COPY_STRING_FIELD(portalname);
3026
0
  COPY_SCALAR_FIELD(ismove);
3027
0
  COPY_SCALAR_FIELD(direction_keyword);
3028
0
  COPY_LOCATION_FIELD(location);
3029
3030
0
  return newnode;
3031
0
}
3032
3033
static IndexStmt *
3034
_copyIndexStmt(const IndexStmt *from)
3035
0
{
3036
0
  IndexStmt *newnode = makeNode(IndexStmt);
3037
3038
0
  COPY_STRING_FIELD(idxname);
3039
0
  COPY_NODE_FIELD(relation);
3040
0
  COPY_STRING_FIELD(accessMethod);
3041
0
  COPY_STRING_FIELD(tableSpace);
3042
0
  COPY_NODE_FIELD(indexParams);
3043
0
  COPY_NODE_FIELD(indexIncludingParams);
3044
0
  COPY_NODE_FIELD(options);
3045
0
  COPY_NODE_FIELD(whereClause);
3046
0
  COPY_NODE_FIELD(excludeOpNames);
3047
0
  COPY_STRING_FIELD(idxcomment);
3048
0
  COPY_SCALAR_FIELD(indexOid);
3049
0
  COPY_SCALAR_FIELD(oldNumber);
3050
0
  COPY_SCALAR_FIELD(oldCreateSubid);
3051
0
  COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
3052
0
  COPY_SCALAR_FIELD(unique);
3053
0
  COPY_SCALAR_FIELD(nulls_not_distinct);
3054
0
  COPY_SCALAR_FIELD(primary);
3055
0
  COPY_SCALAR_FIELD(isconstraint);
3056
0
  COPY_SCALAR_FIELD(iswithoutoverlaps);
3057
0
  COPY_SCALAR_FIELD(deferrable);
3058
0
  COPY_SCALAR_FIELD(initdeferred);
3059
0
  COPY_SCALAR_FIELD(transformed);
3060
0
  COPY_SCALAR_FIELD(concurrent);
3061
0
  COPY_SCALAR_FIELD(if_not_exists);
3062
0
  COPY_SCALAR_FIELD(reset_default_tblspc);
3063
3064
0
  return newnode;
3065
0
}
3066
3067
static CreateStatsStmt *
3068
_copyCreateStatsStmt(const CreateStatsStmt *from)
3069
0
{
3070
0
  CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
3071
3072
0
  COPY_NODE_FIELD(defnames);
3073
0
  COPY_NODE_FIELD(stat_types);
3074
0
  COPY_NODE_FIELD(exprs);
3075
0
  COPY_NODE_FIELD(relations);
3076
0
  COPY_STRING_FIELD(stxcomment);
3077
0
  COPY_SCALAR_FIELD(transformed);
3078
0
  COPY_SCALAR_FIELD(if_not_exists);
3079
0
  COPY_SCALAR_FIELD(owner);
3080
3081
0
  return newnode;
3082
0
}
3083
3084
static StatsElem *
3085
_copyStatsElem(const StatsElem *from)
3086
0
{
3087
0
  StatsElem *newnode = makeNode(StatsElem);
3088
3089
0
  COPY_STRING_FIELD(name);
3090
0
  COPY_NODE_FIELD(expr);
3091
3092
0
  return newnode;
3093
0
}
3094
3095
static AlterStatsStmt *
3096
_copyAlterStatsStmt(const AlterStatsStmt *from)
3097
0
{
3098
0
  AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
3099
3100
0
  COPY_NODE_FIELD(defnames);
3101
0
  COPY_NODE_FIELD(stxstattarget);
3102
0
  COPY_SCALAR_FIELD(missing_ok);
3103
3104
0
  return newnode;
3105
0
}
3106
3107
static CreateFunctionStmt *
3108
_copyCreateFunctionStmt(const CreateFunctionStmt *from)
3109
0
{
3110
0
  CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
3111
3112
0
  COPY_SCALAR_FIELD(is_procedure);
3113
0
  COPY_SCALAR_FIELD(replace);
3114
0
  COPY_NODE_FIELD(funcname);
3115
0
  COPY_NODE_FIELD(parameters);
3116
0
  COPY_NODE_FIELD(returnType);
3117
0
  COPY_NODE_FIELD(options);
3118
0
  COPY_NODE_FIELD(sql_body);
3119
3120
0
  return newnode;
3121
0
}
3122
3123
static FunctionParameter *
3124
_copyFunctionParameter(const FunctionParameter *from)
3125
0
{
3126
0
  FunctionParameter *newnode = makeNode(FunctionParameter);
3127
3128
0
  COPY_STRING_FIELD(name);
3129
0
  COPY_NODE_FIELD(argType);
3130
0
  COPY_SCALAR_FIELD(mode);
3131
0
  COPY_NODE_FIELD(defexpr);
3132
0
  COPY_LOCATION_FIELD(location);
3133
3134
0
  return newnode;
3135
0
}
3136
3137
static AlterFunctionStmt *
3138
_copyAlterFunctionStmt(const AlterFunctionStmt *from)
3139
0
{
3140
0
  AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
3141
3142
0
  COPY_SCALAR_FIELD(objtype);
3143
0
  COPY_NODE_FIELD(func);
3144
0
  COPY_NODE_FIELD(actions);
3145
3146
0
  return newnode;
3147
0
}
3148
3149
static DoStmt *
3150
_copyDoStmt(const DoStmt *from)
3151
0
{
3152
0
  DoStmt *newnode = makeNode(DoStmt);
3153
3154
0
  COPY_NODE_FIELD(args);
3155
3156
0
  return newnode;
3157
0
}
3158
3159
static CallStmt *
3160
_copyCallStmt(const CallStmt *from)
3161
0
{
3162
0
  CallStmt *newnode = makeNode(CallStmt);
3163
3164
0
  COPY_NODE_FIELD(funccall);
3165
0
  COPY_NODE_FIELD(funcexpr);
3166
0
  COPY_NODE_FIELD(outargs);
3167
3168
0
  return newnode;
3169
0
}
3170
3171
static RenameStmt *
3172
_copyRenameStmt(const RenameStmt *from)
3173
0
{
3174
0
  RenameStmt *newnode = makeNode(RenameStmt);
3175
3176
0
  COPY_SCALAR_FIELD(renameType);
3177
0
  COPY_SCALAR_FIELD(relationType);
3178
0
  COPY_NODE_FIELD(relation);
3179
0
  COPY_NODE_FIELD(object);
3180
0
  COPY_STRING_FIELD(subname);
3181
0
  COPY_STRING_FIELD(newname);
3182
0
  COPY_SCALAR_FIELD(behavior);
3183
0
  COPY_SCALAR_FIELD(missing_ok);
3184
3185
0
  return newnode;
3186
0
}
3187
3188
static AlterObjectDependsStmt *
3189
_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
3190
0
{
3191
0
  AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
3192
3193
0
  COPY_SCALAR_FIELD(objectType);
3194
0
  COPY_NODE_FIELD(relation);
3195
0
  COPY_NODE_FIELD(object);
3196
0
  COPY_NODE_FIELD(extname);
3197
0
  COPY_SCALAR_FIELD(remove);
3198
3199
0
  return newnode;
3200
0
}
3201
3202
static AlterObjectSchemaStmt *
3203
_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
3204
0
{
3205
0
  AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
3206
3207
0
  COPY_SCALAR_FIELD(objectType);
3208
0
  COPY_NODE_FIELD(relation);
3209
0
  COPY_NODE_FIELD(object);
3210
0
  COPY_STRING_FIELD(newschema);
3211
0
  COPY_SCALAR_FIELD(missing_ok);
3212
3213
0
  return newnode;
3214
0
}
3215
3216
static AlterOwnerStmt *
3217
_copyAlterOwnerStmt(const AlterOwnerStmt *from)
3218
0
{
3219
0
  AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
3220
3221
0
  COPY_SCALAR_FIELD(objectType);
3222
0
  COPY_NODE_FIELD(relation);
3223
0
  COPY_NODE_FIELD(object);
3224
0
  COPY_NODE_FIELD(newowner);
3225
3226
0
  return newnode;
3227
0
}
3228
3229
static AlterOperatorStmt *
3230
_copyAlterOperatorStmt(const AlterOperatorStmt *from)
3231
0
{
3232
0
  AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
3233
3234
0
  COPY_NODE_FIELD(opername);
3235
0
  COPY_NODE_FIELD(options);
3236
3237
0
  return newnode;
3238
0
}
3239
3240
static AlterTypeStmt *
3241
_copyAlterTypeStmt(const AlterTypeStmt *from)
3242
0
{
3243
0
  AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
3244
3245
0
  COPY_NODE_FIELD(typeName);
3246
0
  COPY_NODE_FIELD(options);
3247
3248
0
  return newnode;
3249
0
}
3250
3251
static RuleStmt *
3252
_copyRuleStmt(const RuleStmt *from)
3253
0
{
3254
0
  RuleStmt *newnode = makeNode(RuleStmt);
3255
3256
0
  COPY_NODE_FIELD(relation);
3257
0
  COPY_STRING_FIELD(rulename);
3258
0
  COPY_NODE_FIELD(whereClause);
3259
0
  COPY_SCALAR_FIELD(event);
3260
0
  COPY_SCALAR_FIELD(instead);
3261
0
  COPY_NODE_FIELD(actions);
3262
0
  COPY_SCALAR_FIELD(replace);
3263
3264
0
  return newnode;
3265
0
}
3266
3267
static NotifyStmt *
3268
_copyNotifyStmt(const NotifyStmt *from)
3269
0
{
3270
0
  NotifyStmt *newnode = makeNode(NotifyStmt);
3271
3272
0
  COPY_STRING_FIELD(conditionname);
3273
0
  COPY_STRING_FIELD(payload);
3274
3275
0
  return newnode;
3276
0
}
3277
3278
static ListenStmt *
3279
_copyListenStmt(const ListenStmt *from)
3280
0
{
3281
0
  ListenStmt *newnode = makeNode(ListenStmt);
3282
3283
0
  COPY_STRING_FIELD(conditionname);
3284
3285
0
  return newnode;
3286
0
}
3287
3288
static UnlistenStmt *
3289
_copyUnlistenStmt(const UnlistenStmt *from)
3290
0
{
3291
0
  UnlistenStmt *newnode = makeNode(UnlistenStmt);
3292
3293
0
  COPY_STRING_FIELD(conditionname);
3294
3295
0
  return newnode;
3296
0
}
3297
3298
static TransactionStmt *
3299
_copyTransactionStmt(const TransactionStmt *from)
3300
0
{
3301
0
  TransactionStmt *newnode = makeNode(TransactionStmt);
3302
3303
0
  COPY_SCALAR_FIELD(kind);
3304
0
  COPY_NODE_FIELD(options);
3305
0
  COPY_STRING_FIELD(savepoint_name);
3306
0
  COPY_STRING_FIELD(gid);
3307
0
  COPY_SCALAR_FIELD(chain);
3308
0
  COPY_LOCATION_FIELD(location);
3309
3310
0
  return newnode;
3311
0
}
3312
3313
static CompositeTypeStmt *
3314
_copyCompositeTypeStmt(const CompositeTypeStmt *from)
3315
0
{
3316
0
  CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
3317
3318
0
  COPY_NODE_FIELD(typevar);
3319
0
  COPY_NODE_FIELD(coldeflist);
3320
3321
0
  return newnode;
3322
0
}
3323
3324
static CreateEnumStmt *
3325
_copyCreateEnumStmt(const CreateEnumStmt *from)
3326
0
{
3327
0
  CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
3328
3329
0
  COPY_NODE_FIELD(typeName);
3330
0
  COPY_NODE_FIELD(vals);
3331
3332
0
  return newnode;
3333
0
}
3334
3335
static CreateRangeStmt *
3336
_copyCreateRangeStmt(const CreateRangeStmt *from)
3337
0
{
3338
0
  CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
3339
3340
0
  COPY_NODE_FIELD(typeName);
3341
0
  COPY_NODE_FIELD(params);
3342
3343
0
  return newnode;
3344
0
}
3345
3346
static AlterEnumStmt *
3347
_copyAlterEnumStmt(const AlterEnumStmt *from)
3348
0
{
3349
0
  AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
3350
3351
0
  COPY_NODE_FIELD(typeName);
3352
0
  COPY_STRING_FIELD(oldVal);
3353
0
  COPY_STRING_FIELD(newVal);
3354
0
  COPY_STRING_FIELD(newValNeighbor);
3355
0
  COPY_SCALAR_FIELD(newValIsAfter);
3356
0
  COPY_SCALAR_FIELD(skipIfNewValExists);
3357
3358
0
  return newnode;
3359
0
}
3360
3361
static ViewStmt *
3362
_copyViewStmt(const ViewStmt *from)
3363
0
{
3364
0
  ViewStmt *newnode = makeNode(ViewStmt);
3365
3366
0
  COPY_NODE_FIELD(view);
3367
0
  COPY_NODE_FIELD(aliases);
3368
0
  COPY_NODE_FIELD(query);
3369
0
  COPY_SCALAR_FIELD(replace);
3370
0
  COPY_NODE_FIELD(options);
3371
0
  COPY_SCALAR_FIELD(withCheckOption);
3372
3373
0
  return newnode;
3374
0
}
3375
3376
static LoadStmt *
3377
_copyLoadStmt(const LoadStmt *from)
3378
0
{
3379
0
  LoadStmt *newnode = makeNode(LoadStmt);
3380
3381
0
  COPY_STRING_FIELD(filename);
3382
3383
0
  return newnode;
3384
0
}
3385
3386
static CreatedbStmt *
3387
_copyCreatedbStmt(const CreatedbStmt *from)
3388
0
{
3389
0
  CreatedbStmt *newnode = makeNode(CreatedbStmt);
3390
3391
0
  COPY_STRING_FIELD(dbname);
3392
0
  COPY_NODE_FIELD(options);
3393
3394
0
  return newnode;
3395
0
}
3396
3397
static AlterDatabaseStmt *
3398
_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
3399
0
{
3400
0
  AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
3401
3402
0
  COPY_STRING_FIELD(dbname);
3403
0
  COPY_NODE_FIELD(options);
3404
3405
0
  return newnode;
3406
0
}
3407
3408
static AlterDatabaseRefreshCollStmt *
3409
_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
3410
0
{
3411
0
  AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
3412
3413
0
  COPY_STRING_FIELD(dbname);
3414
3415
0
  return newnode;
3416
0
}
3417
3418
static AlterDatabaseSetStmt *
3419
_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
3420
0
{
3421
0
  AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
3422
3423
0
  COPY_STRING_FIELD(dbname);
3424
0
  COPY_NODE_FIELD(setstmt);
3425
3426
0
  return newnode;
3427
0
}
3428
3429
static DropdbStmt *
3430
_copyDropdbStmt(const DropdbStmt *from)
3431
0
{
3432
0
  DropdbStmt *newnode = makeNode(DropdbStmt);
3433
3434
0
  COPY_STRING_FIELD(dbname);
3435
0
  COPY_SCALAR_FIELD(missing_ok);
3436
0
  COPY_NODE_FIELD(options);
3437
3438
0
  return newnode;
3439
0
}
3440
3441
static AlterSystemStmt *
3442
_copyAlterSystemStmt(const AlterSystemStmt *from)
3443
0
{
3444
0
  AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
3445
3446
0
  COPY_NODE_FIELD(setstmt);
3447
3448
0
  return newnode;
3449
0
}
3450
3451
static VacuumStmt *
3452
_copyVacuumStmt(const VacuumStmt *from)
3453
0
{
3454
0
  VacuumStmt *newnode = makeNode(VacuumStmt);
3455
3456
0
  COPY_NODE_FIELD(options);
3457
0
  COPY_NODE_FIELD(rels);
3458
0
  COPY_SCALAR_FIELD(is_vacuumcmd);
3459
3460
0
  return newnode;
3461
0
}
3462
3463
static VacuumRelation *
3464
_copyVacuumRelation(const VacuumRelation *from)
3465
0
{
3466
0
  VacuumRelation *newnode = makeNode(VacuumRelation);
3467
3468
0
  COPY_NODE_FIELD(relation);
3469
0
  COPY_SCALAR_FIELD(oid);
3470
0
  COPY_NODE_FIELD(va_cols);
3471
3472
0
  return newnode;
3473
0
}
3474
3475
static RepackStmt *
3476
_copyRepackStmt(const RepackStmt *from)
3477
0
{
3478
0
  RepackStmt *newnode = makeNode(RepackStmt);
3479
3480
0
  COPY_SCALAR_FIELD(command);
3481
0
  COPY_NODE_FIELD(relation);
3482
0
  COPY_STRING_FIELD(indexname);
3483
0
  COPY_SCALAR_FIELD(usingindex);
3484
0
  COPY_NODE_FIELD(params);
3485
3486
0
  return newnode;
3487
0
}
3488
3489
static ExplainStmt *
3490
_copyExplainStmt(const ExplainStmt *from)
3491
0
{
3492
0
  ExplainStmt *newnode = makeNode(ExplainStmt);
3493
3494
0
  COPY_NODE_FIELD(query);
3495
0
  COPY_NODE_FIELD(options);
3496
3497
0
  return newnode;
3498
0
}
3499
3500
static CreateTableAsStmt *
3501
_copyCreateTableAsStmt(const CreateTableAsStmt *from)
3502
0
{
3503
0
  CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
3504
3505
0
  COPY_NODE_FIELD(query);
3506
0
  COPY_NODE_FIELD(into);
3507
0
  COPY_SCALAR_FIELD(objtype);
3508
0
  COPY_SCALAR_FIELD(is_select_into);
3509
0
  COPY_SCALAR_FIELD(if_not_exists);
3510
3511
0
  return newnode;
3512
0
}
3513
3514
static RefreshMatViewStmt *
3515
_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
3516
0
{
3517
0
  RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
3518
3519
0
  COPY_SCALAR_FIELD(concurrent);
3520
0
  COPY_SCALAR_FIELD(skipData);
3521
0
  COPY_NODE_FIELD(relation);
3522
3523
0
  return newnode;
3524
0
}
3525
3526
static CheckPointStmt *
3527
_copyCheckPointStmt(const CheckPointStmt *from)
3528
0
{
3529
0
  CheckPointStmt *newnode = makeNode(CheckPointStmt);
3530
3531
0
  COPY_NODE_FIELD(options);
3532
3533
0
  return newnode;
3534
0
}
3535
3536
static DiscardStmt *
3537
_copyDiscardStmt(const DiscardStmt *from)
3538
0
{
3539
0
  DiscardStmt *newnode = makeNode(DiscardStmt);
3540
3541
0
  COPY_SCALAR_FIELD(target);
3542
3543
0
  return newnode;
3544
0
}
3545
3546
static LockStmt *
3547
_copyLockStmt(const LockStmt *from)
3548
0
{
3549
0
  LockStmt *newnode = makeNode(LockStmt);
3550
3551
0
  COPY_NODE_FIELD(relations);
3552
0
  COPY_SCALAR_FIELD(mode);
3553
0
  COPY_SCALAR_FIELD(nowait);
3554
3555
0
  return newnode;
3556
0
}
3557
3558
static ConstraintsSetStmt *
3559
_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
3560
0
{
3561
0
  ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
3562
3563
0
  COPY_NODE_FIELD(constraints);
3564
0
  COPY_SCALAR_FIELD(deferred);
3565
3566
0
  return newnode;
3567
0
}
3568
3569
static ReindexStmt *
3570
_copyReindexStmt(const ReindexStmt *from)
3571
0
{
3572
0
  ReindexStmt *newnode = makeNode(ReindexStmt);
3573
3574
0
  COPY_SCALAR_FIELD(kind);
3575
0
  COPY_NODE_FIELD(relation);
3576
0
  COPY_STRING_FIELD(name);
3577
0
  COPY_NODE_FIELD(params);
3578
3579
0
  return newnode;
3580
0
}
3581
3582
static CreateConversionStmt *
3583
_copyCreateConversionStmt(const CreateConversionStmt *from)
3584
0
{
3585
0
  CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
3586
3587
0
  COPY_NODE_FIELD(conversion_name);
3588
0
  COPY_STRING_FIELD(for_encoding_name);
3589
0
  COPY_STRING_FIELD(to_encoding_name);
3590
0
  COPY_NODE_FIELD(func_name);
3591
0
  COPY_SCALAR_FIELD(def);
3592
3593
0
  return newnode;
3594
0
}
3595
3596
static CreateCastStmt *
3597
_copyCreateCastStmt(const CreateCastStmt *from)
3598
0
{
3599
0
  CreateCastStmt *newnode = makeNode(CreateCastStmt);
3600
3601
0
  COPY_NODE_FIELD(sourcetype);
3602
0
  COPY_NODE_FIELD(targettype);
3603
0
  COPY_NODE_FIELD(func);
3604
0
  COPY_SCALAR_FIELD(context);
3605
0
  COPY_SCALAR_FIELD(inout);
3606
3607
0
  return newnode;
3608
0
}
3609
3610
static CreateTransformStmt *
3611
_copyCreateTransformStmt(const CreateTransformStmt *from)
3612
0
{
3613
0
  CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
3614
3615
0
  COPY_SCALAR_FIELD(replace);
3616
0
  COPY_NODE_FIELD(type_name);
3617
0
  COPY_STRING_FIELD(lang);
3618
0
  COPY_NODE_FIELD(fromsql);
3619
0
  COPY_NODE_FIELD(tosql);
3620
3621
0
  return newnode;
3622
0
}
3623
3624
static PrepareStmt *
3625
_copyPrepareStmt(const PrepareStmt *from)
3626
0
{
3627
0
  PrepareStmt *newnode = makeNode(PrepareStmt);
3628
3629
0
  COPY_STRING_FIELD(name);
3630
0
  COPY_NODE_FIELD(argtypes);
3631
0
  COPY_NODE_FIELD(query);
3632
3633
0
  return newnode;
3634
0
}
3635
3636
static ExecuteStmt *
3637
_copyExecuteStmt(const ExecuteStmt *from)
3638
0
{
3639
0
  ExecuteStmt *newnode = makeNode(ExecuteStmt);
3640
3641
0
  COPY_STRING_FIELD(name);
3642
0
  COPY_NODE_FIELD(params);
3643
3644
0
  return newnode;
3645
0
}
3646
3647
static DeallocateStmt *
3648
_copyDeallocateStmt(const DeallocateStmt *from)
3649
0
{
3650
0
  DeallocateStmt *newnode = makeNode(DeallocateStmt);
3651
3652
0
  COPY_STRING_FIELD(name);
3653
0
  COPY_SCALAR_FIELD(isall);
3654
0
  COPY_LOCATION_FIELD(location);
3655
3656
0
  return newnode;
3657
0
}
3658
3659
static DropOwnedStmt *
3660
_copyDropOwnedStmt(const DropOwnedStmt *from)
3661
0
{
3662
0
  DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
3663
3664
0
  COPY_NODE_FIELD(roles);
3665
0
  COPY_SCALAR_FIELD(behavior);
3666
3667
0
  return newnode;
3668
0
}
3669
3670
static ReassignOwnedStmt *
3671
_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
3672
0
{
3673
0
  ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
3674
3675
0
  COPY_NODE_FIELD(roles);
3676
0
  COPY_NODE_FIELD(newrole);
3677
3678
0
  return newnode;
3679
0
}
3680
3681
static AlterTSDictionaryStmt *
3682
_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
3683
0
{
3684
0
  AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
3685
3686
0
  COPY_NODE_FIELD(dictname);
3687
0
  COPY_NODE_FIELD(options);
3688
3689
0
  return newnode;
3690
0
}
3691
3692
static AlterTSConfigurationStmt *
3693
_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
3694
0
{
3695
0
  AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
3696
3697
0
  COPY_SCALAR_FIELD(kind);
3698
0
  COPY_NODE_FIELD(cfgname);
3699
0
  COPY_NODE_FIELD(tokentype);
3700
0
  COPY_NODE_FIELD(dicts);
3701
0
  COPY_SCALAR_FIELD(override);
3702
0
  COPY_SCALAR_FIELD(replace);
3703
0
  COPY_SCALAR_FIELD(missing_ok);
3704
3705
0
  return newnode;
3706
0
}
3707
3708
static PublicationTable *
3709
_copyPublicationTable(const PublicationTable *from)
3710
0
{
3711
0
  PublicationTable *newnode = makeNode(PublicationTable);
3712
3713
0
  COPY_NODE_FIELD(relation);
3714
0
  COPY_NODE_FIELD(whereClause);
3715
0
  COPY_NODE_FIELD(columns);
3716
0
  COPY_SCALAR_FIELD(except);
3717
3718
0
  return newnode;
3719
0
}
3720
3721
static PublicationObjSpec *
3722
_copyPublicationObjSpec(const PublicationObjSpec *from)
3723
0
{
3724
0
  PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
3725
3726
0
  COPY_SCALAR_FIELD(pubobjtype);
3727
0
  COPY_STRING_FIELD(name);
3728
0
  COPY_NODE_FIELD(pubtable);
3729
0
  COPY_LOCATION_FIELD(location);
3730
3731
0
  return newnode;
3732
0
}
3733
3734
static PublicationAllObjSpec *
3735
_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
3736
0
{
3737
0
  PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
3738
3739
0
  COPY_SCALAR_FIELD(pubobjtype);
3740
0
  COPY_NODE_FIELD(except_tables);
3741
0
  COPY_LOCATION_FIELD(location);
3742
3743
0
  return newnode;
3744
0
}
3745
3746
static CreatePublicationStmt *
3747
_copyCreatePublicationStmt(const CreatePublicationStmt *from)
3748
0
{
3749
0
  CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
3750
3751
0
  COPY_STRING_FIELD(pubname);
3752
0
  COPY_NODE_FIELD(options);
3753
0
  COPY_NODE_FIELD(pubobjects);
3754
0
  COPY_SCALAR_FIELD(for_all_tables);
3755
0
  COPY_SCALAR_FIELD(for_all_sequences);
3756
3757
0
  return newnode;
3758
0
}
3759
3760
static AlterPublicationStmt *
3761
_copyAlterPublicationStmt(const AlterPublicationStmt *from)
3762
0
{
3763
0
  AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
3764
3765
0
  COPY_STRING_FIELD(pubname);
3766
0
  COPY_NODE_FIELD(options);
3767
0
  COPY_NODE_FIELD(pubobjects);
3768
0
  COPY_SCALAR_FIELD(action);
3769
0
  COPY_SCALAR_FIELD(for_all_tables);
3770
0
  COPY_SCALAR_FIELD(for_all_sequences);
3771
3772
0
  return newnode;
3773
0
}
3774
3775
static CreateSubscriptionStmt *
3776
_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
3777
0
{
3778
0
  CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
3779
3780
0
  COPY_STRING_FIELD(subname);
3781
0
  COPY_STRING_FIELD(servername);
3782
0
  COPY_STRING_FIELD(conninfo);
3783
0
  COPY_NODE_FIELD(publication);
3784
0
  COPY_NODE_FIELD(options);
3785
3786
0
  return newnode;
3787
0
}
3788
3789
static AlterSubscriptionStmt *
3790
_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
3791
0
{
3792
0
  AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
3793
3794
0
  COPY_SCALAR_FIELD(kind);
3795
0
  COPY_STRING_FIELD(subname);
3796
0
  COPY_STRING_FIELD(servername);
3797
0
  COPY_STRING_FIELD(conninfo);
3798
0
  COPY_NODE_FIELD(publication);
3799
0
  COPY_NODE_FIELD(options);
3800
3801
0
  return newnode;
3802
0
}
3803
3804
static DropSubscriptionStmt *
3805
_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
3806
0
{
3807
0
  DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
3808
3809
0
  COPY_STRING_FIELD(subname);
3810
0
  COPY_SCALAR_FIELD(missing_ok);
3811
0
  COPY_SCALAR_FIELD(behavior);
3812
3813
0
  return newnode;
3814
0
}
3815
3816
static WaitStmt *
3817
_copyWaitStmt(const WaitStmt *from)
3818
0
{
3819
0
  WaitStmt *newnode = makeNode(WaitStmt);
3820
3821
0
  COPY_STRING_FIELD(lsn_literal);
3822
0
  COPY_NODE_FIELD(options);
3823
0
  COPY_LOCATION_FIELD(lsn_location);
3824
3825
0
  return newnode;
3826
0
}
3827
3828
static PathKey *
3829
_copyPathKey(const PathKey *from)
3830
0
{
3831
0
  PathKey *newnode = makeNode(PathKey);
3832
3833
0
  COPY_SCALAR_FIELD(pk_eclass);
3834
0
  COPY_SCALAR_FIELD(pk_opfamily);
3835
0
  COPY_SCALAR_FIELD(pk_cmptype);
3836
0
  COPY_SCALAR_FIELD(pk_nulls_first);
3837
3838
0
  return newnode;
3839
0
}
3840
3841
static GroupByOrdering *
3842
_copyGroupByOrdering(const GroupByOrdering *from)
3843
0
{
3844
0
  GroupByOrdering *newnode = makeNode(GroupByOrdering);
3845
3846
0
  COPY_NODE_FIELD(pathkeys);
3847
0
  COPY_NODE_FIELD(clauses);
3848
3849
0
  return newnode;
3850
0
}
3851
3852
static RestrictInfo *
3853
_copyRestrictInfo(const RestrictInfo *from)
3854
0
{
3855
0
  RestrictInfo *newnode = makeNode(RestrictInfo);
3856
3857
0
  COPY_NODE_FIELD(clause);
3858
0
  COPY_SCALAR_FIELD(is_pushed_down);
3859
0
  COPY_SCALAR_FIELD(can_join);
3860
0
  COPY_SCALAR_FIELD(pseudoconstant);
3861
0
  COPY_SCALAR_FIELD(has_clone);
3862
0
  COPY_SCALAR_FIELD(is_clone);
3863
0
  COPY_SCALAR_FIELD(leakproof);
3864
0
  COPY_SCALAR_FIELD(has_volatile);
3865
0
  COPY_SCALAR_FIELD(security_level);
3866
0
  COPY_SCALAR_FIELD(num_base_rels);
3867
0
  COPY_BITMAPSET_FIELD(clause_relids);
3868
0
  COPY_BITMAPSET_FIELD(required_relids);
3869
0
  COPY_BITMAPSET_FIELD(incompatible_relids);
3870
0
  COPY_BITMAPSET_FIELD(outer_relids);
3871
0
  COPY_BITMAPSET_FIELD(left_relids);
3872
0
  COPY_BITMAPSET_FIELD(right_relids);
3873
0
  COPY_NODE_FIELD(orclause);
3874
0
  COPY_SCALAR_FIELD(rinfo_serial);
3875
0
  COPY_SCALAR_FIELD(parent_ec);
3876
0
  COPY_SCALAR_FIELD(eval_cost);
3877
0
  COPY_SCALAR_FIELD(norm_selec);
3878
0
  COPY_SCALAR_FIELD(outer_selec);
3879
0
  COPY_NODE_FIELD(mergeopfamilies);
3880
0
  COPY_SCALAR_FIELD(left_ec);
3881
0
  COPY_SCALAR_FIELD(right_ec);
3882
0
  COPY_SCALAR_FIELD(left_em);
3883
0
  COPY_SCALAR_FIELD(right_em);
3884
0
  newnode->scansel_cache = NIL;
3885
0
  COPY_SCALAR_FIELD(outer_is_left);
3886
0
  COPY_SCALAR_FIELD(hashjoinoperator);
3887
0
  COPY_SCALAR_FIELD(left_bucketsize);
3888
0
  COPY_SCALAR_FIELD(right_bucketsize);
3889
0
  COPY_SCALAR_FIELD(left_mcvfreq);
3890
0
  COPY_SCALAR_FIELD(right_mcvfreq);
3891
0
  COPY_SCALAR_FIELD(left_hasheqoperator);
3892
0
  COPY_SCALAR_FIELD(right_hasheqoperator);
3893
3894
0
  return newnode;
3895
0
}
3896
3897
static PlaceHolderVar *
3898
_copyPlaceHolderVar(const PlaceHolderVar *from)
3899
0
{
3900
0
  PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
3901
3902
0
  COPY_NODE_FIELD(phexpr);
3903
0
  COPY_BITMAPSET_FIELD(phrels);
3904
0
  COPY_BITMAPSET_FIELD(phnullingrels);
3905
0
  COPY_SCALAR_FIELD(phid);
3906
0
  COPY_SCALAR_FIELD(phlevelsup);
3907
3908
0
  return newnode;
3909
0
}
3910
3911
static SpecialJoinInfo *
3912
_copySpecialJoinInfo(const SpecialJoinInfo *from)
3913
0
{
3914
0
  SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
3915
3916
0
  COPY_BITMAPSET_FIELD(min_lefthand);
3917
0
  COPY_BITMAPSET_FIELD(min_righthand);
3918
0
  COPY_BITMAPSET_FIELD(syn_lefthand);
3919
0
  COPY_BITMAPSET_FIELD(syn_righthand);
3920
0
  COPY_SCALAR_FIELD(jointype);
3921
0
  COPY_SCALAR_FIELD(ojrelid);
3922
0
  COPY_BITMAPSET_FIELD(commute_above_l);
3923
0
  COPY_BITMAPSET_FIELD(commute_above_r);
3924
0
  COPY_BITMAPSET_FIELD(commute_below_l);
3925
0
  COPY_BITMAPSET_FIELD(commute_below_r);
3926
0
  COPY_SCALAR_FIELD(lhs_strict);
3927
0
  COPY_SCALAR_FIELD(semi_can_btree);
3928
0
  COPY_SCALAR_FIELD(semi_can_hash);
3929
0
  COPY_NODE_FIELD(semi_operators);
3930
0
  COPY_NODE_FIELD(semi_rhs_exprs);
3931
3932
0
  return newnode;
3933
0
}
3934
3935
static AppendRelInfo *
3936
_copyAppendRelInfo(const AppendRelInfo *from)
3937
0
{
3938
0
  AppendRelInfo *newnode = makeNode(AppendRelInfo);
3939
3940
0
  COPY_SCALAR_FIELD(parent_relid);
3941
0
  COPY_SCALAR_FIELD(child_relid);
3942
0
  COPY_SCALAR_FIELD(parent_reltype);
3943
0
  COPY_SCALAR_FIELD(child_reltype);
3944
0
  COPY_NODE_FIELD(translated_vars);
3945
0
  COPY_SCALAR_FIELD(num_child_cols);
3946
0
  COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
3947
0
  COPY_SCALAR_FIELD(parent_reloid);
3948
3949
0
  return newnode;
3950
0
}
3951
3952
static PlaceHolderInfo *
3953
_copyPlaceHolderInfo(const PlaceHolderInfo *from)
3954
0
{
3955
0
  PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
3956
3957
0
  COPY_SCALAR_FIELD(phid);
3958
0
  COPY_NODE_FIELD(ph_var);
3959
0
  COPY_BITMAPSET_FIELD(ph_eval_at);
3960
0
  COPY_BITMAPSET_FIELD(ph_lateral);
3961
0
  COPY_BITMAPSET_FIELD(ph_needed);
3962
0
  COPY_SCALAR_FIELD(ph_width);
3963
3964
0
  return newnode;
3965
0
}
3966
3967
static AggClauseInfo *
3968
_copyAggClauseInfo(const AggClauseInfo *from)
3969
0
{
3970
0
  AggClauseInfo *newnode = makeNode(AggClauseInfo);
3971
3972
0
  COPY_NODE_FIELD(aggref);
3973
0
  COPY_BITMAPSET_FIELD(agg_eval_at);
3974
3975
0
  return newnode;
3976
0
}
3977
3978
static GroupingExprInfo *
3979
_copyGroupingExprInfo(const GroupingExprInfo *from)
3980
0
{
3981
0
  GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
3982
3983
0
  COPY_NODE_FIELD(expr);
3984
0
  COPY_SCALAR_FIELD(sortgroupref);
3985
0
  COPY_SCALAR_FIELD(ec);
3986
3987
0
  return newnode;
3988
0
}
3989
3990
static PlannedStmt *
3991
_copyPlannedStmt(const PlannedStmt *from)
3992
0
{
3993
0
  PlannedStmt *newnode = makeNode(PlannedStmt);
3994
3995
0
  COPY_SCALAR_FIELD(commandType);
3996
0
  COPY_SCALAR_FIELD(queryId);
3997
0
  COPY_SCALAR_FIELD(planId);
3998
0
  COPY_SCALAR_FIELD(planOrigin);
3999
0
  COPY_SCALAR_FIELD(hasReturning);
4000
0
  COPY_SCALAR_FIELD(hasModifyingCTE);
4001
0
  COPY_SCALAR_FIELD(canSetTag);
4002
0
  COPY_SCALAR_FIELD(transientPlan);
4003
0
  COPY_SCALAR_FIELD(dependsOnRole);
4004
0
  COPY_SCALAR_FIELD(parallelModeNeeded);
4005
0
  COPY_SCALAR_FIELD(jitFlags);
4006
0
  COPY_NODE_FIELD(planTree);
4007
0
  COPY_NODE_FIELD(partPruneInfos);
4008
0
  COPY_NODE_FIELD(rtable);
4009
0
  COPY_BITMAPSET_FIELD(unprunableRelids);
4010
0
  COPY_NODE_FIELD(permInfos);
4011
0
  COPY_BITMAPSET_FIELD(resultRelationRelids);
4012
0
  COPY_NODE_FIELD(appendRelations);
4013
0
  COPY_NODE_FIELD(subplans);
4014
0
  COPY_NODE_FIELD(subrtinfos);
4015
0
  COPY_BITMAPSET_FIELD(rewindPlanIDs);
4016
0
  COPY_NODE_FIELD(rowMarks);
4017
0
  COPY_BITMAPSET_FIELD(rowMarkRelids);
4018
0
  COPY_NODE_FIELD(relationOids);
4019
0
  COPY_NODE_FIELD(invalItems);
4020
0
  COPY_NODE_FIELD(paramExecTypes);
4021
0
  COPY_NODE_FIELD(utilityStmt);
4022
0
  COPY_NODE_FIELD(elidedNodes);
4023
0
  COPY_NODE_FIELD(extension_state);
4024
0
  COPY_LOCATION_FIELD(stmt_location);
4025
0
  COPY_LOCATION_FIELD(stmt_len);
4026
4027
0
  return newnode;
4028
0
}
4029
4030
static Result *
4031
_copyResult(const Result *from)
4032
0
{
4033
0
  Result *newnode = makeNode(Result);
4034
4035
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
4036
0
  COPY_SCALAR_FIELD(plan.startup_cost);
4037
0
  COPY_SCALAR_FIELD(plan.total_cost);
4038
0
  COPY_SCALAR_FIELD(plan.plan_rows);
4039
0
  COPY_SCALAR_FIELD(plan.plan_width);
4040
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
4041
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
4042
0
  COPY_SCALAR_FIELD(plan.async_capable);
4043
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
4044
0
  COPY_NODE_FIELD(plan.targetlist);
4045
0
  COPY_NODE_FIELD(plan.qual);
4046
0
  COPY_NODE_FIELD(plan.lefttree);
4047
0
  COPY_NODE_FIELD(plan.righttree);
4048
0
  COPY_NODE_FIELD(plan.initPlan);
4049
0
  COPY_BITMAPSET_FIELD(plan.extParam);
4050
0
  COPY_BITMAPSET_FIELD(plan.allParam);
4051
0
  COPY_SCALAR_FIELD(result_type);
4052
0
  COPY_NODE_FIELD(resconstantqual);
4053
0
  COPY_BITMAPSET_FIELD(relids);
4054
4055
0
  return newnode;
4056
0
}
4057
4058
static ProjectSet *
4059
_copyProjectSet(const ProjectSet *from)
4060
0
{
4061
0
  ProjectSet *newnode = makeNode(ProjectSet);
4062
4063
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
4064
0
  COPY_SCALAR_FIELD(plan.startup_cost);
4065
0
  COPY_SCALAR_FIELD(plan.total_cost);
4066
0
  COPY_SCALAR_FIELD(plan.plan_rows);
4067
0
  COPY_SCALAR_FIELD(plan.plan_width);
4068
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
4069
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
4070
0
  COPY_SCALAR_FIELD(plan.async_capable);
4071
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
4072
0
  COPY_NODE_FIELD(plan.targetlist);
4073
0
  COPY_NODE_FIELD(plan.qual);
4074
0
  COPY_NODE_FIELD(plan.lefttree);
4075
0
  COPY_NODE_FIELD(plan.righttree);
4076
0
  COPY_NODE_FIELD(plan.initPlan);
4077
0
  COPY_BITMAPSET_FIELD(plan.extParam);
4078
0
  COPY_BITMAPSET_FIELD(plan.allParam);
4079
4080
0
  return newnode;
4081
0
}
4082
4083
static ModifyTable *
4084
_copyModifyTable(const ModifyTable *from)
4085
0
{
4086
0
  ModifyTable *newnode = makeNode(ModifyTable);
4087
4088
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
4089
0
  COPY_SCALAR_FIELD(plan.startup_cost);
4090
0
  COPY_SCALAR_FIELD(plan.total_cost);
4091
0
  COPY_SCALAR_FIELD(plan.plan_rows);
4092
0
  COPY_SCALAR_FIELD(plan.plan_width);
4093
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
4094
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
4095
0
  COPY_SCALAR_FIELD(plan.async_capable);
4096
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
4097
0
  COPY_NODE_FIELD(plan.targetlist);
4098
0
  COPY_NODE_FIELD(plan.qual);
4099
0
  COPY_NODE_FIELD(plan.lefttree);
4100
0
  COPY_NODE_FIELD(plan.righttree);
4101
0
  COPY_NODE_FIELD(plan.initPlan);
4102
0
  COPY_BITMAPSET_FIELD(plan.extParam);
4103
0
  COPY_BITMAPSET_FIELD(plan.allParam);
4104
0
  COPY_SCALAR_FIELD(operation);
4105
0
  COPY_SCALAR_FIELD(canSetTag);
4106
0
  COPY_SCALAR_FIELD(nominalRelation);
4107
0
  COPY_SCALAR_FIELD(rootRelation);
4108
0
  COPY_NODE_FIELD(resultRelations);
4109
0
  COPY_NODE_FIELD(updateColnosLists);
4110
0
  COPY_NODE_FIELD(withCheckOptionLists);
4111
0
  COPY_STRING_FIELD(returningOldAlias);
4112
0
  COPY_STRING_FIELD(returningNewAlias);
4113
0
  COPY_NODE_FIELD(returningLists);
4114
0
  COPY_NODE_FIELD(fdwPrivLists);
4115
0
  COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
4116
0
  COPY_NODE_FIELD(rowMarks);
4117
0
  COPY_SCALAR_FIELD(epqParam);
4118
0
  COPY_SCALAR_FIELD(onConflictAction);
4119
0
  COPY_NODE_FIELD(arbiterIndexes);
4120
0
  COPY_SCALAR_FIELD(onConflictLockStrength);
4121
0
  COPY_NODE_FIELD(onConflictSet);
4122
0
  COPY_NODE_FIELD(onConflictCols);
4123
0
  COPY_NODE_FIELD(onConflictWhere);
4124
0
  COPY_SCALAR_FIELD(exclRelRTI);
4125
0
  COPY_NODE_FIELD(exclRelTlist);
4126
0
  COPY_NODE_FIELD(mergeActionLists);
4127
0
  COPY_NODE_FIELD(mergeJoinConditions);
4128
4129
0
  return newnode;
4130
0
}
4131
4132
static Append *
4133
_copyAppend(const Append *from)
4134
0
{
4135
0
  Append *newnode = makeNode(Append);
4136
4137
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
4138
0
  COPY_SCALAR_FIELD(plan.startup_cost);
4139
0
  COPY_SCALAR_FIELD(plan.total_cost);
4140
0
  COPY_SCALAR_FIELD(plan.plan_rows);
4141
0
  COPY_SCALAR_FIELD(plan.plan_width);
4142
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
4143
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
4144
0
  COPY_SCALAR_FIELD(plan.async_capable);
4145
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
4146
0
  COPY_NODE_FIELD(plan.targetlist);
4147
0
  COPY_NODE_FIELD(plan.qual);
4148
0
  COPY_NODE_FIELD(plan.lefttree);
4149
0
  COPY_NODE_FIELD(plan.righttree);
4150
0
  COPY_NODE_FIELD(plan.initPlan);
4151
0
  COPY_BITMAPSET_FIELD(plan.extParam);
4152
0
  COPY_BITMAPSET_FIELD(plan.allParam);
4153
0
  COPY_BITMAPSET_FIELD(apprelids);
4154
0
  COPY_NODE_FIELD(child_append_relid_sets);
4155
0
  COPY_NODE_FIELD(appendplans);
4156
0
  COPY_SCALAR_FIELD(nasyncplans);
4157
0
  COPY_SCALAR_FIELD(first_partial_plan);
4158
0
  COPY_SCALAR_FIELD(part_prune_index);
4159
4160
0
  return newnode;
4161
0
}
4162
4163
static MergeAppend *
4164
_copyMergeAppend(const MergeAppend *from)
4165
0
{
4166
0
  MergeAppend *newnode = makeNode(MergeAppend);
4167
4168
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
4169
0
  COPY_SCALAR_FIELD(plan.startup_cost);
4170
0
  COPY_SCALAR_FIELD(plan.total_cost);
4171
0
  COPY_SCALAR_FIELD(plan.plan_rows);
4172
0
  COPY_SCALAR_FIELD(plan.plan_width);
4173
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
4174
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
4175
0
  COPY_SCALAR_FIELD(plan.async_capable);
4176
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
4177
0
  COPY_NODE_FIELD(plan.targetlist);
4178
0
  COPY_NODE_FIELD(plan.qual);
4179
0
  COPY_NODE_FIELD(plan.lefttree);
4180
0
  COPY_NODE_FIELD(plan.righttree);
4181
0
  COPY_NODE_FIELD(plan.initPlan);
4182
0
  COPY_BITMAPSET_FIELD(plan.extParam);
4183
0
  COPY_BITMAPSET_FIELD(plan.allParam);
4184
0
  COPY_BITMAPSET_FIELD(apprelids);
4185
0
  COPY_NODE_FIELD(child_append_relid_sets);
4186
0
  COPY_NODE_FIELD(mergeplans);
4187
0
  COPY_SCALAR_FIELD(numCols);
4188
0
  COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
4189
0
  COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
4190
0
  COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
4191
0
  COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
4192
0
  COPY_SCALAR_FIELD(part_prune_index);
4193
4194
0
  return newnode;
4195
0
}
4196
4197
static RecursiveUnion *
4198
_copyRecursiveUnion(const RecursiveUnion *from)
4199
0
{
4200
0
  RecursiveUnion *newnode = makeNode(RecursiveUnion);
4201
4202
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
4203
0
  COPY_SCALAR_FIELD(plan.startup_cost);
4204
0
  COPY_SCALAR_FIELD(plan.total_cost);
4205
0
  COPY_SCALAR_FIELD(plan.plan_rows);
4206
0
  COPY_SCALAR_FIELD(plan.plan_width);
4207
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
4208
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
4209
0
  COPY_SCALAR_FIELD(plan.async_capable);
4210
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
4211
0
  COPY_NODE_FIELD(plan.targetlist);
4212
0
  COPY_NODE_FIELD(plan.qual);
4213
0
  COPY_NODE_FIELD(plan.lefttree);
4214
0
  COPY_NODE_FIELD(plan.righttree);
4215
0
  COPY_NODE_FIELD(plan.initPlan);
4216
0
  COPY_BITMAPSET_FIELD(plan.extParam);
4217
0
  COPY_BITMAPSET_FIELD(plan.allParam);
4218
0
  COPY_SCALAR_FIELD(wtParam);
4219
0
  COPY_SCALAR_FIELD(numCols);
4220
0
  COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
4221
0
  COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
4222
0
  COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
4223
0
  COPY_SCALAR_FIELD(numGroups);
4224
4225
0
  return newnode;
4226
0
}
4227
4228
static BitmapAnd *
4229
_copyBitmapAnd(const BitmapAnd *from)
4230
0
{
4231
0
  BitmapAnd *newnode = makeNode(BitmapAnd);
4232
4233
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
4234
0
  COPY_SCALAR_FIELD(plan.startup_cost);
4235
0
  COPY_SCALAR_FIELD(plan.total_cost);
4236
0
  COPY_SCALAR_FIELD(plan.plan_rows);
4237
0
  COPY_SCALAR_FIELD(plan.plan_width);
4238
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
4239
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
4240
0
  COPY_SCALAR_FIELD(plan.async_capable);
4241
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
4242
0
  COPY_NODE_FIELD(plan.targetlist);
4243
0
  COPY_NODE_FIELD(plan.qual);
4244
0
  COPY_NODE_FIELD(plan.lefttree);
4245
0
  COPY_NODE_FIELD(plan.righttree);
4246
0
  COPY_NODE_FIELD(plan.initPlan);
4247
0
  COPY_BITMAPSET_FIELD(plan.extParam);
4248
0
  COPY_BITMAPSET_FIELD(plan.allParam);
4249
0
  COPY_NODE_FIELD(bitmapplans);
4250
4251
0
  return newnode;
4252
0
}
4253
4254
static BitmapOr *
4255
_copyBitmapOr(const BitmapOr *from)
4256
0
{
4257
0
  BitmapOr *newnode = makeNode(BitmapOr);
4258
4259
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
4260
0
  COPY_SCALAR_FIELD(plan.startup_cost);
4261
0
  COPY_SCALAR_FIELD(plan.total_cost);
4262
0
  COPY_SCALAR_FIELD(plan.plan_rows);
4263
0
  COPY_SCALAR_FIELD(plan.plan_width);
4264
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
4265
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
4266
0
  COPY_SCALAR_FIELD(plan.async_capable);
4267
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
4268
0
  COPY_NODE_FIELD(plan.targetlist);
4269
0
  COPY_NODE_FIELD(plan.qual);
4270
0
  COPY_NODE_FIELD(plan.lefttree);
4271
0
  COPY_NODE_FIELD(plan.righttree);
4272
0
  COPY_NODE_FIELD(plan.initPlan);
4273
0
  COPY_BITMAPSET_FIELD(plan.extParam);
4274
0
  COPY_BITMAPSET_FIELD(plan.allParam);
4275
0
  COPY_SCALAR_FIELD(isshared);
4276
0
  COPY_NODE_FIELD(bitmapplans);
4277
4278
0
  return newnode;
4279
0
}
4280
4281
static SeqScan *
4282
_copySeqScan(const SeqScan *from)
4283
0
{
4284
0
  SeqScan *newnode = makeNode(SeqScan);
4285
4286
0
  COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
4287
0
  COPY_SCALAR_FIELD(scan.plan.startup_cost);
4288
0
  COPY_SCALAR_FIELD(scan.plan.total_cost);
4289
0
  COPY_SCALAR_FIELD(scan.plan.plan_rows);
4290
0
  COPY_SCALAR_FIELD(scan.plan.plan_width);
4291
0
  COPY_SCALAR_FIELD(scan.plan.parallel_aware);
4292
0
  COPY_SCALAR_FIELD(scan.plan.parallel_safe);
4293
0
  COPY_SCALAR_FIELD(scan.plan.async_capable);
4294
0
  COPY_SCALAR_FIELD(scan.plan.plan_node_id);
4295
0
  COPY_NODE_FIELD(scan.plan.targetlist);
4296
0
  COPY_NODE_FIELD(scan.plan.qual);
4297
0
  COPY_NODE_FIELD(scan.plan.lefttree);
4298
0
  COPY_NODE_FIELD(scan.plan.righttree);
4299
0
  COPY_NODE_FIELD(scan.plan.initPlan);
4300
0
  COPY_BITMAPSET_FIELD(scan.plan.extParam);
4301
0
  COPY_BITMAPSET_FIELD(scan.plan.allParam);
4302
0
  COPY_SCALAR_FIELD(scan.scanrelid);
4303
4304
0
  return newnode;
4305
0
}
4306
4307
static SampleScan *
4308
_copySampleScan(const SampleScan *from)
4309
0
{
4310
0
  SampleScan *newnode = makeNode(SampleScan);
4311
4312
0
  COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
4313
0
  COPY_SCALAR_FIELD(scan.plan.startup_cost);
4314
0
  COPY_SCALAR_FIELD(scan.plan.total_cost);
4315
0
  COPY_SCALAR_FIELD(scan.plan.plan_rows);
4316
0
  COPY_SCALAR_FIELD(scan.plan.plan_width);
4317
0
  COPY_SCALAR_FIELD(scan.plan.parallel_aware);
4318
0
  COPY_SCALAR_FIELD(scan.plan.parallel_safe);
4319
0
  COPY_SCALAR_FIELD(scan.plan.async_capable);
4320
0
  COPY_SCALAR_FIELD(scan.plan.plan_node_id);
4321
0
  COPY_NODE_FIELD(scan.plan.targetlist);
4322
0
  COPY_NODE_FIELD(scan.plan.qual);
4323
0
  COPY_NODE_FIELD(scan.plan.lefttree);
4324
0
  COPY_NODE_FIELD(scan.plan.righttree);
4325
0
  COPY_NODE_FIELD(scan.plan.initPlan);
4326
0
  COPY_BITMAPSET_FIELD(scan.plan.extParam);
4327
0
  COPY_BITMAPSET_FIELD(scan.plan.allParam);
4328
0
  COPY_SCALAR_FIELD(scan.scanrelid);
4329
0
  COPY_NODE_FIELD(tablesample);
4330
4331
0
  return newnode;
4332
0
}
4333
4334
static IndexScan *
4335
_copyIndexScan(const IndexScan *from)
4336
0
{
4337
0
  IndexScan *newnode = makeNode(IndexScan);
4338
4339
0
  COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
4340
0
  COPY_SCALAR_FIELD(scan.plan.startup_cost);
4341
0
  COPY_SCALAR_FIELD(scan.plan.total_cost);
4342
0
  COPY_SCALAR_FIELD(scan.plan.plan_rows);
4343
0
  COPY_SCALAR_FIELD(scan.plan.plan_width);
4344
0
  COPY_SCALAR_FIELD(scan.plan.parallel_aware);
4345
0
  COPY_SCALAR_FIELD(scan.plan.parallel_safe);
4346
0
  COPY_SCALAR_FIELD(scan.plan.async_capable);
4347
0
  COPY_SCALAR_FIELD(scan.plan.plan_node_id);
4348
0
  COPY_NODE_FIELD(scan.plan.targetlist);
4349
0
  COPY_NODE_FIELD(scan.plan.qual);
4350
0
  COPY_NODE_FIELD(scan.plan.lefttree);
4351
0
  COPY_NODE_FIELD(scan.plan.righttree);
4352
0
  COPY_NODE_FIELD(scan.plan.initPlan);
4353
0
  COPY_BITMAPSET_FIELD(scan.plan.extParam);
4354
0
  COPY_BITMAPSET_FIELD(scan.plan.allParam);
4355
0
  COPY_SCALAR_FIELD(scan.scanrelid);
4356
0
  COPY_SCALAR_FIELD(indexid);
4357
0
  COPY_NODE_FIELD(indexqual);
4358
0
  COPY_NODE_FIELD(indexqualorig);
4359
0
  COPY_NODE_FIELD(indexorderby);
4360
0
  COPY_NODE_FIELD(indexorderbyorig);
4361
0
  COPY_NODE_FIELD(indexorderbyops);
4362
0
  COPY_SCALAR_FIELD(indexorderdir);
4363
4364
0
  return newnode;
4365
0
}
4366
4367
static IndexOnlyScan *
4368
_copyIndexOnlyScan(const IndexOnlyScan *from)
4369
0
{
4370
0
  IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
4371
4372
0
  COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
4373
0
  COPY_SCALAR_FIELD(scan.plan.startup_cost);
4374
0
  COPY_SCALAR_FIELD(scan.plan.total_cost);
4375
0
  COPY_SCALAR_FIELD(scan.plan.plan_rows);
4376
0
  COPY_SCALAR_FIELD(scan.plan.plan_width);
4377
0
  COPY_SCALAR_FIELD(scan.plan.parallel_aware);
4378
0
  COPY_SCALAR_FIELD(scan.plan.parallel_safe);
4379
0
  COPY_SCALAR_FIELD(scan.plan.async_capable);
4380
0
  COPY_SCALAR_FIELD(scan.plan.plan_node_id);
4381
0
  COPY_NODE_FIELD(scan.plan.targetlist);
4382
0
  COPY_NODE_FIELD(scan.plan.qual);
4383
0
  COPY_NODE_FIELD(scan.plan.lefttree);
4384
0
  COPY_NODE_FIELD(scan.plan.righttree);
4385
0
  COPY_NODE_FIELD(scan.plan.initPlan);
4386
0
  COPY_BITMAPSET_FIELD(scan.plan.extParam);
4387
0
  COPY_BITMAPSET_FIELD(scan.plan.allParam);
4388
0
  COPY_SCALAR_FIELD(scan.scanrelid);
4389
0
  COPY_SCALAR_FIELD(indexid);
4390
0
  COPY_NODE_FIELD(indexqual);
4391
0
  COPY_NODE_FIELD(recheckqual);
4392
0
  COPY_NODE_FIELD(indexorderby);
4393
0
  COPY_NODE_FIELD(indextlist);
4394
0
  COPY_SCALAR_FIELD(indexorderdir);
4395
4396
0
  return newnode;
4397
0
}
4398
4399
static BitmapIndexScan *
4400
_copyBitmapIndexScan(const BitmapIndexScan *from)
4401
0
{
4402
0
  BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
4403
4404
0
  COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
4405
0
  COPY_SCALAR_FIELD(scan.plan.startup_cost);
4406
0
  COPY_SCALAR_FIELD(scan.plan.total_cost);
4407
0
  COPY_SCALAR_FIELD(scan.plan.plan_rows);
4408
0
  COPY_SCALAR_FIELD(scan.plan.plan_width);
4409
0
  COPY_SCALAR_FIELD(scan.plan.parallel_aware);
4410
0
  COPY_SCALAR_FIELD(scan.plan.parallel_safe);
4411
0
  COPY_SCALAR_FIELD(scan.plan.async_capable);
4412
0
  COPY_SCALAR_FIELD(scan.plan.plan_node_id);
4413
0
  COPY_NODE_FIELD(scan.plan.targetlist);
4414
0
  COPY_NODE_FIELD(scan.plan.qual);
4415
0
  COPY_NODE_FIELD(scan.plan.lefttree);
4416
0
  COPY_NODE_FIELD(scan.plan.righttree);
4417
0
  COPY_NODE_FIELD(scan.plan.initPlan);
4418
0
  COPY_BITMAPSET_FIELD(scan.plan.extParam);
4419
0
  COPY_BITMAPSET_FIELD(scan.plan.allParam);
4420
0
  COPY_SCALAR_FIELD(scan.scanrelid);
4421
0
  COPY_SCALAR_FIELD(indexid);
4422
0
  COPY_SCALAR_FIELD(isshared);
4423
0
  COPY_NODE_FIELD(indexqual);
4424
0
  COPY_NODE_FIELD(indexqualorig);
4425
4426
0
  return newnode;
4427
0
}
4428
4429
static BitmapHeapScan *
4430
_copyBitmapHeapScan(const BitmapHeapScan *from)
4431
0
{
4432
0
  BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
4433
4434
0
  COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
4435
0
  COPY_SCALAR_FIELD(scan.plan.startup_cost);
4436
0
  COPY_SCALAR_FIELD(scan.plan.total_cost);
4437
0
  COPY_SCALAR_FIELD(scan.plan.plan_rows);
4438
0
  COPY_SCALAR_FIELD(scan.plan.plan_width);
4439
0
  COPY_SCALAR_FIELD(scan.plan.parallel_aware);
4440
0
  COPY_SCALAR_FIELD(scan.plan.parallel_safe);
4441
0
  COPY_SCALAR_FIELD(scan.plan.async_capable);
4442
0
  COPY_SCALAR_FIELD(scan.plan.plan_node_id);
4443
0
  COPY_NODE_FIELD(scan.plan.targetlist);
4444
0
  COPY_NODE_FIELD(scan.plan.qual);
4445
0
  COPY_NODE_FIELD(scan.plan.lefttree);
4446
0
  COPY_NODE_FIELD(scan.plan.righttree);
4447
0
  COPY_NODE_FIELD(scan.plan.initPlan);
4448
0
  COPY_BITMAPSET_FIELD(scan.plan.extParam);
4449
0
  COPY_BITMAPSET_FIELD(scan.plan.allParam);
4450
0
  COPY_SCALAR_FIELD(scan.scanrelid);
4451
0
  COPY_NODE_FIELD(bitmapqualorig);
4452
4453
0
  return newnode;
4454
0
}
4455
4456
static TidScan *
4457
_copyTidScan(const TidScan *from)
4458
0
{
4459
0
  TidScan *newnode = makeNode(TidScan);
4460
4461
0
  COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
4462
0
  COPY_SCALAR_FIELD(scan.plan.startup_cost);
4463
0
  COPY_SCALAR_FIELD(scan.plan.total_cost);
4464
0
  COPY_SCALAR_FIELD(scan.plan.plan_rows);
4465
0
  COPY_SCALAR_FIELD(scan.plan.plan_width);
4466
0
  COPY_SCALAR_FIELD(scan.plan.parallel_aware);
4467
0
  COPY_SCALAR_FIELD(scan.plan.parallel_safe);
4468
0
  COPY_SCALAR_FIELD(scan.plan.async_capable);
4469
0
  COPY_SCALAR_FIELD(scan.plan.plan_node_id);
4470
0
  COPY_NODE_FIELD(scan.plan.targetlist);
4471
0
  COPY_NODE_FIELD(scan.plan.qual);
4472
0
  COPY_NODE_FIELD(scan.plan.lefttree);
4473
0
  COPY_NODE_FIELD(scan.plan.righttree);
4474
0
  COPY_NODE_FIELD(scan.plan.initPlan);
4475
0
  COPY_BITMAPSET_FIELD(scan.plan.extParam);
4476
0
  COPY_BITMAPSET_FIELD(scan.plan.allParam);
4477
0
  COPY_SCALAR_FIELD(scan.scanrelid);
4478
0
  COPY_NODE_FIELD(tidquals);
4479
4480
0
  return newnode;
4481
0
}
4482
4483
static TidRangeScan *
4484
_copyTidRangeScan(const TidRangeScan *from)
4485
0
{
4486
0
  TidRangeScan *newnode = makeNode(TidRangeScan);
4487
4488
0
  COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
4489
0
  COPY_SCALAR_FIELD(scan.plan.startup_cost);
4490
0
  COPY_SCALAR_FIELD(scan.plan.total_cost);
4491
0
  COPY_SCALAR_FIELD(scan.plan.plan_rows);
4492
0
  COPY_SCALAR_FIELD(scan.plan.plan_width);
4493
0
  COPY_SCALAR_FIELD(scan.plan.parallel_aware);
4494
0
  COPY_SCALAR_FIELD(scan.plan.parallel_safe);
4495
0
  COPY_SCALAR_FIELD(scan.plan.async_capable);
4496
0
  COPY_SCALAR_FIELD(scan.plan.plan_node_id);
4497
0
  COPY_NODE_FIELD(scan.plan.targetlist);
4498
0
  COPY_NODE_FIELD(scan.plan.qual);
4499
0
  COPY_NODE_FIELD(scan.plan.lefttree);
4500
0
  COPY_NODE_FIELD(scan.plan.righttree);
4501
0
  COPY_NODE_FIELD(scan.plan.initPlan);
4502
0
  COPY_BITMAPSET_FIELD(scan.plan.extParam);
4503
0
  COPY_BITMAPSET_FIELD(scan.plan.allParam);
4504
0
  COPY_SCALAR_FIELD(scan.scanrelid);
4505
0
  COPY_NODE_FIELD(tidrangequals);
4506
4507
0
  return newnode;
4508
0
}
4509
4510
static SubqueryScan *
4511
_copySubqueryScan(const SubqueryScan *from)
4512
0
{
4513
0
  SubqueryScan *newnode = makeNode(SubqueryScan);
4514
4515
0
  COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
4516
0
  COPY_SCALAR_FIELD(scan.plan.startup_cost);
4517
0
  COPY_SCALAR_FIELD(scan.plan.total_cost);
4518
0
  COPY_SCALAR_FIELD(scan.plan.plan_rows);
4519
0
  COPY_SCALAR_FIELD(scan.plan.plan_width);
4520
0
  COPY_SCALAR_FIELD(scan.plan.parallel_aware);
4521
0
  COPY_SCALAR_FIELD(scan.plan.parallel_safe);
4522
0
  COPY_SCALAR_FIELD(scan.plan.async_capable);
4523
0
  COPY_SCALAR_FIELD(scan.plan.plan_node_id);
4524
0
  COPY_NODE_FIELD(scan.plan.targetlist);
4525
0
  COPY_NODE_FIELD(scan.plan.qual);
4526
0
  COPY_NODE_FIELD(scan.plan.lefttree);
4527
0
  COPY_NODE_FIELD(scan.plan.righttree);
4528
0
  COPY_NODE_FIELD(scan.plan.initPlan);
4529
0
  COPY_BITMAPSET_FIELD(scan.plan.extParam);
4530
0
  COPY_BITMAPSET_FIELD(scan.plan.allParam);
4531
0
  COPY_SCALAR_FIELD(scan.scanrelid);
4532
0
  COPY_NODE_FIELD(subplan);
4533
0
  COPY_SCALAR_FIELD(scanstatus);
4534
4535
0
  return newnode;
4536
0
}
4537
4538
static FunctionScan *
4539
_copyFunctionScan(const FunctionScan *from)
4540
0
{
4541
0
  FunctionScan *newnode = makeNode(FunctionScan);
4542
4543
0
  COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
4544
0
  COPY_SCALAR_FIELD(scan.plan.startup_cost);
4545
0
  COPY_SCALAR_FIELD(scan.plan.total_cost);
4546
0
  COPY_SCALAR_FIELD(scan.plan.plan_rows);
4547
0
  COPY_SCALAR_FIELD(scan.plan.plan_width);
4548
0
  COPY_SCALAR_FIELD(scan.plan.parallel_aware);
4549
0
  COPY_SCALAR_FIELD(scan.plan.parallel_safe);
4550
0
  COPY_SCALAR_FIELD(scan.plan.async_capable);
4551
0
  COPY_SCALAR_FIELD(scan.plan.plan_node_id);
4552
0
  COPY_NODE_FIELD(scan.plan.targetlist);
4553
0
  COPY_NODE_FIELD(scan.plan.qual);
4554
0
  COPY_NODE_FIELD(scan.plan.lefttree);
4555
0
  COPY_NODE_FIELD(scan.plan.righttree);
4556
0
  COPY_NODE_FIELD(scan.plan.initPlan);
4557
0
  COPY_BITMAPSET_FIELD(scan.plan.extParam);
4558
0
  COPY_BITMAPSET_FIELD(scan.plan.allParam);
4559
0
  COPY_SCALAR_FIELD(scan.scanrelid);
4560
0
  COPY_NODE_FIELD(functions);
4561
0
  COPY_SCALAR_FIELD(funcordinality);
4562
4563
0
  return newnode;
4564
0
}
4565
4566
static ValuesScan *
4567
_copyValuesScan(const ValuesScan *from)
4568
0
{
4569
0
  ValuesScan *newnode = makeNode(ValuesScan);
4570
4571
0
  COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
4572
0
  COPY_SCALAR_FIELD(scan.plan.startup_cost);
4573
0
  COPY_SCALAR_FIELD(scan.plan.total_cost);
4574
0
  COPY_SCALAR_FIELD(scan.plan.plan_rows);
4575
0
  COPY_SCALAR_FIELD(scan.plan.plan_width);
4576
0
  COPY_SCALAR_FIELD(scan.plan.parallel_aware);
4577
0
  COPY_SCALAR_FIELD(scan.plan.parallel_safe);
4578
0
  COPY_SCALAR_FIELD(scan.plan.async_capable);
4579
0
  COPY_SCALAR_FIELD(scan.plan.plan_node_id);
4580
0
  COPY_NODE_FIELD(scan.plan.targetlist);
4581
0
  COPY_NODE_FIELD(scan.plan.qual);
4582
0
  COPY_NODE_FIELD(scan.plan.lefttree);
4583
0
  COPY_NODE_FIELD(scan.plan.righttree);
4584
0
  COPY_NODE_FIELD(scan.plan.initPlan);
4585
0
  COPY_BITMAPSET_FIELD(scan.plan.extParam);
4586
0
  COPY_BITMAPSET_FIELD(scan.plan.allParam);
4587
0
  COPY_SCALAR_FIELD(scan.scanrelid);
4588
0
  COPY_NODE_FIELD(values_lists);
4589
4590
0
  return newnode;
4591
0
}
4592
4593
static TableFuncScan *
4594
_copyTableFuncScan(const TableFuncScan *from)
4595
0
{
4596
0
  TableFuncScan *newnode = makeNode(TableFuncScan);
4597
4598
0
  COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
4599
0
  COPY_SCALAR_FIELD(scan.plan.startup_cost);
4600
0
  COPY_SCALAR_FIELD(scan.plan.total_cost);
4601
0
  COPY_SCALAR_FIELD(scan.plan.plan_rows);
4602
0
  COPY_SCALAR_FIELD(scan.plan.plan_width);
4603
0
  COPY_SCALAR_FIELD(scan.plan.parallel_aware);
4604
0
  COPY_SCALAR_FIELD(scan.plan.parallel_safe);
4605
0
  COPY_SCALAR_FIELD(scan.plan.async_capable);
4606
0
  COPY_SCALAR_FIELD(scan.plan.plan_node_id);
4607
0
  COPY_NODE_FIELD(scan.plan.targetlist);
4608
0
  COPY_NODE_FIELD(scan.plan.qual);
4609
0
  COPY_NODE_FIELD(scan.plan.lefttree);
4610
0
  COPY_NODE_FIELD(scan.plan.righttree);
4611
0
  COPY_NODE_FIELD(scan.plan.initPlan);
4612
0
  COPY_BITMAPSET_FIELD(scan.plan.extParam);
4613
0
  COPY_BITMAPSET_FIELD(scan.plan.allParam);
4614
0
  COPY_SCALAR_FIELD(scan.scanrelid);
4615
0
  COPY_NODE_FIELD(tablefunc);
4616
4617
0
  return newnode;
4618
0
}
4619
4620
static CteScan *
4621
_copyCteScan(const CteScan *from)
4622
0
{
4623
0
  CteScan *newnode = makeNode(CteScan);
4624
4625
0
  COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
4626
0
  COPY_SCALAR_FIELD(scan.plan.startup_cost);
4627
0
  COPY_SCALAR_FIELD(scan.plan.total_cost);
4628
0
  COPY_SCALAR_FIELD(scan.plan.plan_rows);
4629
0
  COPY_SCALAR_FIELD(scan.plan.plan_width);
4630
0
  COPY_SCALAR_FIELD(scan.plan.parallel_aware);
4631
0
  COPY_SCALAR_FIELD(scan.plan.parallel_safe);
4632
0
  COPY_SCALAR_FIELD(scan.plan.async_capable);
4633
0
  COPY_SCALAR_FIELD(scan.plan.plan_node_id);
4634
0
  COPY_NODE_FIELD(scan.plan.targetlist);
4635
0
  COPY_NODE_FIELD(scan.plan.qual);
4636
0
  COPY_NODE_FIELD(scan.plan.lefttree);
4637
0
  COPY_NODE_FIELD(scan.plan.righttree);
4638
0
  COPY_NODE_FIELD(scan.plan.initPlan);
4639
0
  COPY_BITMAPSET_FIELD(scan.plan.extParam);
4640
0
  COPY_BITMAPSET_FIELD(scan.plan.allParam);
4641
0
  COPY_SCALAR_FIELD(scan.scanrelid);
4642
0
  COPY_SCALAR_FIELD(ctePlanId);
4643
0
  COPY_SCALAR_FIELD(cteParam);
4644
4645
0
  return newnode;
4646
0
}
4647
4648
static NamedTuplestoreScan *
4649
_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
4650
0
{
4651
0
  NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
4652
4653
0
  COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
4654
0
  COPY_SCALAR_FIELD(scan.plan.startup_cost);
4655
0
  COPY_SCALAR_FIELD(scan.plan.total_cost);
4656
0
  COPY_SCALAR_FIELD(scan.plan.plan_rows);
4657
0
  COPY_SCALAR_FIELD(scan.plan.plan_width);
4658
0
  COPY_SCALAR_FIELD(scan.plan.parallel_aware);
4659
0
  COPY_SCALAR_FIELD(scan.plan.parallel_safe);
4660
0
  COPY_SCALAR_FIELD(scan.plan.async_capable);
4661
0
  COPY_SCALAR_FIELD(scan.plan.plan_node_id);
4662
0
  COPY_NODE_FIELD(scan.plan.targetlist);
4663
0
  COPY_NODE_FIELD(scan.plan.qual);
4664
0
  COPY_NODE_FIELD(scan.plan.lefttree);
4665
0
  COPY_NODE_FIELD(scan.plan.righttree);
4666
0
  COPY_NODE_FIELD(scan.plan.initPlan);
4667
0
  COPY_BITMAPSET_FIELD(scan.plan.extParam);
4668
0
  COPY_BITMAPSET_FIELD(scan.plan.allParam);
4669
0
  COPY_SCALAR_FIELD(scan.scanrelid);
4670
0
  COPY_STRING_FIELD(enrname);
4671
4672
0
  return newnode;
4673
0
}
4674
4675
static WorkTableScan *
4676
_copyWorkTableScan(const WorkTableScan *from)
4677
0
{
4678
0
  WorkTableScan *newnode = makeNode(WorkTableScan);
4679
4680
0
  COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
4681
0
  COPY_SCALAR_FIELD(scan.plan.startup_cost);
4682
0
  COPY_SCALAR_FIELD(scan.plan.total_cost);
4683
0
  COPY_SCALAR_FIELD(scan.plan.plan_rows);
4684
0
  COPY_SCALAR_FIELD(scan.plan.plan_width);
4685
0
  COPY_SCALAR_FIELD(scan.plan.parallel_aware);
4686
0
  COPY_SCALAR_FIELD(scan.plan.parallel_safe);
4687
0
  COPY_SCALAR_FIELD(scan.plan.async_capable);
4688
0
  COPY_SCALAR_FIELD(scan.plan.plan_node_id);
4689
0
  COPY_NODE_FIELD(scan.plan.targetlist);
4690
0
  COPY_NODE_FIELD(scan.plan.qual);
4691
0
  COPY_NODE_FIELD(scan.plan.lefttree);
4692
0
  COPY_NODE_FIELD(scan.plan.righttree);
4693
0
  COPY_NODE_FIELD(scan.plan.initPlan);
4694
0
  COPY_BITMAPSET_FIELD(scan.plan.extParam);
4695
0
  COPY_BITMAPSET_FIELD(scan.plan.allParam);
4696
0
  COPY_SCALAR_FIELD(scan.scanrelid);
4697
0
  COPY_SCALAR_FIELD(wtParam);
4698
4699
0
  return newnode;
4700
0
}
4701
4702
static ForeignScan *
4703
_copyForeignScan(const ForeignScan *from)
4704
0
{
4705
0
  ForeignScan *newnode = makeNode(ForeignScan);
4706
4707
0
  COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
4708
0
  COPY_SCALAR_FIELD(scan.plan.startup_cost);
4709
0
  COPY_SCALAR_FIELD(scan.plan.total_cost);
4710
0
  COPY_SCALAR_FIELD(scan.plan.plan_rows);
4711
0
  COPY_SCALAR_FIELD(scan.plan.plan_width);
4712
0
  COPY_SCALAR_FIELD(scan.plan.parallel_aware);
4713
0
  COPY_SCALAR_FIELD(scan.plan.parallel_safe);
4714
0
  COPY_SCALAR_FIELD(scan.plan.async_capable);
4715
0
  COPY_SCALAR_FIELD(scan.plan.plan_node_id);
4716
0
  COPY_NODE_FIELD(scan.plan.targetlist);
4717
0
  COPY_NODE_FIELD(scan.plan.qual);
4718
0
  COPY_NODE_FIELD(scan.plan.lefttree);
4719
0
  COPY_NODE_FIELD(scan.plan.righttree);
4720
0
  COPY_NODE_FIELD(scan.plan.initPlan);
4721
0
  COPY_BITMAPSET_FIELD(scan.plan.extParam);
4722
0
  COPY_BITMAPSET_FIELD(scan.plan.allParam);
4723
0
  COPY_SCALAR_FIELD(scan.scanrelid);
4724
0
  COPY_SCALAR_FIELD(operation);
4725
0
  COPY_SCALAR_FIELD(resultRelation);
4726
0
  COPY_SCALAR_FIELD(checkAsUser);
4727
0
  COPY_SCALAR_FIELD(fs_server);
4728
0
  COPY_NODE_FIELD(fdw_exprs);
4729
0
  COPY_NODE_FIELD(fdw_private);
4730
0
  COPY_NODE_FIELD(fdw_scan_tlist);
4731
0
  COPY_NODE_FIELD(fdw_recheck_quals);
4732
0
  COPY_BITMAPSET_FIELD(fs_relids);
4733
0
  COPY_BITMAPSET_FIELD(fs_base_relids);
4734
0
  COPY_SCALAR_FIELD(fsSystemCol);
4735
4736
0
  return newnode;
4737
0
}
4738
4739
static CustomScan *
4740
_copyCustomScan(const CustomScan *from)
4741
0
{
4742
0
  CustomScan *newnode = makeNode(CustomScan);
4743
4744
0
  COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
4745
0
  COPY_SCALAR_FIELD(scan.plan.startup_cost);
4746
0
  COPY_SCALAR_FIELD(scan.plan.total_cost);
4747
0
  COPY_SCALAR_FIELD(scan.plan.plan_rows);
4748
0
  COPY_SCALAR_FIELD(scan.plan.plan_width);
4749
0
  COPY_SCALAR_FIELD(scan.plan.parallel_aware);
4750
0
  COPY_SCALAR_FIELD(scan.plan.parallel_safe);
4751
0
  COPY_SCALAR_FIELD(scan.plan.async_capable);
4752
0
  COPY_SCALAR_FIELD(scan.plan.plan_node_id);
4753
0
  COPY_NODE_FIELD(scan.plan.targetlist);
4754
0
  COPY_NODE_FIELD(scan.plan.qual);
4755
0
  COPY_NODE_FIELD(scan.plan.lefttree);
4756
0
  COPY_NODE_FIELD(scan.plan.righttree);
4757
0
  COPY_NODE_FIELD(scan.plan.initPlan);
4758
0
  COPY_BITMAPSET_FIELD(scan.plan.extParam);
4759
0
  COPY_BITMAPSET_FIELD(scan.plan.allParam);
4760
0
  COPY_SCALAR_FIELD(scan.scanrelid);
4761
0
  COPY_SCALAR_FIELD(flags);
4762
0
  COPY_NODE_FIELD(custom_plans);
4763
0
  COPY_NODE_FIELD(custom_exprs);
4764
0
  COPY_NODE_FIELD(custom_private);
4765
0
  COPY_NODE_FIELD(custom_scan_tlist);
4766
0
  COPY_BITMAPSET_FIELD(custom_relids);
4767
0
  COPY_SCALAR_FIELD(methods);
4768
4769
0
  return newnode;
4770
0
}
4771
4772
static NestLoop *
4773
_copyNestLoop(const NestLoop *from)
4774
0
{
4775
0
  NestLoop *newnode = makeNode(NestLoop);
4776
4777
0
  COPY_SCALAR_FIELD(join.plan.disabled_nodes);
4778
0
  COPY_SCALAR_FIELD(join.plan.startup_cost);
4779
0
  COPY_SCALAR_FIELD(join.plan.total_cost);
4780
0
  COPY_SCALAR_FIELD(join.plan.plan_rows);
4781
0
  COPY_SCALAR_FIELD(join.plan.plan_width);
4782
0
  COPY_SCALAR_FIELD(join.plan.parallel_aware);
4783
0
  COPY_SCALAR_FIELD(join.plan.parallel_safe);
4784
0
  COPY_SCALAR_FIELD(join.plan.async_capable);
4785
0
  COPY_SCALAR_FIELD(join.plan.plan_node_id);
4786
0
  COPY_NODE_FIELD(join.plan.targetlist);
4787
0
  COPY_NODE_FIELD(join.plan.qual);
4788
0
  COPY_NODE_FIELD(join.plan.lefttree);
4789
0
  COPY_NODE_FIELD(join.plan.righttree);
4790
0
  COPY_NODE_FIELD(join.plan.initPlan);
4791
0
  COPY_BITMAPSET_FIELD(join.plan.extParam);
4792
0
  COPY_BITMAPSET_FIELD(join.plan.allParam);
4793
0
  COPY_SCALAR_FIELD(join.jointype);
4794
0
  COPY_SCALAR_FIELD(join.inner_unique);
4795
0
  COPY_NODE_FIELD(join.joinqual);
4796
0
  COPY_BITMAPSET_FIELD(join.ojrelids);
4797
0
  COPY_NODE_FIELD(nestParams);
4798
4799
0
  return newnode;
4800
0
}
4801
4802
static NestLoopParam *
4803
_copyNestLoopParam(const NestLoopParam *from)
4804
0
{
4805
0
  NestLoopParam *newnode = makeNode(NestLoopParam);
4806
4807
0
  COPY_SCALAR_FIELD(paramno);
4808
0
  COPY_NODE_FIELD(paramval);
4809
4810
0
  return newnode;
4811
0
}
4812
4813
static MergeJoin *
4814
_copyMergeJoin(const MergeJoin *from)
4815
0
{
4816
0
  MergeJoin *newnode = makeNode(MergeJoin);
4817
4818
0
  COPY_SCALAR_FIELD(join.plan.disabled_nodes);
4819
0
  COPY_SCALAR_FIELD(join.plan.startup_cost);
4820
0
  COPY_SCALAR_FIELD(join.plan.total_cost);
4821
0
  COPY_SCALAR_FIELD(join.plan.plan_rows);
4822
0
  COPY_SCALAR_FIELD(join.plan.plan_width);
4823
0
  COPY_SCALAR_FIELD(join.plan.parallel_aware);
4824
0
  COPY_SCALAR_FIELD(join.plan.parallel_safe);
4825
0
  COPY_SCALAR_FIELD(join.plan.async_capable);
4826
0
  COPY_SCALAR_FIELD(join.plan.plan_node_id);
4827
0
  COPY_NODE_FIELD(join.plan.targetlist);
4828
0
  COPY_NODE_FIELD(join.plan.qual);
4829
0
  COPY_NODE_FIELD(join.plan.lefttree);
4830
0
  COPY_NODE_FIELD(join.plan.righttree);
4831
0
  COPY_NODE_FIELD(join.plan.initPlan);
4832
0
  COPY_BITMAPSET_FIELD(join.plan.extParam);
4833
0
  COPY_BITMAPSET_FIELD(join.plan.allParam);
4834
0
  COPY_SCALAR_FIELD(join.jointype);
4835
0
  COPY_SCALAR_FIELD(join.inner_unique);
4836
0
  COPY_NODE_FIELD(join.joinqual);
4837
0
  COPY_BITMAPSET_FIELD(join.ojrelids);
4838
0
  COPY_SCALAR_FIELD(skip_mark_restore);
4839
0
  COPY_NODE_FIELD(mergeclauses);
4840
0
  COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
4841
0
  COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
4842
0
  COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
4843
0
  COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
4844
4845
0
  return newnode;
4846
0
}
4847
4848
static HashJoin *
4849
_copyHashJoin(const HashJoin *from)
4850
0
{
4851
0
  HashJoin *newnode = makeNode(HashJoin);
4852
4853
0
  COPY_SCALAR_FIELD(join.plan.disabled_nodes);
4854
0
  COPY_SCALAR_FIELD(join.plan.startup_cost);
4855
0
  COPY_SCALAR_FIELD(join.plan.total_cost);
4856
0
  COPY_SCALAR_FIELD(join.plan.plan_rows);
4857
0
  COPY_SCALAR_FIELD(join.plan.plan_width);
4858
0
  COPY_SCALAR_FIELD(join.plan.parallel_aware);
4859
0
  COPY_SCALAR_FIELD(join.plan.parallel_safe);
4860
0
  COPY_SCALAR_FIELD(join.plan.async_capable);
4861
0
  COPY_SCALAR_FIELD(join.plan.plan_node_id);
4862
0
  COPY_NODE_FIELD(join.plan.targetlist);
4863
0
  COPY_NODE_FIELD(join.plan.qual);
4864
0
  COPY_NODE_FIELD(join.plan.lefttree);
4865
0
  COPY_NODE_FIELD(join.plan.righttree);
4866
0
  COPY_NODE_FIELD(join.plan.initPlan);
4867
0
  COPY_BITMAPSET_FIELD(join.plan.extParam);
4868
0
  COPY_BITMAPSET_FIELD(join.plan.allParam);
4869
0
  COPY_SCALAR_FIELD(join.jointype);
4870
0
  COPY_SCALAR_FIELD(join.inner_unique);
4871
0
  COPY_NODE_FIELD(join.joinqual);
4872
0
  COPY_BITMAPSET_FIELD(join.ojrelids);
4873
0
  COPY_NODE_FIELD(hashclauses);
4874
0
  COPY_NODE_FIELD(hashoperators);
4875
0
  COPY_NODE_FIELD(hashcollations);
4876
0
  COPY_NODE_FIELD(hashkeys);
4877
4878
0
  return newnode;
4879
0
}
4880
4881
static Material *
4882
_copyMaterial(const Material *from)
4883
0
{
4884
0
  Material *newnode = makeNode(Material);
4885
4886
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
4887
0
  COPY_SCALAR_FIELD(plan.startup_cost);
4888
0
  COPY_SCALAR_FIELD(plan.total_cost);
4889
0
  COPY_SCALAR_FIELD(plan.plan_rows);
4890
0
  COPY_SCALAR_FIELD(plan.plan_width);
4891
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
4892
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
4893
0
  COPY_SCALAR_FIELD(plan.async_capable);
4894
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
4895
0
  COPY_NODE_FIELD(plan.targetlist);
4896
0
  COPY_NODE_FIELD(plan.qual);
4897
0
  COPY_NODE_FIELD(plan.lefttree);
4898
0
  COPY_NODE_FIELD(plan.righttree);
4899
0
  COPY_NODE_FIELD(plan.initPlan);
4900
0
  COPY_BITMAPSET_FIELD(plan.extParam);
4901
0
  COPY_BITMAPSET_FIELD(plan.allParam);
4902
4903
0
  return newnode;
4904
0
}
4905
4906
static Memoize *
4907
_copyMemoize(const Memoize *from)
4908
0
{
4909
0
  Memoize *newnode = makeNode(Memoize);
4910
4911
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
4912
0
  COPY_SCALAR_FIELD(plan.startup_cost);
4913
0
  COPY_SCALAR_FIELD(plan.total_cost);
4914
0
  COPY_SCALAR_FIELD(plan.plan_rows);
4915
0
  COPY_SCALAR_FIELD(plan.plan_width);
4916
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
4917
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
4918
0
  COPY_SCALAR_FIELD(plan.async_capable);
4919
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
4920
0
  COPY_NODE_FIELD(plan.targetlist);
4921
0
  COPY_NODE_FIELD(plan.qual);
4922
0
  COPY_NODE_FIELD(plan.lefttree);
4923
0
  COPY_NODE_FIELD(plan.righttree);
4924
0
  COPY_NODE_FIELD(plan.initPlan);
4925
0
  COPY_BITMAPSET_FIELD(plan.extParam);
4926
0
  COPY_BITMAPSET_FIELD(plan.allParam);
4927
0
  COPY_SCALAR_FIELD(numKeys);
4928
0
  COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
4929
0
  COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
4930
0
  COPY_NODE_FIELD(param_exprs);
4931
0
  COPY_SCALAR_FIELD(singlerow);
4932
0
  COPY_SCALAR_FIELD(binary_mode);
4933
0
  COPY_SCALAR_FIELD(est_entries);
4934
0
  COPY_BITMAPSET_FIELD(keyparamids);
4935
0
  COPY_SCALAR_FIELD(est_calls);
4936
0
  COPY_SCALAR_FIELD(est_unique_keys);
4937
0
  COPY_SCALAR_FIELD(est_hit_ratio);
4938
4939
0
  return newnode;
4940
0
}
4941
4942
static Sort *
4943
_copySort(const Sort *from)
4944
0
{
4945
0
  Sort *newnode = makeNode(Sort);
4946
4947
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
4948
0
  COPY_SCALAR_FIELD(plan.startup_cost);
4949
0
  COPY_SCALAR_FIELD(plan.total_cost);
4950
0
  COPY_SCALAR_FIELD(plan.plan_rows);
4951
0
  COPY_SCALAR_FIELD(plan.plan_width);
4952
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
4953
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
4954
0
  COPY_SCALAR_FIELD(plan.async_capable);
4955
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
4956
0
  COPY_NODE_FIELD(plan.targetlist);
4957
0
  COPY_NODE_FIELD(plan.qual);
4958
0
  COPY_NODE_FIELD(plan.lefttree);
4959
0
  COPY_NODE_FIELD(plan.righttree);
4960
0
  COPY_NODE_FIELD(plan.initPlan);
4961
0
  COPY_BITMAPSET_FIELD(plan.extParam);
4962
0
  COPY_BITMAPSET_FIELD(plan.allParam);
4963
0
  COPY_SCALAR_FIELD(numCols);
4964
0
  COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
4965
0
  COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
4966
0
  COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
4967
0
  COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
4968
4969
0
  return newnode;
4970
0
}
4971
4972
static IncrementalSort *
4973
_copyIncrementalSort(const IncrementalSort *from)
4974
0
{
4975
0
  IncrementalSort *newnode = makeNode(IncrementalSort);
4976
4977
0
  COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
4978
0
  COPY_SCALAR_FIELD(sort.plan.startup_cost);
4979
0
  COPY_SCALAR_FIELD(sort.plan.total_cost);
4980
0
  COPY_SCALAR_FIELD(sort.plan.plan_rows);
4981
0
  COPY_SCALAR_FIELD(sort.plan.plan_width);
4982
0
  COPY_SCALAR_FIELD(sort.plan.parallel_aware);
4983
0
  COPY_SCALAR_FIELD(sort.plan.parallel_safe);
4984
0
  COPY_SCALAR_FIELD(sort.plan.async_capable);
4985
0
  COPY_SCALAR_FIELD(sort.plan.plan_node_id);
4986
0
  COPY_NODE_FIELD(sort.plan.targetlist);
4987
0
  COPY_NODE_FIELD(sort.plan.qual);
4988
0
  COPY_NODE_FIELD(sort.plan.lefttree);
4989
0
  COPY_NODE_FIELD(sort.plan.righttree);
4990
0
  COPY_NODE_FIELD(sort.plan.initPlan);
4991
0
  COPY_BITMAPSET_FIELD(sort.plan.extParam);
4992
0
  COPY_BITMAPSET_FIELD(sort.plan.allParam);
4993
0
  COPY_SCALAR_FIELD(sort.numCols);
4994
0
  COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
4995
0
  COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
4996
0
  COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
4997
0
  COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
4998
0
  COPY_SCALAR_FIELD(nPresortedCols);
4999
0
  COPY_SCALAR_FIELD(numGroups);
5000
5001
0
  return newnode;
5002
0
}
5003
5004
static Group *
5005
_copyGroup(const Group *from)
5006
0
{
5007
0
  Group *newnode = makeNode(Group);
5008
5009
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
5010
0
  COPY_SCALAR_FIELD(plan.startup_cost);
5011
0
  COPY_SCALAR_FIELD(plan.total_cost);
5012
0
  COPY_SCALAR_FIELD(plan.plan_rows);
5013
0
  COPY_SCALAR_FIELD(plan.plan_width);
5014
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
5015
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
5016
0
  COPY_SCALAR_FIELD(plan.async_capable);
5017
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
5018
0
  COPY_NODE_FIELD(plan.targetlist);
5019
0
  COPY_NODE_FIELD(plan.qual);
5020
0
  COPY_NODE_FIELD(plan.lefttree);
5021
0
  COPY_NODE_FIELD(plan.righttree);
5022
0
  COPY_NODE_FIELD(plan.initPlan);
5023
0
  COPY_BITMAPSET_FIELD(plan.extParam);
5024
0
  COPY_BITMAPSET_FIELD(plan.allParam);
5025
0
  COPY_SCALAR_FIELD(numCols);
5026
0
  COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
5027
0
  COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
5028
0
  COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
5029
5030
0
  return newnode;
5031
0
}
5032
5033
static Agg *
5034
_copyAgg(const Agg *from)
5035
0
{
5036
0
  Agg *newnode = makeNode(Agg);
5037
5038
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
5039
0
  COPY_SCALAR_FIELD(plan.startup_cost);
5040
0
  COPY_SCALAR_FIELD(plan.total_cost);
5041
0
  COPY_SCALAR_FIELD(plan.plan_rows);
5042
0
  COPY_SCALAR_FIELD(plan.plan_width);
5043
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
5044
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
5045
0
  COPY_SCALAR_FIELD(plan.async_capable);
5046
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
5047
0
  COPY_NODE_FIELD(plan.targetlist);
5048
0
  COPY_NODE_FIELD(plan.qual);
5049
0
  COPY_NODE_FIELD(plan.lefttree);
5050
0
  COPY_NODE_FIELD(plan.righttree);
5051
0
  COPY_NODE_FIELD(plan.initPlan);
5052
0
  COPY_BITMAPSET_FIELD(plan.extParam);
5053
0
  COPY_BITMAPSET_FIELD(plan.allParam);
5054
0
  COPY_SCALAR_FIELD(aggstrategy);
5055
0
  COPY_SCALAR_FIELD(aggsplit);
5056
0
  COPY_SCALAR_FIELD(numCols);
5057
0
  COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
5058
0
  COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
5059
0
  COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
5060
0
  COPY_SCALAR_FIELD(numGroups);
5061
0
  COPY_SCALAR_FIELD(transitionSpace);
5062
0
  COPY_BITMAPSET_FIELD(aggParams);
5063
0
  COPY_NODE_FIELD(groupingSets);
5064
0
  COPY_NODE_FIELD(chain);
5065
5066
0
  return newnode;
5067
0
}
5068
5069
static WindowAgg *
5070
_copyWindowAgg(const WindowAgg *from)
5071
0
{
5072
0
  WindowAgg *newnode = makeNode(WindowAgg);
5073
5074
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
5075
0
  COPY_SCALAR_FIELD(plan.startup_cost);
5076
0
  COPY_SCALAR_FIELD(plan.total_cost);
5077
0
  COPY_SCALAR_FIELD(plan.plan_rows);
5078
0
  COPY_SCALAR_FIELD(plan.plan_width);
5079
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
5080
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
5081
0
  COPY_SCALAR_FIELD(plan.async_capable);
5082
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
5083
0
  COPY_NODE_FIELD(plan.targetlist);
5084
0
  COPY_NODE_FIELD(plan.qual);
5085
0
  COPY_NODE_FIELD(plan.lefttree);
5086
0
  COPY_NODE_FIELD(plan.righttree);
5087
0
  COPY_NODE_FIELD(plan.initPlan);
5088
0
  COPY_BITMAPSET_FIELD(plan.extParam);
5089
0
  COPY_BITMAPSET_FIELD(plan.allParam);
5090
0
  COPY_STRING_FIELD(winname);
5091
0
  COPY_SCALAR_FIELD(winref);
5092
0
  COPY_SCALAR_FIELD(partNumCols);
5093
0
  COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
5094
0
  COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
5095
0
  COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
5096
0
  COPY_SCALAR_FIELD(ordNumCols);
5097
0
  COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
5098
0
  COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
5099
0
  COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
5100
0
  COPY_SCALAR_FIELD(frameOptions);
5101
0
  COPY_NODE_FIELD(startOffset);
5102
0
  COPY_NODE_FIELD(endOffset);
5103
0
  COPY_NODE_FIELD(runCondition);
5104
0
  COPY_NODE_FIELD(runConditionOrig);
5105
0
  COPY_SCALAR_FIELD(startInRangeFunc);
5106
0
  COPY_SCALAR_FIELD(endInRangeFunc);
5107
0
  COPY_SCALAR_FIELD(inRangeColl);
5108
0
  COPY_SCALAR_FIELD(inRangeAsc);
5109
0
  COPY_SCALAR_FIELD(inRangeNullsFirst);
5110
0
  COPY_SCALAR_FIELD(topWindow);
5111
5112
0
  return newnode;
5113
0
}
5114
5115
static Unique *
5116
_copyUnique(const Unique *from)
5117
0
{
5118
0
  Unique *newnode = makeNode(Unique);
5119
5120
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
5121
0
  COPY_SCALAR_FIELD(plan.startup_cost);
5122
0
  COPY_SCALAR_FIELD(plan.total_cost);
5123
0
  COPY_SCALAR_FIELD(plan.plan_rows);
5124
0
  COPY_SCALAR_FIELD(plan.plan_width);
5125
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
5126
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
5127
0
  COPY_SCALAR_FIELD(plan.async_capable);
5128
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
5129
0
  COPY_NODE_FIELD(plan.targetlist);
5130
0
  COPY_NODE_FIELD(plan.qual);
5131
0
  COPY_NODE_FIELD(plan.lefttree);
5132
0
  COPY_NODE_FIELD(plan.righttree);
5133
0
  COPY_NODE_FIELD(plan.initPlan);
5134
0
  COPY_BITMAPSET_FIELD(plan.extParam);
5135
0
  COPY_BITMAPSET_FIELD(plan.allParam);
5136
0
  COPY_SCALAR_FIELD(numCols);
5137
0
  COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
5138
0
  COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
5139
0
  COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
5140
5141
0
  return newnode;
5142
0
}
5143
5144
static Gather *
5145
_copyGather(const Gather *from)
5146
0
{
5147
0
  Gather *newnode = makeNode(Gather);
5148
5149
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
5150
0
  COPY_SCALAR_FIELD(plan.startup_cost);
5151
0
  COPY_SCALAR_FIELD(plan.total_cost);
5152
0
  COPY_SCALAR_FIELD(plan.plan_rows);
5153
0
  COPY_SCALAR_FIELD(plan.plan_width);
5154
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
5155
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
5156
0
  COPY_SCALAR_FIELD(plan.async_capable);
5157
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
5158
0
  COPY_NODE_FIELD(plan.targetlist);
5159
0
  COPY_NODE_FIELD(plan.qual);
5160
0
  COPY_NODE_FIELD(plan.lefttree);
5161
0
  COPY_NODE_FIELD(plan.righttree);
5162
0
  COPY_NODE_FIELD(plan.initPlan);
5163
0
  COPY_BITMAPSET_FIELD(plan.extParam);
5164
0
  COPY_BITMAPSET_FIELD(plan.allParam);
5165
0
  COPY_SCALAR_FIELD(num_workers);
5166
0
  COPY_SCALAR_FIELD(rescan_param);
5167
0
  COPY_SCALAR_FIELD(single_copy);
5168
0
  COPY_SCALAR_FIELD(invisible);
5169
0
  COPY_BITMAPSET_FIELD(initParam);
5170
5171
0
  return newnode;
5172
0
}
5173
5174
static GatherMerge *
5175
_copyGatherMerge(const GatherMerge *from)
5176
0
{
5177
0
  GatherMerge *newnode = makeNode(GatherMerge);
5178
5179
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
5180
0
  COPY_SCALAR_FIELD(plan.startup_cost);
5181
0
  COPY_SCALAR_FIELD(plan.total_cost);
5182
0
  COPY_SCALAR_FIELD(plan.plan_rows);
5183
0
  COPY_SCALAR_FIELD(plan.plan_width);
5184
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
5185
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
5186
0
  COPY_SCALAR_FIELD(plan.async_capable);
5187
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
5188
0
  COPY_NODE_FIELD(plan.targetlist);
5189
0
  COPY_NODE_FIELD(plan.qual);
5190
0
  COPY_NODE_FIELD(plan.lefttree);
5191
0
  COPY_NODE_FIELD(plan.righttree);
5192
0
  COPY_NODE_FIELD(plan.initPlan);
5193
0
  COPY_BITMAPSET_FIELD(plan.extParam);
5194
0
  COPY_BITMAPSET_FIELD(plan.allParam);
5195
0
  COPY_SCALAR_FIELD(num_workers);
5196
0
  COPY_SCALAR_FIELD(rescan_param);
5197
0
  COPY_SCALAR_FIELD(numCols);
5198
0
  COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
5199
0
  COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
5200
0
  COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
5201
0
  COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
5202
0
  COPY_BITMAPSET_FIELD(initParam);
5203
5204
0
  return newnode;
5205
0
}
5206
5207
static Hash *
5208
_copyHash(const Hash *from)
5209
0
{
5210
0
  Hash *newnode = makeNode(Hash);
5211
5212
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
5213
0
  COPY_SCALAR_FIELD(plan.startup_cost);
5214
0
  COPY_SCALAR_FIELD(plan.total_cost);
5215
0
  COPY_SCALAR_FIELD(plan.plan_rows);
5216
0
  COPY_SCALAR_FIELD(plan.plan_width);
5217
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
5218
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
5219
0
  COPY_SCALAR_FIELD(plan.async_capable);
5220
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
5221
0
  COPY_NODE_FIELD(plan.targetlist);
5222
0
  COPY_NODE_FIELD(plan.qual);
5223
0
  COPY_NODE_FIELD(plan.lefttree);
5224
0
  COPY_NODE_FIELD(plan.righttree);
5225
0
  COPY_NODE_FIELD(plan.initPlan);
5226
0
  COPY_BITMAPSET_FIELD(plan.extParam);
5227
0
  COPY_BITMAPSET_FIELD(plan.allParam);
5228
0
  COPY_NODE_FIELD(hashkeys);
5229
0
  COPY_SCALAR_FIELD(skewTable);
5230
0
  COPY_SCALAR_FIELD(skewColumn);
5231
0
  COPY_SCALAR_FIELD(skewInherit);
5232
0
  COPY_SCALAR_FIELD(rows_total);
5233
5234
0
  return newnode;
5235
0
}
5236
5237
static SetOp *
5238
_copySetOp(const SetOp *from)
5239
0
{
5240
0
  SetOp *newnode = makeNode(SetOp);
5241
5242
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
5243
0
  COPY_SCALAR_FIELD(plan.startup_cost);
5244
0
  COPY_SCALAR_FIELD(plan.total_cost);
5245
0
  COPY_SCALAR_FIELD(plan.plan_rows);
5246
0
  COPY_SCALAR_FIELD(plan.plan_width);
5247
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
5248
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
5249
0
  COPY_SCALAR_FIELD(plan.async_capable);
5250
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
5251
0
  COPY_NODE_FIELD(plan.targetlist);
5252
0
  COPY_NODE_FIELD(plan.qual);
5253
0
  COPY_NODE_FIELD(plan.lefttree);
5254
0
  COPY_NODE_FIELD(plan.righttree);
5255
0
  COPY_NODE_FIELD(plan.initPlan);
5256
0
  COPY_BITMAPSET_FIELD(plan.extParam);
5257
0
  COPY_BITMAPSET_FIELD(plan.allParam);
5258
0
  COPY_SCALAR_FIELD(cmd);
5259
0
  COPY_SCALAR_FIELD(strategy);
5260
0
  COPY_SCALAR_FIELD(numCols);
5261
0
  COPY_POINTER_FIELD(cmpColIdx, from->numCols * sizeof(AttrNumber));
5262
0
  COPY_POINTER_FIELD(cmpOperators, from->numCols * sizeof(Oid));
5263
0
  COPY_POINTER_FIELD(cmpCollations, from->numCols * sizeof(Oid));
5264
0
  COPY_POINTER_FIELD(cmpNullsFirst, from->numCols * sizeof(bool));
5265
0
  COPY_SCALAR_FIELD(numGroups);
5266
5267
0
  return newnode;
5268
0
}
5269
5270
static LockRows *
5271
_copyLockRows(const LockRows *from)
5272
0
{
5273
0
  LockRows *newnode = makeNode(LockRows);
5274
5275
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
5276
0
  COPY_SCALAR_FIELD(plan.startup_cost);
5277
0
  COPY_SCALAR_FIELD(plan.total_cost);
5278
0
  COPY_SCALAR_FIELD(plan.plan_rows);
5279
0
  COPY_SCALAR_FIELD(plan.plan_width);
5280
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
5281
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
5282
0
  COPY_SCALAR_FIELD(plan.async_capable);
5283
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
5284
0
  COPY_NODE_FIELD(plan.targetlist);
5285
0
  COPY_NODE_FIELD(plan.qual);
5286
0
  COPY_NODE_FIELD(plan.lefttree);
5287
0
  COPY_NODE_FIELD(plan.righttree);
5288
0
  COPY_NODE_FIELD(plan.initPlan);
5289
0
  COPY_BITMAPSET_FIELD(plan.extParam);
5290
0
  COPY_BITMAPSET_FIELD(plan.allParam);
5291
0
  COPY_NODE_FIELD(rowMarks);
5292
0
  COPY_SCALAR_FIELD(epqParam);
5293
5294
0
  return newnode;
5295
0
}
5296
5297
static Limit *
5298
_copyLimit(const Limit *from)
5299
0
{
5300
0
  Limit *newnode = makeNode(Limit);
5301
5302
0
  COPY_SCALAR_FIELD(plan.disabled_nodes);
5303
0
  COPY_SCALAR_FIELD(plan.startup_cost);
5304
0
  COPY_SCALAR_FIELD(plan.total_cost);
5305
0
  COPY_SCALAR_FIELD(plan.plan_rows);
5306
0
  COPY_SCALAR_FIELD(plan.plan_width);
5307
0
  COPY_SCALAR_FIELD(plan.parallel_aware);
5308
0
  COPY_SCALAR_FIELD(plan.parallel_safe);
5309
0
  COPY_SCALAR_FIELD(plan.async_capable);
5310
0
  COPY_SCALAR_FIELD(plan.plan_node_id);
5311
0
  COPY_NODE_FIELD(plan.targetlist);
5312
0
  COPY_NODE_FIELD(plan.qual);
5313
0
  COPY_NODE_FIELD(plan.lefttree);
5314
0
  COPY_NODE_FIELD(plan.righttree);
5315
0
  COPY_NODE_FIELD(plan.initPlan);
5316
0
  COPY_BITMAPSET_FIELD(plan.extParam);
5317
0
  COPY_BITMAPSET_FIELD(plan.allParam);
5318
0
  COPY_NODE_FIELD(limitOffset);
5319
0
  COPY_NODE_FIELD(limitCount);
5320
0
  COPY_SCALAR_FIELD(limitOption);
5321
0
  COPY_SCALAR_FIELD(uniqNumCols);
5322
0
  COPY_POINTER_FIELD(uniqColIdx, from->uniqNumCols * sizeof(AttrNumber));
5323
0
  COPY_POINTER_FIELD(uniqOperators, from->uniqNumCols * sizeof(Oid));
5324
0
  COPY_POINTER_FIELD(uniqCollations, from->uniqNumCols * sizeof(Oid));
5325
5326
0
  return newnode;
5327
0
}
5328
5329
static PlanRowMark *
5330
_copyPlanRowMark(const PlanRowMark *from)
5331
0
{
5332
0
  PlanRowMark *newnode = makeNode(PlanRowMark);
5333
5334
0
  COPY_SCALAR_FIELD(rti);
5335
0
  COPY_SCALAR_FIELD(prti);
5336
0
  COPY_SCALAR_FIELD(rowmarkId);
5337
0
  COPY_SCALAR_FIELD(markType);
5338
0
  COPY_SCALAR_FIELD(allMarkTypes);
5339
0
  COPY_SCALAR_FIELD(strength);
5340
0
  COPY_SCALAR_FIELD(waitPolicy);
5341
0
  COPY_SCALAR_FIELD(isParent);
5342
5343
0
  return newnode;
5344
0
}
5345
5346
static PartitionPruneInfo *
5347
_copyPartitionPruneInfo(const PartitionPruneInfo *from)
5348
0
{
5349
0
  PartitionPruneInfo *newnode = makeNode(PartitionPruneInfo);
5350
5351
0
  COPY_BITMAPSET_FIELD(relids);
5352
0
  COPY_NODE_FIELD(prune_infos);
5353
0
  COPY_BITMAPSET_FIELD(other_subplans);
5354
5355
0
  return newnode;
5356
0
}
5357
5358
static PartitionedRelPruneInfo *
5359
_copyPartitionedRelPruneInfo(const PartitionedRelPruneInfo *from)
5360
0
{
5361
0
  PartitionedRelPruneInfo *newnode = makeNode(PartitionedRelPruneInfo);
5362
5363
0
  COPY_SCALAR_FIELD(rtindex);
5364
0
  COPY_BITMAPSET_FIELD(present_parts);
5365
0
  COPY_SCALAR_FIELD(nparts);
5366
0
  COPY_POINTER_FIELD(subplan_map, from->nparts * sizeof(int));
5367
0
  COPY_POINTER_FIELD(subpart_map, from->nparts * sizeof(int));
5368
0
  COPY_POINTER_FIELD(leafpart_rti_map, from->nparts * sizeof(int));
5369
0
  COPY_POINTER_FIELD(relid_map, from->nparts * sizeof(Oid));
5370
0
  COPY_NODE_FIELD(initial_pruning_steps);
5371
0
  COPY_NODE_FIELD(exec_pruning_steps);
5372
0
  COPY_BITMAPSET_FIELD(execparamids);
5373
5374
0
  return newnode;
5375
0
}
5376
5377
static PartitionPruneStepOp *
5378
_copyPartitionPruneStepOp(const PartitionPruneStepOp *from)
5379
0
{
5380
0
  PartitionPruneStepOp *newnode = makeNode(PartitionPruneStepOp);
5381
5382
0
  COPY_SCALAR_FIELD(step.step_id);
5383
0
  COPY_SCALAR_FIELD(opstrategy);
5384
0
  COPY_NODE_FIELD(exprs);
5385
0
  COPY_NODE_FIELD(cmpfns);
5386
0
  COPY_BITMAPSET_FIELD(nullkeys);
5387
5388
0
  return newnode;
5389
0
}
5390
5391
static PartitionPruneStepCombine *
5392
_copyPartitionPruneStepCombine(const PartitionPruneStepCombine *from)
5393
0
{
5394
0
  PartitionPruneStepCombine *newnode = makeNode(PartitionPruneStepCombine);
5395
5396
0
  COPY_SCALAR_FIELD(step.step_id);
5397
0
  COPY_SCALAR_FIELD(combineOp);
5398
0
  COPY_NODE_FIELD(source_stepids);
5399
5400
0
  return newnode;
5401
0
}
5402
5403
static PlanInvalItem *
5404
_copyPlanInvalItem(const PlanInvalItem *from)
5405
0
{
5406
0
  PlanInvalItem *newnode = makeNode(PlanInvalItem);
5407
5408
0
  COPY_SCALAR_FIELD(cacheId);
5409
0
  COPY_SCALAR_FIELD(hashValue);
5410
5411
0
  return newnode;
5412
0
}
5413
5414
static SubPlanRTInfo *
5415
_copySubPlanRTInfo(const SubPlanRTInfo *from)
5416
0
{
5417
0
  SubPlanRTInfo *newnode = makeNode(SubPlanRTInfo);
5418
5419
0
  COPY_STRING_FIELD(plan_name);
5420
0
  COPY_SCALAR_FIELD(rtoffset);
5421
0
  COPY_SCALAR_FIELD(dummy);
5422
5423
0
  return newnode;
5424
0
}
5425
5426
static ElidedNode *
5427
_copyElidedNode(const ElidedNode *from)
5428
0
{
5429
0
  ElidedNode *newnode = makeNode(ElidedNode);
5430
5431
0
  COPY_SCALAR_FIELD(plan_node_id);
5432
0
  COPY_SCALAR_FIELD(elided_type);
5433
0
  COPY_BITMAPSET_FIELD(relids);
5434
5435
0
  return newnode;
5436
0
}
5437
5438
static Integer *
5439
_copyInteger(const Integer *from)
5440
0
{
5441
0
  Integer *newnode = makeNode(Integer);
5442
5443
0
  COPY_SCALAR_FIELD(ival);
5444
5445
0
  return newnode;
5446
0
}
5447
5448
static Float *
5449
_copyFloat(const Float *from)
5450
0
{
5451
0
  Float *newnode = makeNode(Float);
5452
5453
0
  COPY_STRING_FIELD(fval);
5454
5455
0
  return newnode;
5456
0
}
5457
5458
static Boolean *
5459
_copyBoolean(const Boolean *from)
5460
0
{
5461
0
  Boolean *newnode = makeNode(Boolean);
5462
5463
0
  COPY_SCALAR_FIELD(boolval);
5464
5465
0
  return newnode;
5466
0
}
5467
5468
static String *
5469
_copyString(const String *from)
5470
0
{
5471
0
  String *newnode = makeNode(String);
5472
5473
0
  COPY_STRING_FIELD(sval);
5474
5475
0
  return newnode;
5476
0
}
5477
5478
static BitString *
5479
_copyBitString(const BitString *from)
5480
0
{
5481
0
  BitString *newnode = makeNode(BitString);
5482
5483
0
  COPY_STRING_FIELD(bsval);
5484
5485
0
  return newnode;
5486
0
}
5487
5488
static ForeignKeyCacheInfo *
5489
_copyForeignKeyCacheInfo(const ForeignKeyCacheInfo *from)
5490
0
{
5491
0
  ForeignKeyCacheInfo *newnode = makeNode(ForeignKeyCacheInfo);
5492
5493
0
  COPY_SCALAR_FIELD(conoid);
5494
0
  COPY_SCALAR_FIELD(conrelid);
5495
0
  COPY_SCALAR_FIELD(confrelid);
5496
0
  COPY_SCALAR_FIELD(nkeys);
5497
0
  COPY_SCALAR_FIELD(conenforced);
5498
0
  COPY_ARRAY_FIELD(conkey);
5499
0
  COPY_ARRAY_FIELD(confkey);
5500
0
  COPY_ARRAY_FIELD(conpfeqop);
5501
5502
0
  return newnode;
5503
0
}