Coverage Report

Created: 2025-10-09 06:07

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