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