Coverage Report

Created: 2025-10-09 06:07

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/postgres/bld/src/backend/nodes/outfuncs.funcs.c
Line
Count
Source
1
/*-------------------------------------------------------------------------
2
 *
3
 * outfuncs.funcs.c
4
 *    Generated node infrastructure code
5
 *
6
 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
7
 * Portions Copyright (c) 1994, Regents of the University of California
8
 *
9
 * NOTES
10
 *  ******************************
11
 *  *** DO NOT EDIT THIS FILE! ***
12
 *  ******************************
13
 *
14
 *  It has been GENERATED by src/backend/nodes/gen_node_support.pl
15
 *
16
 *-------------------------------------------------------------------------
17
 */
18
#include "access/amapi.h"
19
#include "access/cmptype.h"
20
#include "access/sdir.h"
21
#include "access/tableam.h"
22
#include "access/tsmapi.h"
23
#include "commands/event_trigger.h"
24
#include "commands/trigger.h"
25
#include "executor/tuptable.h"
26
#include "foreign/fdwapi.h"
27
#include "nodes/bitmapset.h"
28
#include "nodes/execnodes.h"
29
#include "nodes/extensible.h"
30
#include "nodes/lockoptions.h"
31
#include "nodes/miscnodes.h"
32
#include "nodes/nodes.h"
33
#include "nodes/parsenodes.h"
34
#include "nodes/pathnodes.h"
35
#include "nodes/plannodes.h"
36
#include "nodes/primnodes.h"
37
#include "nodes/replnodes.h"
38
#include "nodes/supportnodes.h"
39
#include "nodes/value.h"
40
#include "utils/rel.h"
41
42
static void
43
_outAlias(StringInfo str, const Alias *node)
44
0
{
45
0
  WRITE_NODE_TYPE("ALIAS");
46
47
0
  WRITE_STRING_FIELD(aliasname);
48
0
  WRITE_NODE_FIELD(colnames);
49
0
}
50
51
static void
52
_outRangeVar(StringInfo str, const RangeVar *node)
53
0
{
54
0
  WRITE_NODE_TYPE("RANGEVAR");
55
56
0
  WRITE_STRING_FIELD(catalogname);
57
0
  WRITE_STRING_FIELD(schemaname);
58
0
  WRITE_STRING_FIELD(relname);
59
0
  WRITE_BOOL_FIELD(inh);
60
0
  WRITE_CHAR_FIELD(relpersistence);
61
0
  WRITE_NODE_FIELD(alias);
62
0
  WRITE_LOCATION_FIELD(location);
63
0
}
64
65
static void
66
_outTableFunc(StringInfo str, const TableFunc *node)
67
0
{
68
0
  WRITE_NODE_TYPE("TABLEFUNC");
69
70
0
  WRITE_ENUM_FIELD(functype, TableFuncType);
71
0
  WRITE_NODE_FIELD(ns_uris);
72
0
  WRITE_NODE_FIELD(ns_names);
73
0
  WRITE_NODE_FIELD(docexpr);
74
0
  WRITE_NODE_FIELD(rowexpr);
75
0
  WRITE_NODE_FIELD(colnames);
76
0
  WRITE_NODE_FIELD(coltypes);
77
0
  WRITE_NODE_FIELD(coltypmods);
78
0
  WRITE_NODE_FIELD(colcollations);
79
0
  WRITE_NODE_FIELD(colexprs);
80
0
  WRITE_NODE_FIELD(coldefexprs);
81
0
  WRITE_NODE_FIELD(colvalexprs);
82
0
  WRITE_NODE_FIELD(passingvalexprs);
83
0
  WRITE_BITMAPSET_FIELD(notnulls);
84
0
  WRITE_NODE_FIELD(plan);
85
0
  WRITE_INT_FIELD(ordinalitycol);
86
0
  WRITE_LOCATION_FIELD(location);
87
0
}
88
89
static void
90
_outIntoClause(StringInfo str, const IntoClause *node)
91
0
{
92
0
  WRITE_NODE_TYPE("INTOCLAUSE");
93
94
0
  WRITE_NODE_FIELD(rel);
95
0
  WRITE_NODE_FIELD(colNames);
96
0
  WRITE_STRING_FIELD(accessMethod);
97
0
  WRITE_NODE_FIELD(options);
98
0
  WRITE_ENUM_FIELD(onCommit, OnCommitAction);
99
0
  WRITE_STRING_FIELD(tableSpaceName);
100
0
  WRITE_NODE_FIELD(viewQuery);
101
0
  WRITE_BOOL_FIELD(skipData);
102
0
}
103
104
static void
105
_outVar(StringInfo str, const Var *node)
106
0
{
107
0
  WRITE_NODE_TYPE("VAR");
108
109
0
  WRITE_INT_FIELD(varno);
110
0
  WRITE_INT_FIELD(varattno);
111
0
  WRITE_OID_FIELD(vartype);
112
0
  WRITE_INT_FIELD(vartypmod);
113
0
  WRITE_OID_FIELD(varcollid);
114
0
  WRITE_BITMAPSET_FIELD(varnullingrels);
115
0
  WRITE_UINT_FIELD(varlevelsup);
116
0
  WRITE_ENUM_FIELD(varreturningtype, VarReturningType);
117
0
  WRITE_UINT_FIELD(varnosyn);
118
0
  WRITE_INT_FIELD(varattnosyn);
119
0
  WRITE_LOCATION_FIELD(location);
120
0
}
121
122
static void
123
_outParam(StringInfo str, const Param *node)
124
0
{
125
0
  WRITE_NODE_TYPE("PARAM");
126
127
0
  WRITE_ENUM_FIELD(paramkind, ParamKind);
128
0
  WRITE_INT_FIELD(paramid);
129
0
  WRITE_OID_FIELD(paramtype);
130
0
  WRITE_INT_FIELD(paramtypmod);
131
0
  WRITE_OID_FIELD(paramcollid);
132
0
  WRITE_LOCATION_FIELD(location);
133
0
}
134
135
static void
136
_outAggref(StringInfo str, const Aggref *node)
137
0
{
138
0
  WRITE_NODE_TYPE("AGGREF");
139
140
0
  WRITE_OID_FIELD(aggfnoid);
141
0
  WRITE_OID_FIELD(aggtype);
142
0
  WRITE_OID_FIELD(aggcollid);
143
0
  WRITE_OID_FIELD(inputcollid);
144
0
  WRITE_OID_FIELD(aggtranstype);
145
0
  WRITE_NODE_FIELD(aggargtypes);
146
0
  WRITE_NODE_FIELD(aggdirectargs);
147
0
  WRITE_NODE_FIELD(args);
148
0
  WRITE_NODE_FIELD(aggorder);
149
0
  WRITE_NODE_FIELD(aggdistinct);
150
0
  WRITE_NODE_FIELD(aggfilter);
151
0
  WRITE_BOOL_FIELD(aggstar);
152
0
  WRITE_BOOL_FIELD(aggvariadic);
153
0
  WRITE_CHAR_FIELD(aggkind);
154
0
  WRITE_BOOL_FIELD(aggpresorted);
155
0
  WRITE_UINT_FIELD(agglevelsup);
156
0
  WRITE_ENUM_FIELD(aggsplit, AggSplit);
157
0
  WRITE_INT_FIELD(aggno);
158
0
  WRITE_INT_FIELD(aggtransno);
159
0
  WRITE_LOCATION_FIELD(location);
160
0
}
161
162
static void
163
_outGroupingFunc(StringInfo str, const GroupingFunc *node)
164
0
{
165
0
  WRITE_NODE_TYPE("GROUPINGFUNC");
166
167
0
  WRITE_NODE_FIELD(args);
168
0
  WRITE_NODE_FIELD(refs);
169
0
  WRITE_NODE_FIELD(cols);
170
0
  WRITE_UINT_FIELD(agglevelsup);
171
0
  WRITE_LOCATION_FIELD(location);
172
0
}
173
174
static void
175
_outWindowFunc(StringInfo str, const WindowFunc *node)
176
0
{
177
0
  WRITE_NODE_TYPE("WINDOWFUNC");
178
179
0
  WRITE_OID_FIELD(winfnoid);
180
0
  WRITE_OID_FIELD(wintype);
181
0
  WRITE_OID_FIELD(wincollid);
182
0
  WRITE_OID_FIELD(inputcollid);
183
0
  WRITE_NODE_FIELD(args);
184
0
  WRITE_NODE_FIELD(aggfilter);
185
0
  WRITE_NODE_FIELD(runCondition);
186
0
  WRITE_UINT_FIELD(winref);
187
0
  WRITE_BOOL_FIELD(winstar);
188
0
  WRITE_BOOL_FIELD(winagg);
189
0
  WRITE_INT_FIELD(ignore_nulls);
190
0
  WRITE_LOCATION_FIELD(location);
191
0
}
192
193
static void
194
_outWindowFuncRunCondition(StringInfo str, const WindowFuncRunCondition *node)
195
0
{
196
0
  WRITE_NODE_TYPE("WINDOWFUNCRUNCONDITION");
197
198
0
  WRITE_OID_FIELD(opno);
199
0
  WRITE_OID_FIELD(inputcollid);
200
0
  WRITE_BOOL_FIELD(wfunc_left);
201
0
  WRITE_NODE_FIELD(arg);
202
0
}
203
204
static void
205
_outMergeSupportFunc(StringInfo str, const MergeSupportFunc *node)
206
0
{
207
0
  WRITE_NODE_TYPE("MERGESUPPORTFUNC");
208
209
0
  WRITE_OID_FIELD(msftype);
210
0
  WRITE_OID_FIELD(msfcollid);
211
0
  WRITE_LOCATION_FIELD(location);
212
0
}
213
214
static void
215
_outSubscriptingRef(StringInfo str, const SubscriptingRef *node)
216
0
{
217
0
  WRITE_NODE_TYPE("SUBSCRIPTINGREF");
218
219
0
  WRITE_OID_FIELD(refcontainertype);
220
0
  WRITE_OID_FIELD(refelemtype);
221
0
  WRITE_OID_FIELD(refrestype);
222
0
  WRITE_INT_FIELD(reftypmod);
223
0
  WRITE_OID_FIELD(refcollid);
224
0
  WRITE_NODE_FIELD(refupperindexpr);
225
0
  WRITE_NODE_FIELD(reflowerindexpr);
226
0
  WRITE_NODE_FIELD(refexpr);
227
0
  WRITE_NODE_FIELD(refassgnexpr);
228
0
}
229
230
static void
231
_outFuncExpr(StringInfo str, const FuncExpr *node)
232
0
{
233
0
  WRITE_NODE_TYPE("FUNCEXPR");
234
235
0
  WRITE_OID_FIELD(funcid);
236
0
  WRITE_OID_FIELD(funcresulttype);
237
0
  WRITE_BOOL_FIELD(funcretset);
238
0
  WRITE_BOOL_FIELD(funcvariadic);
239
0
  WRITE_ENUM_FIELD(funcformat, CoercionForm);
240
0
  WRITE_OID_FIELD(funccollid);
241
0
  WRITE_OID_FIELD(inputcollid);
242
0
  WRITE_NODE_FIELD(args);
243
0
  WRITE_LOCATION_FIELD(location);
244
0
}
245
246
static void
247
_outNamedArgExpr(StringInfo str, const NamedArgExpr *node)
248
0
{
249
0
  WRITE_NODE_TYPE("NAMEDARGEXPR");
250
251
0
  WRITE_NODE_FIELD(arg);
252
0
  WRITE_STRING_FIELD(name);
253
0
  WRITE_INT_FIELD(argnumber);
254
0
  WRITE_LOCATION_FIELD(location);
255
0
}
256
257
static void
258
_outOpExpr(StringInfo str, const OpExpr *node)
259
0
{
260
0
  WRITE_NODE_TYPE("OPEXPR");
261
262
0
  WRITE_OID_FIELD(opno);
263
0
  WRITE_OID_FIELD(opfuncid);
264
0
  WRITE_OID_FIELD(opresulttype);
265
0
  WRITE_BOOL_FIELD(opretset);
266
0
  WRITE_OID_FIELD(opcollid);
267
0
  WRITE_OID_FIELD(inputcollid);
268
0
  WRITE_NODE_FIELD(args);
269
0
  WRITE_LOCATION_FIELD(location);
270
0
}
271
272
static void
273
_outDistinctExpr(StringInfo str, const DistinctExpr *node)
274
0
{
275
0
  WRITE_NODE_TYPE("DISTINCTEXPR");
276
277
0
  WRITE_OID_FIELD(opno);
278
0
  WRITE_OID_FIELD(opfuncid);
279
0
  WRITE_OID_FIELD(opresulttype);
280
0
  WRITE_BOOL_FIELD(opretset);
281
0
  WRITE_OID_FIELD(opcollid);
282
0
  WRITE_OID_FIELD(inputcollid);
283
0
  WRITE_NODE_FIELD(args);
284
0
  WRITE_LOCATION_FIELD(location);
285
0
}
286
287
static void
288
_outNullIfExpr(StringInfo str, const NullIfExpr *node)
289
0
{
290
0
  WRITE_NODE_TYPE("NULLIFEXPR");
291
292
0
  WRITE_OID_FIELD(opno);
293
0
  WRITE_OID_FIELD(opfuncid);
294
0
  WRITE_OID_FIELD(opresulttype);
295
0
  WRITE_BOOL_FIELD(opretset);
296
0
  WRITE_OID_FIELD(opcollid);
297
0
  WRITE_OID_FIELD(inputcollid);
298
0
  WRITE_NODE_FIELD(args);
299
0
  WRITE_LOCATION_FIELD(location);
300
0
}
301
302
static void
303
_outScalarArrayOpExpr(StringInfo str, const ScalarArrayOpExpr *node)
304
0
{
305
0
  WRITE_NODE_TYPE("SCALARARRAYOPEXPR");
306
307
0
  WRITE_OID_FIELD(opno);
308
0
  WRITE_OID_FIELD(opfuncid);
309
0
  WRITE_OID_FIELD(hashfuncid);
310
0
  WRITE_OID_FIELD(negfuncid);
311
0
  WRITE_BOOL_FIELD(useOr);
312
0
  WRITE_OID_FIELD(inputcollid);
313
0
  WRITE_NODE_FIELD(args);
314
0
  WRITE_LOCATION_FIELD(location);
315
0
}
316
317
static void
318
_outSubLink(StringInfo str, const SubLink *node)
319
0
{
320
0
  WRITE_NODE_TYPE("SUBLINK");
321
322
0
  WRITE_ENUM_FIELD(subLinkType, SubLinkType);
323
0
  WRITE_INT_FIELD(subLinkId);
324
0
  WRITE_NODE_FIELD(testexpr);
325
0
  WRITE_NODE_FIELD(operName);
326
0
  WRITE_NODE_FIELD(subselect);
327
0
  WRITE_LOCATION_FIELD(location);
328
0
}
329
330
static void
331
_outSubPlan(StringInfo str, const SubPlan *node)
332
0
{
333
0
  WRITE_NODE_TYPE("SUBPLAN");
334
335
0
  WRITE_ENUM_FIELD(subLinkType, SubLinkType);
336
0
  WRITE_NODE_FIELD(testexpr);
337
0
  WRITE_NODE_FIELD(paramIds);
338
0
  WRITE_INT_FIELD(plan_id);
339
0
  WRITE_STRING_FIELD(plan_name);
340
0
  WRITE_OID_FIELD(firstColType);
341
0
  WRITE_INT_FIELD(firstColTypmod);
342
0
  WRITE_OID_FIELD(firstColCollation);
343
0
  WRITE_BOOL_FIELD(isInitPlan);
344
0
  WRITE_BOOL_FIELD(useHashTable);
345
0
  WRITE_BOOL_FIELD(unknownEqFalse);
346
0
  WRITE_BOOL_FIELD(parallel_safe);
347
0
  WRITE_NODE_FIELD(setParam);
348
0
  WRITE_NODE_FIELD(parParam);
349
0
  WRITE_NODE_FIELD(args);
350
0
  WRITE_FLOAT_FIELD(startup_cost);
351
0
  WRITE_FLOAT_FIELD(per_call_cost);
352
0
}
353
354
static void
355
_outAlternativeSubPlan(StringInfo str, const AlternativeSubPlan *node)
356
0
{
357
0
  WRITE_NODE_TYPE("ALTERNATIVESUBPLAN");
358
359
0
  WRITE_NODE_FIELD(subplans);
360
0
}
361
362
static void
363
_outFieldSelect(StringInfo str, const FieldSelect *node)
364
0
{
365
0
  WRITE_NODE_TYPE("FIELDSELECT");
366
367
0
  WRITE_NODE_FIELD(arg);
368
0
  WRITE_INT_FIELD(fieldnum);
369
0
  WRITE_OID_FIELD(resulttype);
370
0
  WRITE_INT_FIELD(resulttypmod);
371
0
  WRITE_OID_FIELD(resultcollid);
372
0
}
373
374
static void
375
_outFieldStore(StringInfo str, const FieldStore *node)
376
0
{
377
0
  WRITE_NODE_TYPE("FIELDSTORE");
378
379
0
  WRITE_NODE_FIELD(arg);
380
0
  WRITE_NODE_FIELD(newvals);
381
0
  WRITE_NODE_FIELD(fieldnums);
382
0
  WRITE_OID_FIELD(resulttype);
383
0
}
384
385
static void
386
_outRelabelType(StringInfo str, const RelabelType *node)
387
0
{
388
0
  WRITE_NODE_TYPE("RELABELTYPE");
389
390
0
  WRITE_NODE_FIELD(arg);
391
0
  WRITE_OID_FIELD(resulttype);
392
0
  WRITE_INT_FIELD(resulttypmod);
393
0
  WRITE_OID_FIELD(resultcollid);
394
0
  WRITE_ENUM_FIELD(relabelformat, CoercionForm);
395
0
  WRITE_LOCATION_FIELD(location);
396
0
}
397
398
static void
399
_outCoerceViaIO(StringInfo str, const CoerceViaIO *node)
400
0
{
401
0
  WRITE_NODE_TYPE("COERCEVIAIO");
402
403
0
  WRITE_NODE_FIELD(arg);
404
0
  WRITE_OID_FIELD(resulttype);
405
0
  WRITE_OID_FIELD(resultcollid);
406
0
  WRITE_ENUM_FIELD(coerceformat, CoercionForm);
407
0
  WRITE_LOCATION_FIELD(location);
408
0
}
409
410
static void
411
_outArrayCoerceExpr(StringInfo str, const ArrayCoerceExpr *node)
412
0
{
413
0
  WRITE_NODE_TYPE("ARRAYCOERCEEXPR");
414
415
0
  WRITE_NODE_FIELD(arg);
416
0
  WRITE_NODE_FIELD(elemexpr);
417
0
  WRITE_OID_FIELD(resulttype);
418
0
  WRITE_INT_FIELD(resulttypmod);
419
0
  WRITE_OID_FIELD(resultcollid);
420
0
  WRITE_ENUM_FIELD(coerceformat, CoercionForm);
421
0
  WRITE_LOCATION_FIELD(location);
422
0
}
423
424
static void
425
_outConvertRowtypeExpr(StringInfo str, const ConvertRowtypeExpr *node)
426
0
{
427
0
  WRITE_NODE_TYPE("CONVERTROWTYPEEXPR");
428
429
0
  WRITE_NODE_FIELD(arg);
430
0
  WRITE_OID_FIELD(resulttype);
431
0
  WRITE_ENUM_FIELD(convertformat, CoercionForm);
432
0
  WRITE_LOCATION_FIELD(location);
433
0
}
434
435
static void
436
_outCollateExpr(StringInfo str, const CollateExpr *node)
437
0
{
438
0
  WRITE_NODE_TYPE("COLLATEEXPR");
439
440
0
  WRITE_NODE_FIELD(arg);
441
0
  WRITE_OID_FIELD(collOid);
442
0
  WRITE_LOCATION_FIELD(location);
443
0
}
444
445
static void
446
_outCaseExpr(StringInfo str, const CaseExpr *node)
447
0
{
448
0
  WRITE_NODE_TYPE("CASEEXPR");
449
450
0
  WRITE_OID_FIELD(casetype);
451
0
  WRITE_OID_FIELD(casecollid);
452
0
  WRITE_NODE_FIELD(arg);
453
0
  WRITE_NODE_FIELD(args);
454
0
  WRITE_NODE_FIELD(defresult);
455
0
  WRITE_LOCATION_FIELD(location);
456
0
}
457
458
static void
459
_outCaseWhen(StringInfo str, const CaseWhen *node)
460
0
{
461
0
  WRITE_NODE_TYPE("CASEWHEN");
462
463
0
  WRITE_NODE_FIELD(expr);
464
0
  WRITE_NODE_FIELD(result);
465
0
  WRITE_LOCATION_FIELD(location);
466
0
}
467
468
static void
469
_outCaseTestExpr(StringInfo str, const CaseTestExpr *node)
470
0
{
471
0
  WRITE_NODE_TYPE("CASETESTEXPR");
472
473
0
  WRITE_OID_FIELD(typeId);
474
0
  WRITE_INT_FIELD(typeMod);
475
0
  WRITE_OID_FIELD(collation);
476
0
}
477
478
static void
479
_outArrayExpr(StringInfo str, const ArrayExpr *node)
480
0
{
481
0
  WRITE_NODE_TYPE("ARRAYEXPR");
482
483
0
  WRITE_OID_FIELD(array_typeid);
484
0
  WRITE_OID_FIELD(array_collid);
485
0
  WRITE_OID_FIELD(element_typeid);
486
0
  WRITE_NODE_FIELD(elements);
487
0
  WRITE_BOOL_FIELD(multidims);
488
0
  WRITE_LOCATION_FIELD(list_start);
489
0
  WRITE_LOCATION_FIELD(list_end);
490
0
  WRITE_LOCATION_FIELD(location);
491
0
}
492
493
static void
494
_outRowExpr(StringInfo str, const RowExpr *node)
495
0
{
496
0
  WRITE_NODE_TYPE("ROWEXPR");
497
498
0
  WRITE_NODE_FIELD(args);
499
0
  WRITE_OID_FIELD(row_typeid);
500
0
  WRITE_ENUM_FIELD(row_format, CoercionForm);
501
0
  WRITE_NODE_FIELD(colnames);
502
0
  WRITE_LOCATION_FIELD(location);
503
0
}
504
505
static void
506
_outRowCompareExpr(StringInfo str, const RowCompareExpr *node)
507
0
{
508
0
  WRITE_NODE_TYPE("ROWCOMPAREEXPR");
509
510
0
  WRITE_ENUM_FIELD(cmptype, CompareType);
511
0
  WRITE_NODE_FIELD(opnos);
512
0
  WRITE_NODE_FIELD(opfamilies);
513
0
  WRITE_NODE_FIELD(inputcollids);
514
0
  WRITE_NODE_FIELD(largs);
515
0
  WRITE_NODE_FIELD(rargs);
516
0
}
517
518
static void
519
_outCoalesceExpr(StringInfo str, const CoalesceExpr *node)
520
0
{
521
0
  WRITE_NODE_TYPE("COALESCEEXPR");
522
523
0
  WRITE_OID_FIELD(coalescetype);
524
0
  WRITE_OID_FIELD(coalescecollid);
525
0
  WRITE_NODE_FIELD(args);
526
0
  WRITE_LOCATION_FIELD(location);
527
0
}
528
529
static void
530
_outMinMaxExpr(StringInfo str, const MinMaxExpr *node)
531
0
{
532
0
  WRITE_NODE_TYPE("MINMAXEXPR");
533
534
0
  WRITE_OID_FIELD(minmaxtype);
535
0
  WRITE_OID_FIELD(minmaxcollid);
536
0
  WRITE_OID_FIELD(inputcollid);
537
0
  WRITE_ENUM_FIELD(op, MinMaxOp);
538
0
  WRITE_NODE_FIELD(args);
539
0
  WRITE_LOCATION_FIELD(location);
540
0
}
541
542
static void
543
_outSQLValueFunction(StringInfo str, const SQLValueFunction *node)
544
0
{
545
0
  WRITE_NODE_TYPE("SQLVALUEFUNCTION");
546
547
0
  WRITE_ENUM_FIELD(op, SQLValueFunctionOp);
548
0
  WRITE_OID_FIELD(type);
549
0
  WRITE_INT_FIELD(typmod);
550
0
  WRITE_LOCATION_FIELD(location);
551
0
}
552
553
static void
554
_outXmlExpr(StringInfo str, const XmlExpr *node)
555
0
{
556
0
  WRITE_NODE_TYPE("XMLEXPR");
557
558
0
  WRITE_ENUM_FIELD(op, XmlExprOp);
559
0
  WRITE_STRING_FIELD(name);
560
0
  WRITE_NODE_FIELD(named_args);
561
0
  WRITE_NODE_FIELD(arg_names);
562
0
  WRITE_NODE_FIELD(args);
563
0
  WRITE_ENUM_FIELD(xmloption, XmlOptionType);
564
0
  WRITE_BOOL_FIELD(indent);
565
0
  WRITE_OID_FIELD(type);
566
0
  WRITE_INT_FIELD(typmod);
567
0
  WRITE_LOCATION_FIELD(location);
568
0
}
569
570
static void
571
_outJsonFormat(StringInfo str, const JsonFormat *node)
572
0
{
573
0
  WRITE_NODE_TYPE("JSONFORMAT");
574
575
0
  WRITE_ENUM_FIELD(format_type, JsonFormatType);
576
0
  WRITE_ENUM_FIELD(encoding, JsonEncoding);
577
0
  WRITE_LOCATION_FIELD(location);
578
0
}
579
580
static void
581
_outJsonReturning(StringInfo str, const JsonReturning *node)
582
0
{
583
0
  WRITE_NODE_TYPE("JSONRETURNING");
584
585
0
  WRITE_NODE_FIELD(format);
586
0
  WRITE_OID_FIELD(typid);
587
0
  WRITE_INT_FIELD(typmod);
588
0
}
589
590
static void
591
_outJsonValueExpr(StringInfo str, const JsonValueExpr *node)
592
0
{
593
0
  WRITE_NODE_TYPE("JSONVALUEEXPR");
594
595
0
  WRITE_NODE_FIELD(raw_expr);
596
0
  WRITE_NODE_FIELD(formatted_expr);
597
0
  WRITE_NODE_FIELD(format);
598
0
}
599
600
static void
601
_outJsonConstructorExpr(StringInfo str, const JsonConstructorExpr *node)
602
0
{
603
0
  WRITE_NODE_TYPE("JSONCONSTRUCTOREXPR");
604
605
0
  WRITE_ENUM_FIELD(type, JsonConstructorType);
606
0
  WRITE_NODE_FIELD(args);
607
0
  WRITE_NODE_FIELD(func);
608
0
  WRITE_NODE_FIELD(coercion);
609
0
  WRITE_NODE_FIELD(returning);
610
0
  WRITE_BOOL_FIELD(absent_on_null);
611
0
  WRITE_BOOL_FIELD(unique);
612
0
  WRITE_LOCATION_FIELD(location);
613
0
}
614
615
static void
616
_outJsonIsPredicate(StringInfo str, const JsonIsPredicate *node)
617
0
{
618
0
  WRITE_NODE_TYPE("JSONISPREDICATE");
619
620
0
  WRITE_NODE_FIELD(expr);
621
0
  WRITE_NODE_FIELD(format);
622
0
  WRITE_ENUM_FIELD(item_type, JsonValueType);
623
0
  WRITE_BOOL_FIELD(unique_keys);
624
0
  WRITE_LOCATION_FIELD(location);
625
0
}
626
627
static void
628
_outJsonBehavior(StringInfo str, const JsonBehavior *node)
629
0
{
630
0
  WRITE_NODE_TYPE("JSONBEHAVIOR");
631
632
0
  WRITE_ENUM_FIELD(btype, JsonBehaviorType);
633
0
  WRITE_NODE_FIELD(expr);
634
0
  WRITE_BOOL_FIELD(coerce);
635
0
  WRITE_LOCATION_FIELD(location);
636
0
}
637
638
static void
639
_outJsonExpr(StringInfo str, const JsonExpr *node)
640
0
{
641
0
  WRITE_NODE_TYPE("JSONEXPR");
642
643
0
  WRITE_ENUM_FIELD(op, JsonExprOp);
644
0
  WRITE_STRING_FIELD(column_name);
645
0
  WRITE_NODE_FIELD(formatted_expr);
646
0
  WRITE_NODE_FIELD(format);
647
0
  WRITE_NODE_FIELD(path_spec);
648
0
  WRITE_NODE_FIELD(returning);
649
0
  WRITE_NODE_FIELD(passing_names);
650
0
  WRITE_NODE_FIELD(passing_values);
651
0
  WRITE_NODE_FIELD(on_empty);
652
0
  WRITE_NODE_FIELD(on_error);
653
0
  WRITE_BOOL_FIELD(use_io_coercion);
654
0
  WRITE_BOOL_FIELD(use_json_coercion);
655
0
  WRITE_ENUM_FIELD(wrapper, JsonWrapper);
656
0
  WRITE_BOOL_FIELD(omit_quotes);
657
0
  WRITE_OID_FIELD(collation);
658
0
  WRITE_LOCATION_FIELD(location);
659
0
}
660
661
static void
662
_outJsonTablePath(StringInfo str, const JsonTablePath *node)
663
0
{
664
0
  WRITE_NODE_TYPE("JSONTABLEPATH");
665
666
0
  WRITE_NODE_FIELD(value);
667
0
  WRITE_STRING_FIELD(name);
668
0
}
669
670
static void
671
_outJsonTablePathScan(StringInfo str, const JsonTablePathScan *node)
672
0
{
673
0
  WRITE_NODE_TYPE("JSONTABLEPATHSCAN");
674
675
0
  WRITE_NODE_FIELD(path);
676
0
  WRITE_BOOL_FIELD(errorOnError);
677
0
  WRITE_NODE_FIELD(child);
678
0
  WRITE_INT_FIELD(colMin);
679
0
  WRITE_INT_FIELD(colMax);
680
0
}
681
682
static void
683
_outJsonTableSiblingJoin(StringInfo str, const JsonTableSiblingJoin *node)
684
0
{
685
0
  WRITE_NODE_TYPE("JSONTABLESIBLINGJOIN");
686
687
0
  WRITE_NODE_FIELD(lplan);
688
0
  WRITE_NODE_FIELD(rplan);
689
0
}
690
691
static void
692
_outNullTest(StringInfo str, const NullTest *node)
693
0
{
694
0
  WRITE_NODE_TYPE("NULLTEST");
695
696
0
  WRITE_NODE_FIELD(arg);
697
0
  WRITE_ENUM_FIELD(nulltesttype, NullTestType);
698
0
  WRITE_BOOL_FIELD(argisrow);
699
0
  WRITE_LOCATION_FIELD(location);
700
0
}
701
702
static void
703
_outBooleanTest(StringInfo str, const BooleanTest *node)
704
0
{
705
0
  WRITE_NODE_TYPE("BOOLEANTEST");
706
707
0
  WRITE_NODE_FIELD(arg);
708
0
  WRITE_ENUM_FIELD(booltesttype, BoolTestType);
709
0
  WRITE_LOCATION_FIELD(location);
710
0
}
711
712
static void
713
_outMergeAction(StringInfo str, const MergeAction *node)
714
0
{
715
0
  WRITE_NODE_TYPE("MERGEACTION");
716
717
0
  WRITE_ENUM_FIELD(matchKind, MergeMatchKind);
718
0
  WRITE_ENUM_FIELD(commandType, CmdType);
719
0
  WRITE_ENUM_FIELD(override, OverridingKind);
720
0
  WRITE_NODE_FIELD(qual);
721
0
  WRITE_NODE_FIELD(targetList);
722
0
  WRITE_NODE_FIELD(updateColnos);
723
0
}
724
725
static void
726
_outCoerceToDomain(StringInfo str, const CoerceToDomain *node)
727
0
{
728
0
  WRITE_NODE_TYPE("COERCETODOMAIN");
729
730
0
  WRITE_NODE_FIELD(arg);
731
0
  WRITE_OID_FIELD(resulttype);
732
0
  WRITE_INT_FIELD(resulttypmod);
733
0
  WRITE_OID_FIELD(resultcollid);
734
0
  WRITE_ENUM_FIELD(coercionformat, CoercionForm);
735
0
  WRITE_LOCATION_FIELD(location);
736
0
}
737
738
static void
739
_outCoerceToDomainValue(StringInfo str, const CoerceToDomainValue *node)
740
0
{
741
0
  WRITE_NODE_TYPE("COERCETODOMAINVALUE");
742
743
0
  WRITE_OID_FIELD(typeId);
744
0
  WRITE_INT_FIELD(typeMod);
745
0
  WRITE_OID_FIELD(collation);
746
0
  WRITE_LOCATION_FIELD(location);
747
0
}
748
749
static void
750
_outSetToDefault(StringInfo str, const SetToDefault *node)
751
0
{
752
0
  WRITE_NODE_TYPE("SETTODEFAULT");
753
754
0
  WRITE_OID_FIELD(typeId);
755
0
  WRITE_INT_FIELD(typeMod);
756
0
  WRITE_OID_FIELD(collation);
757
0
  WRITE_LOCATION_FIELD(location);
758
0
}
759
760
static void
761
_outCurrentOfExpr(StringInfo str, const CurrentOfExpr *node)
762
0
{
763
0
  WRITE_NODE_TYPE("CURRENTOFEXPR");
764
765
0
  WRITE_UINT_FIELD(cvarno);
766
0
  WRITE_STRING_FIELD(cursor_name);
767
0
  WRITE_INT_FIELD(cursor_param);
768
0
}
769
770
static void
771
_outNextValueExpr(StringInfo str, const NextValueExpr *node)
772
0
{
773
0
  WRITE_NODE_TYPE("NEXTVALUEEXPR");
774
775
0
  WRITE_OID_FIELD(seqid);
776
0
  WRITE_OID_FIELD(typeId);
777
0
}
778
779
static void
780
_outInferenceElem(StringInfo str, const InferenceElem *node)
781
0
{
782
0
  WRITE_NODE_TYPE("INFERENCEELEM");
783
784
0
  WRITE_NODE_FIELD(expr);
785
0
  WRITE_OID_FIELD(infercollid);
786
0
  WRITE_OID_FIELD(inferopclass);
787
0
}
788
789
static void
790
_outReturningExpr(StringInfo str, const ReturningExpr *node)
791
0
{
792
0
  WRITE_NODE_TYPE("RETURNINGEXPR");
793
794
0
  WRITE_INT_FIELD(retlevelsup);
795
0
  WRITE_BOOL_FIELD(retold);
796
0
  WRITE_NODE_FIELD(retexpr);
797
0
}
798
799
static void
800
_outTargetEntry(StringInfo str, const TargetEntry *node)
801
0
{
802
0
  WRITE_NODE_TYPE("TARGETENTRY");
803
804
0
  WRITE_NODE_FIELD(expr);
805
0
  WRITE_INT_FIELD(resno);
806
0
  WRITE_STRING_FIELD(resname);
807
0
  WRITE_UINT_FIELD(ressortgroupref);
808
0
  WRITE_OID_FIELD(resorigtbl);
809
0
  WRITE_INT_FIELD(resorigcol);
810
0
  WRITE_BOOL_FIELD(resjunk);
811
0
}
812
813
static void
814
_outRangeTblRef(StringInfo str, const RangeTblRef *node)
815
0
{
816
0
  WRITE_NODE_TYPE("RANGETBLREF");
817
818
0
  WRITE_INT_FIELD(rtindex);
819
0
}
820
821
static void
822
_outJoinExpr(StringInfo str, const JoinExpr *node)
823
0
{
824
0
  WRITE_NODE_TYPE("JOINEXPR");
825
826
0
  WRITE_ENUM_FIELD(jointype, JoinType);
827
0
  WRITE_BOOL_FIELD(isNatural);
828
0
  WRITE_NODE_FIELD(larg);
829
0
  WRITE_NODE_FIELD(rarg);
830
0
  WRITE_NODE_FIELD(usingClause);
831
0
  WRITE_NODE_FIELD(join_using_alias);
832
0
  WRITE_NODE_FIELD(quals);
833
0
  WRITE_NODE_FIELD(alias);
834
0
  WRITE_INT_FIELD(rtindex);
835
0
}
836
837
static void
838
_outFromExpr(StringInfo str, const FromExpr *node)
839
0
{
840
0
  WRITE_NODE_TYPE("FROMEXPR");
841
842
0
  WRITE_NODE_FIELD(fromlist);
843
0
  WRITE_NODE_FIELD(quals);
844
0
}
845
846
static void
847
_outOnConflictExpr(StringInfo str, const OnConflictExpr *node)
848
0
{
849
0
  WRITE_NODE_TYPE("ONCONFLICTEXPR");
850
851
0
  WRITE_ENUM_FIELD(action, OnConflictAction);
852
0
  WRITE_NODE_FIELD(arbiterElems);
853
0
  WRITE_NODE_FIELD(arbiterWhere);
854
0
  WRITE_OID_FIELD(constraint);
855
0
  WRITE_NODE_FIELD(onConflictSet);
856
0
  WRITE_NODE_FIELD(onConflictWhere);
857
0
  WRITE_INT_FIELD(exclRelIndex);
858
0
  WRITE_NODE_FIELD(exclRelTlist);
859
0
}
860
861
static void
862
_outQuery(StringInfo str, const Query *node)
863
0
{
864
0
  WRITE_NODE_TYPE("QUERY");
865
866
0
  WRITE_ENUM_FIELD(commandType, CmdType);
867
0
  WRITE_ENUM_FIELD(querySource, QuerySource);
868
0
  WRITE_BOOL_FIELD(canSetTag);
869
0
  WRITE_NODE_FIELD(utilityStmt);
870
0
  WRITE_INT_FIELD(resultRelation);
871
0
  WRITE_BOOL_FIELD(hasAggs);
872
0
  WRITE_BOOL_FIELD(hasWindowFuncs);
873
0
  WRITE_BOOL_FIELD(hasTargetSRFs);
874
0
  WRITE_BOOL_FIELD(hasSubLinks);
875
0
  WRITE_BOOL_FIELD(hasDistinctOn);
876
0
  WRITE_BOOL_FIELD(hasRecursive);
877
0
  WRITE_BOOL_FIELD(hasModifyingCTE);
878
0
  WRITE_BOOL_FIELD(hasForUpdate);
879
0
  WRITE_BOOL_FIELD(hasRowSecurity);
880
0
  WRITE_BOOL_FIELD(hasGroupRTE);
881
0
  WRITE_BOOL_FIELD(isReturn);
882
0
  WRITE_NODE_FIELD(cteList);
883
0
  WRITE_NODE_FIELD(rtable);
884
0
  WRITE_NODE_FIELD(rteperminfos);
885
0
  WRITE_NODE_FIELD(jointree);
886
0
  WRITE_NODE_FIELD(mergeActionList);
887
0
  WRITE_INT_FIELD(mergeTargetRelation);
888
0
  WRITE_NODE_FIELD(mergeJoinCondition);
889
0
  WRITE_NODE_FIELD(targetList);
890
0
  WRITE_ENUM_FIELD(override, OverridingKind);
891
0
  WRITE_NODE_FIELD(onConflict);
892
0
  WRITE_STRING_FIELD(returningOldAlias);
893
0
  WRITE_STRING_FIELD(returningNewAlias);
894
0
  WRITE_NODE_FIELD(returningList);
895
0
  WRITE_NODE_FIELD(groupClause);
896
0
  WRITE_BOOL_FIELD(groupDistinct);
897
0
  WRITE_BOOL_FIELD(groupByAll);
898
0
  WRITE_NODE_FIELD(groupingSets);
899
0
  WRITE_NODE_FIELD(havingQual);
900
0
  WRITE_NODE_FIELD(windowClause);
901
0
  WRITE_NODE_FIELD(distinctClause);
902
0
  WRITE_NODE_FIELD(sortClause);
903
0
  WRITE_NODE_FIELD(limitOffset);
904
0
  WRITE_NODE_FIELD(limitCount);
905
0
  WRITE_ENUM_FIELD(limitOption, LimitOption);
906
0
  WRITE_NODE_FIELD(rowMarks);
907
0
  WRITE_NODE_FIELD(setOperations);
908
0
  WRITE_NODE_FIELD(constraintDeps);
909
0
  WRITE_NODE_FIELD(withCheckOptions);
910
0
  WRITE_LOCATION_FIELD(stmt_location);
911
0
  WRITE_LOCATION_FIELD(stmt_len);
912
0
}
913
914
static void
915
_outTypeName(StringInfo str, const TypeName *node)
916
0
{
917
0
  WRITE_NODE_TYPE("TYPENAME");
918
919
0
  WRITE_NODE_FIELD(names);
920
0
  WRITE_OID_FIELD(typeOid);
921
0
  WRITE_BOOL_FIELD(setof);
922
0
  WRITE_BOOL_FIELD(pct_type);
923
0
  WRITE_NODE_FIELD(typmods);
924
0
  WRITE_INT_FIELD(typemod);
925
0
  WRITE_NODE_FIELD(arrayBounds);
926
0
  WRITE_LOCATION_FIELD(location);
927
0
}
928
929
static void
930
_outColumnRef(StringInfo str, const ColumnRef *node)
931
0
{
932
0
  WRITE_NODE_TYPE("COLUMNREF");
933
934
0
  WRITE_NODE_FIELD(fields);
935
0
  WRITE_LOCATION_FIELD(location);
936
0
}
937
938
static void
939
_outParamRef(StringInfo str, const ParamRef *node)
940
0
{
941
0
  WRITE_NODE_TYPE("PARAMREF");
942
943
0
  WRITE_INT_FIELD(number);
944
0
  WRITE_LOCATION_FIELD(location);
945
0
}
946
947
static void
948
_outTypeCast(StringInfo str, const TypeCast *node)
949
0
{
950
0
  WRITE_NODE_TYPE("TYPECAST");
951
952
0
  WRITE_NODE_FIELD(arg);
953
0
  WRITE_NODE_FIELD(typeName);
954
0
  WRITE_LOCATION_FIELD(location);
955
0
}
956
957
static void
958
_outCollateClause(StringInfo str, const CollateClause *node)
959
0
{
960
0
  WRITE_NODE_TYPE("COLLATECLAUSE");
961
962
0
  WRITE_NODE_FIELD(arg);
963
0
  WRITE_NODE_FIELD(collname);
964
0
  WRITE_LOCATION_FIELD(location);
965
0
}
966
967
static void
968
_outRoleSpec(StringInfo str, const RoleSpec *node)
969
0
{
970
0
  WRITE_NODE_TYPE("ROLESPEC");
971
972
0
  WRITE_ENUM_FIELD(roletype, RoleSpecType);
973
0
  WRITE_STRING_FIELD(rolename);
974
0
  WRITE_LOCATION_FIELD(location);
975
0
}
976
977
static void
978
_outFuncCall(StringInfo str, const FuncCall *node)
979
0
{
980
0
  WRITE_NODE_TYPE("FUNCCALL");
981
982
0
  WRITE_NODE_FIELD(funcname);
983
0
  WRITE_NODE_FIELD(args);
984
0
  WRITE_NODE_FIELD(agg_order);
985
0
  WRITE_NODE_FIELD(agg_filter);
986
0
  WRITE_NODE_FIELD(over);
987
0
  WRITE_INT_FIELD(ignore_nulls);
988
0
  WRITE_BOOL_FIELD(agg_within_group);
989
0
  WRITE_BOOL_FIELD(agg_star);
990
0
  WRITE_BOOL_FIELD(agg_distinct);
991
0
  WRITE_BOOL_FIELD(func_variadic);
992
0
  WRITE_ENUM_FIELD(funcformat, CoercionForm);
993
0
  WRITE_LOCATION_FIELD(location);
994
0
}
995
996
static void
997
_outA_Star(StringInfo str, const A_Star *node)
998
0
{
999
0
  WRITE_NODE_TYPE("A_STAR");
1000
1001
0
}
1002
1003
static void
1004
_outA_Indices(StringInfo str, const A_Indices *node)
1005
0
{
1006
0
  WRITE_NODE_TYPE("A_INDICES");
1007
1008
0
  WRITE_BOOL_FIELD(is_slice);
1009
0
  WRITE_NODE_FIELD(lidx);
1010
0
  WRITE_NODE_FIELD(uidx);
1011
0
}
1012
1013
static void
1014
_outA_Indirection(StringInfo str, const A_Indirection *node)
1015
0
{
1016
0
  WRITE_NODE_TYPE("A_INDIRECTION");
1017
1018
0
  WRITE_NODE_FIELD(arg);
1019
0
  WRITE_NODE_FIELD(indirection);
1020
0
}
1021
1022
static void
1023
_outA_ArrayExpr(StringInfo str, const A_ArrayExpr *node)
1024
0
{
1025
0
  WRITE_NODE_TYPE("A_ARRAYEXPR");
1026
1027
0
  WRITE_NODE_FIELD(elements);
1028
0
  WRITE_LOCATION_FIELD(list_start);
1029
0
  WRITE_LOCATION_FIELD(list_end);
1030
0
  WRITE_LOCATION_FIELD(location);
1031
0
}
1032
1033
static void
1034
_outResTarget(StringInfo str, const ResTarget *node)
1035
0
{
1036
0
  WRITE_NODE_TYPE("RESTARGET");
1037
1038
0
  WRITE_STRING_FIELD(name);
1039
0
  WRITE_NODE_FIELD(indirection);
1040
0
  WRITE_NODE_FIELD(val);
1041
0
  WRITE_LOCATION_FIELD(location);
1042
0
}
1043
1044
static void
1045
_outMultiAssignRef(StringInfo str, const MultiAssignRef *node)
1046
0
{
1047
0
  WRITE_NODE_TYPE("MULTIASSIGNREF");
1048
1049
0
  WRITE_NODE_FIELD(source);
1050
0
  WRITE_INT_FIELD(colno);
1051
0
  WRITE_INT_FIELD(ncolumns);
1052
0
}
1053
1054
static void
1055
_outSortBy(StringInfo str, const SortBy *node)
1056
0
{
1057
0
  WRITE_NODE_TYPE("SORTBY");
1058
1059
0
  WRITE_NODE_FIELD(node);
1060
0
  WRITE_ENUM_FIELD(sortby_dir, SortByDir);
1061
0
  WRITE_ENUM_FIELD(sortby_nulls, SortByNulls);
1062
0
  WRITE_NODE_FIELD(useOp);
1063
0
  WRITE_LOCATION_FIELD(location);
1064
0
}
1065
1066
static void
1067
_outWindowDef(StringInfo str, const WindowDef *node)
1068
0
{
1069
0
  WRITE_NODE_TYPE("WINDOWDEF");
1070
1071
0
  WRITE_STRING_FIELD(name);
1072
0
  WRITE_STRING_FIELD(refname);
1073
0
  WRITE_NODE_FIELD(partitionClause);
1074
0
  WRITE_NODE_FIELD(orderClause);
1075
0
  WRITE_INT_FIELD(frameOptions);
1076
0
  WRITE_NODE_FIELD(startOffset);
1077
0
  WRITE_NODE_FIELD(endOffset);
1078
0
  WRITE_LOCATION_FIELD(location);
1079
0
}
1080
1081
static void
1082
_outRangeSubselect(StringInfo str, const RangeSubselect *node)
1083
0
{
1084
0
  WRITE_NODE_TYPE("RANGESUBSELECT");
1085
1086
0
  WRITE_BOOL_FIELD(lateral);
1087
0
  WRITE_NODE_FIELD(subquery);
1088
0
  WRITE_NODE_FIELD(alias);
1089
0
}
1090
1091
static void
1092
_outRangeFunction(StringInfo str, const RangeFunction *node)
1093
0
{
1094
0
  WRITE_NODE_TYPE("RANGEFUNCTION");
1095
1096
0
  WRITE_BOOL_FIELD(lateral);
1097
0
  WRITE_BOOL_FIELD(ordinality);
1098
0
  WRITE_BOOL_FIELD(is_rowsfrom);
1099
0
  WRITE_NODE_FIELD(functions);
1100
0
  WRITE_NODE_FIELD(alias);
1101
0
  WRITE_NODE_FIELD(coldeflist);
1102
0
}
1103
1104
static void
1105
_outRangeTableFunc(StringInfo str, const RangeTableFunc *node)
1106
0
{
1107
0
  WRITE_NODE_TYPE("RANGETABLEFUNC");
1108
1109
0
  WRITE_BOOL_FIELD(lateral);
1110
0
  WRITE_NODE_FIELD(docexpr);
1111
0
  WRITE_NODE_FIELD(rowexpr);
1112
0
  WRITE_NODE_FIELD(namespaces);
1113
0
  WRITE_NODE_FIELD(columns);
1114
0
  WRITE_NODE_FIELD(alias);
1115
0
  WRITE_LOCATION_FIELD(location);
1116
0
}
1117
1118
static void
1119
_outRangeTableFuncCol(StringInfo str, const RangeTableFuncCol *node)
1120
0
{
1121
0
  WRITE_NODE_TYPE("RANGETABLEFUNCCOL");
1122
1123
0
  WRITE_STRING_FIELD(colname);
1124
0
  WRITE_NODE_FIELD(typeName);
1125
0
  WRITE_BOOL_FIELD(for_ordinality);
1126
0
  WRITE_BOOL_FIELD(is_not_null);
1127
0
  WRITE_NODE_FIELD(colexpr);
1128
0
  WRITE_NODE_FIELD(coldefexpr);
1129
0
  WRITE_LOCATION_FIELD(location);
1130
0
}
1131
1132
static void
1133
_outRangeTableSample(StringInfo str, const RangeTableSample *node)
1134
0
{
1135
0
  WRITE_NODE_TYPE("RANGETABLESAMPLE");
1136
1137
0
  WRITE_NODE_FIELD(relation);
1138
0
  WRITE_NODE_FIELD(method);
1139
0
  WRITE_NODE_FIELD(args);
1140
0
  WRITE_NODE_FIELD(repeatable);
1141
0
  WRITE_LOCATION_FIELD(location);
1142
0
}
1143
1144
static void
1145
_outColumnDef(StringInfo str, const ColumnDef *node)
1146
0
{
1147
0
  WRITE_NODE_TYPE("COLUMNDEF");
1148
1149
0
  WRITE_STRING_FIELD(colname);
1150
0
  WRITE_NODE_FIELD(typeName);
1151
0
  WRITE_STRING_FIELD(compression);
1152
0
  WRITE_INT_FIELD(inhcount);
1153
0
  WRITE_BOOL_FIELD(is_local);
1154
0
  WRITE_BOOL_FIELD(is_not_null);
1155
0
  WRITE_BOOL_FIELD(is_from_type);
1156
0
  WRITE_CHAR_FIELD(storage);
1157
0
  WRITE_STRING_FIELD(storage_name);
1158
0
  WRITE_NODE_FIELD(raw_default);
1159
0
  WRITE_NODE_FIELD(cooked_default);
1160
0
  WRITE_CHAR_FIELD(identity);
1161
0
  WRITE_NODE_FIELD(identitySequence);
1162
0
  WRITE_CHAR_FIELD(generated);
1163
0
  WRITE_NODE_FIELD(collClause);
1164
0
  WRITE_OID_FIELD(collOid);
1165
0
  WRITE_NODE_FIELD(constraints);
1166
0
  WRITE_NODE_FIELD(fdwoptions);
1167
0
  WRITE_LOCATION_FIELD(location);
1168
0
}
1169
1170
static void
1171
_outTableLikeClause(StringInfo str, const TableLikeClause *node)
1172
0
{
1173
0
  WRITE_NODE_TYPE("TABLELIKECLAUSE");
1174
1175
0
  WRITE_NODE_FIELD(relation);
1176
0
  WRITE_UINT_FIELD(options);
1177
0
  WRITE_OID_FIELD(relationOid);
1178
0
}
1179
1180
static void
1181
_outIndexElem(StringInfo str, const IndexElem *node)
1182
0
{
1183
0
  WRITE_NODE_TYPE("INDEXELEM");
1184
1185
0
  WRITE_STRING_FIELD(name);
1186
0
  WRITE_NODE_FIELD(expr);
1187
0
  WRITE_STRING_FIELD(indexcolname);
1188
0
  WRITE_NODE_FIELD(collation);
1189
0
  WRITE_NODE_FIELD(opclass);
1190
0
  WRITE_NODE_FIELD(opclassopts);
1191
0
  WRITE_ENUM_FIELD(ordering, SortByDir);
1192
0
  WRITE_ENUM_FIELD(nulls_ordering, SortByNulls);
1193
0
}
1194
1195
static void
1196
_outDefElem(StringInfo str, const DefElem *node)
1197
0
{
1198
0
  WRITE_NODE_TYPE("DEFELEM");
1199
1200
0
  WRITE_STRING_FIELD(defnamespace);
1201
0
  WRITE_STRING_FIELD(defname);
1202
0
  WRITE_NODE_FIELD(arg);
1203
0
  WRITE_ENUM_FIELD(defaction, DefElemAction);
1204
0
  WRITE_LOCATION_FIELD(location);
1205
0
}
1206
1207
static void
1208
_outLockingClause(StringInfo str, const LockingClause *node)
1209
0
{
1210
0
  WRITE_NODE_TYPE("LOCKINGCLAUSE");
1211
1212
0
  WRITE_NODE_FIELD(lockedRels);
1213
0
  WRITE_ENUM_FIELD(strength, LockClauseStrength);
1214
0
  WRITE_ENUM_FIELD(waitPolicy, LockWaitPolicy);
1215
0
}
1216
1217
static void
1218
_outXmlSerialize(StringInfo str, const XmlSerialize *node)
1219
0
{
1220
0
  WRITE_NODE_TYPE("XMLSERIALIZE");
1221
1222
0
  WRITE_ENUM_FIELD(xmloption, XmlOptionType);
1223
0
  WRITE_NODE_FIELD(expr);
1224
0
  WRITE_NODE_FIELD(typeName);
1225
0
  WRITE_BOOL_FIELD(indent);
1226
0
  WRITE_LOCATION_FIELD(location);
1227
0
}
1228
1229
static void
1230
_outPartitionElem(StringInfo str, const PartitionElem *node)
1231
0
{
1232
0
  WRITE_NODE_TYPE("PARTITIONELEM");
1233
1234
0
  WRITE_STRING_FIELD(name);
1235
0
  WRITE_NODE_FIELD(expr);
1236
0
  WRITE_NODE_FIELD(collation);
1237
0
  WRITE_NODE_FIELD(opclass);
1238
0
  WRITE_LOCATION_FIELD(location);
1239
0
}
1240
1241
static void
1242
_outPartitionSpec(StringInfo str, const PartitionSpec *node)
1243
0
{
1244
0
  WRITE_NODE_TYPE("PARTITIONSPEC");
1245
1246
0
  WRITE_ENUM_FIELD(strategy, PartitionStrategy);
1247
0
  WRITE_NODE_FIELD(partParams);
1248
0
  WRITE_LOCATION_FIELD(location);
1249
0
}
1250
1251
static void
1252
_outPartitionBoundSpec(StringInfo str, const PartitionBoundSpec *node)
1253
0
{
1254
0
  WRITE_NODE_TYPE("PARTITIONBOUNDSPEC");
1255
1256
0
  WRITE_CHAR_FIELD(strategy);
1257
0
  WRITE_BOOL_FIELD(is_default);
1258
0
  WRITE_INT_FIELD(modulus);
1259
0
  WRITE_INT_FIELD(remainder);
1260
0
  WRITE_NODE_FIELD(listdatums);
1261
0
  WRITE_NODE_FIELD(lowerdatums);
1262
0
  WRITE_NODE_FIELD(upperdatums);
1263
0
  WRITE_LOCATION_FIELD(location);
1264
0
}
1265
1266
static void
1267
_outPartitionRangeDatum(StringInfo str, const PartitionRangeDatum *node)
1268
0
{
1269
0
  WRITE_NODE_TYPE("PARTITIONRANGEDATUM");
1270
1271
0
  WRITE_ENUM_FIELD(kind, PartitionRangeDatumKind);
1272
0
  WRITE_NODE_FIELD(value);
1273
0
  WRITE_LOCATION_FIELD(location);
1274
0
}
1275
1276
static void
1277
_outPartitionCmd(StringInfo str, const PartitionCmd *node)
1278
0
{
1279
0
  WRITE_NODE_TYPE("PARTITIONCMD");
1280
1281
0
  WRITE_NODE_FIELD(name);
1282
0
  WRITE_NODE_FIELD(bound);
1283
0
  WRITE_BOOL_FIELD(concurrent);
1284
0
}
1285
1286
static void
1287
_outRTEPermissionInfo(StringInfo str, const RTEPermissionInfo *node)
1288
0
{
1289
0
  WRITE_NODE_TYPE("RTEPERMISSIONINFO");
1290
1291
0
  WRITE_OID_FIELD(relid);
1292
0
  WRITE_BOOL_FIELD(inh);
1293
0
  WRITE_UINT64_FIELD(requiredPerms);
1294
0
  WRITE_OID_FIELD(checkAsUser);
1295
0
  WRITE_BITMAPSET_FIELD(selectedCols);
1296
0
  WRITE_BITMAPSET_FIELD(insertedCols);
1297
0
  WRITE_BITMAPSET_FIELD(updatedCols);
1298
0
}
1299
1300
static void
1301
_outRangeTblFunction(StringInfo str, const RangeTblFunction *node)
1302
0
{
1303
0
  WRITE_NODE_TYPE("RANGETBLFUNCTION");
1304
1305
0
  WRITE_NODE_FIELD(funcexpr);
1306
0
  WRITE_INT_FIELD(funccolcount);
1307
0
  WRITE_NODE_FIELD(funccolnames);
1308
0
  WRITE_NODE_FIELD(funccoltypes);
1309
0
  WRITE_NODE_FIELD(funccoltypmods);
1310
0
  WRITE_NODE_FIELD(funccolcollations);
1311
0
  WRITE_BITMAPSET_FIELD(funcparams);
1312
0
}
1313
1314
static void
1315
_outTableSampleClause(StringInfo str, const TableSampleClause *node)
1316
0
{
1317
0
  WRITE_NODE_TYPE("TABLESAMPLECLAUSE");
1318
1319
0
  WRITE_OID_FIELD(tsmhandler);
1320
0
  WRITE_NODE_FIELD(args);
1321
0
  WRITE_NODE_FIELD(repeatable);
1322
0
}
1323
1324
static void
1325
_outWithCheckOption(StringInfo str, const WithCheckOption *node)
1326
0
{
1327
0
  WRITE_NODE_TYPE("WITHCHECKOPTION");
1328
1329
0
  WRITE_ENUM_FIELD(kind, WCOKind);
1330
0
  WRITE_STRING_FIELD(relname);
1331
0
  WRITE_STRING_FIELD(polname);
1332
0
  WRITE_NODE_FIELD(qual);
1333
0
  WRITE_BOOL_FIELD(cascaded);
1334
0
}
1335
1336
static void
1337
_outSortGroupClause(StringInfo str, const SortGroupClause *node)
1338
0
{
1339
0
  WRITE_NODE_TYPE("SORTGROUPCLAUSE");
1340
1341
0
  WRITE_UINT_FIELD(tleSortGroupRef);
1342
0
  WRITE_OID_FIELD(eqop);
1343
0
  WRITE_OID_FIELD(sortop);
1344
0
  WRITE_BOOL_FIELD(reverse_sort);
1345
0
  WRITE_BOOL_FIELD(nulls_first);
1346
0
  WRITE_BOOL_FIELD(hashable);
1347
0
}
1348
1349
static void
1350
_outGroupingSet(StringInfo str, const GroupingSet *node)
1351
0
{
1352
0
  WRITE_NODE_TYPE("GROUPINGSET");
1353
1354
0
  WRITE_ENUM_FIELD(kind, GroupingSetKind);
1355
0
  WRITE_NODE_FIELD(content);
1356
0
  WRITE_LOCATION_FIELD(location);
1357
0
}
1358
1359
static void
1360
_outWindowClause(StringInfo str, const WindowClause *node)
1361
0
{
1362
0
  WRITE_NODE_TYPE("WINDOWCLAUSE");
1363
1364
0
  WRITE_STRING_FIELD(name);
1365
0
  WRITE_STRING_FIELD(refname);
1366
0
  WRITE_NODE_FIELD(partitionClause);
1367
0
  WRITE_NODE_FIELD(orderClause);
1368
0
  WRITE_INT_FIELD(frameOptions);
1369
0
  WRITE_NODE_FIELD(startOffset);
1370
0
  WRITE_NODE_FIELD(endOffset);
1371
0
  WRITE_OID_FIELD(startInRangeFunc);
1372
0
  WRITE_OID_FIELD(endInRangeFunc);
1373
0
  WRITE_OID_FIELD(inRangeColl);
1374
0
  WRITE_BOOL_FIELD(inRangeAsc);
1375
0
  WRITE_BOOL_FIELD(inRangeNullsFirst);
1376
0
  WRITE_UINT_FIELD(winref);
1377
0
  WRITE_BOOL_FIELD(copiedOrder);
1378
0
}
1379
1380
static void
1381
_outRowMarkClause(StringInfo str, const RowMarkClause *node)
1382
0
{
1383
0
  WRITE_NODE_TYPE("ROWMARKCLAUSE");
1384
1385
0
  WRITE_UINT_FIELD(rti);
1386
0
  WRITE_ENUM_FIELD(strength, LockClauseStrength);
1387
0
  WRITE_ENUM_FIELD(waitPolicy, LockWaitPolicy);
1388
0
  WRITE_BOOL_FIELD(pushedDown);
1389
0
}
1390
1391
static void
1392
_outWithClause(StringInfo str, const WithClause *node)
1393
0
{
1394
0
  WRITE_NODE_TYPE("WITHCLAUSE");
1395
1396
0
  WRITE_NODE_FIELD(ctes);
1397
0
  WRITE_BOOL_FIELD(recursive);
1398
0
  WRITE_LOCATION_FIELD(location);
1399
0
}
1400
1401
static void
1402
_outInferClause(StringInfo str, const InferClause *node)
1403
0
{
1404
0
  WRITE_NODE_TYPE("INFERCLAUSE");
1405
1406
0
  WRITE_NODE_FIELD(indexElems);
1407
0
  WRITE_NODE_FIELD(whereClause);
1408
0
  WRITE_STRING_FIELD(conname);
1409
0
  WRITE_LOCATION_FIELD(location);
1410
0
}
1411
1412
static void
1413
_outOnConflictClause(StringInfo str, const OnConflictClause *node)
1414
0
{
1415
0
  WRITE_NODE_TYPE("ONCONFLICTCLAUSE");
1416
1417
0
  WRITE_ENUM_FIELD(action, OnConflictAction);
1418
0
  WRITE_NODE_FIELD(infer);
1419
0
  WRITE_NODE_FIELD(targetList);
1420
0
  WRITE_NODE_FIELD(whereClause);
1421
0
  WRITE_LOCATION_FIELD(location);
1422
0
}
1423
1424
static void
1425
_outCTESearchClause(StringInfo str, const CTESearchClause *node)
1426
0
{
1427
0
  WRITE_NODE_TYPE("CTESEARCHCLAUSE");
1428
1429
0
  WRITE_NODE_FIELD(search_col_list);
1430
0
  WRITE_BOOL_FIELD(search_breadth_first);
1431
0
  WRITE_STRING_FIELD(search_seq_column);
1432
0
  WRITE_LOCATION_FIELD(location);
1433
0
}
1434
1435
static void
1436
_outCTECycleClause(StringInfo str, const CTECycleClause *node)
1437
0
{
1438
0
  WRITE_NODE_TYPE("CTECYCLECLAUSE");
1439
1440
0
  WRITE_NODE_FIELD(cycle_col_list);
1441
0
  WRITE_STRING_FIELD(cycle_mark_column);
1442
0
  WRITE_NODE_FIELD(cycle_mark_value);
1443
0
  WRITE_NODE_FIELD(cycle_mark_default);
1444
0
  WRITE_STRING_FIELD(cycle_path_column);
1445
0
  WRITE_LOCATION_FIELD(location);
1446
0
  WRITE_OID_FIELD(cycle_mark_type);
1447
0
  WRITE_INT_FIELD(cycle_mark_typmod);
1448
0
  WRITE_OID_FIELD(cycle_mark_collation);
1449
0
  WRITE_OID_FIELD(cycle_mark_neop);
1450
0
}
1451
1452
static void
1453
_outCommonTableExpr(StringInfo str, const CommonTableExpr *node)
1454
0
{
1455
0
  WRITE_NODE_TYPE("COMMONTABLEEXPR");
1456
1457
0
  WRITE_STRING_FIELD(ctename);
1458
0
  WRITE_NODE_FIELD(aliascolnames);
1459
0
  WRITE_ENUM_FIELD(ctematerialized, CTEMaterialize);
1460
0
  WRITE_NODE_FIELD(ctequery);
1461
0
  WRITE_NODE_FIELD(search_clause);
1462
0
  WRITE_NODE_FIELD(cycle_clause);
1463
0
  WRITE_LOCATION_FIELD(location);
1464
0
  WRITE_BOOL_FIELD(cterecursive);
1465
0
  WRITE_INT_FIELD(cterefcount);
1466
0
  WRITE_NODE_FIELD(ctecolnames);
1467
0
  WRITE_NODE_FIELD(ctecoltypes);
1468
0
  WRITE_NODE_FIELD(ctecoltypmods);
1469
0
  WRITE_NODE_FIELD(ctecolcollations);
1470
0
}
1471
1472
static void
1473
_outMergeWhenClause(StringInfo str, const MergeWhenClause *node)
1474
0
{
1475
0
  WRITE_NODE_TYPE("MERGEWHENCLAUSE");
1476
1477
0
  WRITE_ENUM_FIELD(matchKind, MergeMatchKind);
1478
0
  WRITE_ENUM_FIELD(commandType, CmdType);
1479
0
  WRITE_ENUM_FIELD(override, OverridingKind);
1480
0
  WRITE_NODE_FIELD(condition);
1481
0
  WRITE_NODE_FIELD(targetList);
1482
0
  WRITE_NODE_FIELD(values);
1483
0
}
1484
1485
static void
1486
_outReturningOption(StringInfo str, const ReturningOption *node)
1487
0
{
1488
0
  WRITE_NODE_TYPE("RETURNINGOPTION");
1489
1490
0
  WRITE_ENUM_FIELD(option, ReturningOptionKind);
1491
0
  WRITE_STRING_FIELD(value);
1492
0
  WRITE_LOCATION_FIELD(location);
1493
0
}
1494
1495
static void
1496
_outReturningClause(StringInfo str, const ReturningClause *node)
1497
0
{
1498
0
  WRITE_NODE_TYPE("RETURNINGCLAUSE");
1499
1500
0
  WRITE_NODE_FIELD(options);
1501
0
  WRITE_NODE_FIELD(exprs);
1502
0
}
1503
1504
static void
1505
_outTriggerTransition(StringInfo str, const TriggerTransition *node)
1506
0
{
1507
0
  WRITE_NODE_TYPE("TRIGGERTRANSITION");
1508
1509
0
  WRITE_STRING_FIELD(name);
1510
0
  WRITE_BOOL_FIELD(isNew);
1511
0
  WRITE_BOOL_FIELD(isTable);
1512
0
}
1513
1514
static void
1515
_outJsonOutput(StringInfo str, const JsonOutput *node)
1516
0
{
1517
0
  WRITE_NODE_TYPE("JSONOUTPUT");
1518
1519
0
  WRITE_NODE_FIELD(typeName);
1520
0
  WRITE_NODE_FIELD(returning);
1521
0
}
1522
1523
static void
1524
_outJsonArgument(StringInfo str, const JsonArgument *node)
1525
0
{
1526
0
  WRITE_NODE_TYPE("JSONARGUMENT");
1527
1528
0
  WRITE_NODE_FIELD(val);
1529
0
  WRITE_STRING_FIELD(name);
1530
0
}
1531
1532
static void
1533
_outJsonFuncExpr(StringInfo str, const JsonFuncExpr *node)
1534
0
{
1535
0
  WRITE_NODE_TYPE("JSONFUNCEXPR");
1536
1537
0
  WRITE_ENUM_FIELD(op, JsonExprOp);
1538
0
  WRITE_STRING_FIELD(column_name);
1539
0
  WRITE_NODE_FIELD(context_item);
1540
0
  WRITE_NODE_FIELD(pathspec);
1541
0
  WRITE_NODE_FIELD(passing);
1542
0
  WRITE_NODE_FIELD(output);
1543
0
  WRITE_NODE_FIELD(on_empty);
1544
0
  WRITE_NODE_FIELD(on_error);
1545
0
  WRITE_ENUM_FIELD(wrapper, JsonWrapper);
1546
0
  WRITE_ENUM_FIELD(quotes, JsonQuotes);
1547
0
  WRITE_LOCATION_FIELD(location);
1548
0
}
1549
1550
static void
1551
_outJsonTablePathSpec(StringInfo str, const JsonTablePathSpec *node)
1552
0
{
1553
0
  WRITE_NODE_TYPE("JSONTABLEPATHSPEC");
1554
1555
0
  WRITE_NODE_FIELD(string);
1556
0
  WRITE_STRING_FIELD(name);
1557
0
  WRITE_LOCATION_FIELD(name_location);
1558
0
  WRITE_LOCATION_FIELD(location);
1559
0
}
1560
1561
static void
1562
_outJsonTable(StringInfo str, const JsonTable *node)
1563
0
{
1564
0
  WRITE_NODE_TYPE("JSONTABLE");
1565
1566
0
  WRITE_NODE_FIELD(context_item);
1567
0
  WRITE_NODE_FIELD(pathspec);
1568
0
  WRITE_NODE_FIELD(passing);
1569
0
  WRITE_NODE_FIELD(columns);
1570
0
  WRITE_NODE_FIELD(on_error);
1571
0
  WRITE_NODE_FIELD(alias);
1572
0
  WRITE_BOOL_FIELD(lateral);
1573
0
  WRITE_LOCATION_FIELD(location);
1574
0
}
1575
1576
static void
1577
_outJsonTableColumn(StringInfo str, const JsonTableColumn *node)
1578
0
{
1579
0
  WRITE_NODE_TYPE("JSONTABLECOLUMN");
1580
1581
0
  WRITE_ENUM_FIELD(coltype, JsonTableColumnType);
1582
0
  WRITE_STRING_FIELD(name);
1583
0
  WRITE_NODE_FIELD(typeName);
1584
0
  WRITE_NODE_FIELD(pathspec);
1585
0
  WRITE_NODE_FIELD(format);
1586
0
  WRITE_ENUM_FIELD(wrapper, JsonWrapper);
1587
0
  WRITE_ENUM_FIELD(quotes, JsonQuotes);
1588
0
  WRITE_NODE_FIELD(columns);
1589
0
  WRITE_NODE_FIELD(on_empty);
1590
0
  WRITE_NODE_FIELD(on_error);
1591
0
  WRITE_LOCATION_FIELD(location);
1592
0
}
1593
1594
static void
1595
_outJsonKeyValue(StringInfo str, const JsonKeyValue *node)
1596
0
{
1597
0
  WRITE_NODE_TYPE("JSONKEYVALUE");
1598
1599
0
  WRITE_NODE_FIELD(key);
1600
0
  WRITE_NODE_FIELD(value);
1601
0
}
1602
1603
static void
1604
_outJsonParseExpr(StringInfo str, const JsonParseExpr *node)
1605
0
{
1606
0
  WRITE_NODE_TYPE("JSONPARSEEXPR");
1607
1608
0
  WRITE_NODE_FIELD(expr);
1609
0
  WRITE_NODE_FIELD(output);
1610
0
  WRITE_BOOL_FIELD(unique_keys);
1611
0
  WRITE_LOCATION_FIELD(location);
1612
0
}
1613
1614
static void
1615
_outJsonScalarExpr(StringInfo str, const JsonScalarExpr *node)
1616
0
{
1617
0
  WRITE_NODE_TYPE("JSONSCALAREXPR");
1618
1619
0
  WRITE_NODE_FIELD(expr);
1620
0
  WRITE_NODE_FIELD(output);
1621
0
  WRITE_LOCATION_FIELD(location);
1622
0
}
1623
1624
static void
1625
_outJsonSerializeExpr(StringInfo str, const JsonSerializeExpr *node)
1626
0
{
1627
0
  WRITE_NODE_TYPE("JSONSERIALIZEEXPR");
1628
1629
0
  WRITE_NODE_FIELD(expr);
1630
0
  WRITE_NODE_FIELD(output);
1631
0
  WRITE_LOCATION_FIELD(location);
1632
0
}
1633
1634
static void
1635
_outJsonObjectConstructor(StringInfo str, const JsonObjectConstructor *node)
1636
0
{
1637
0
  WRITE_NODE_TYPE("JSONOBJECTCONSTRUCTOR");
1638
1639
0
  WRITE_NODE_FIELD(exprs);
1640
0
  WRITE_NODE_FIELD(output);
1641
0
  WRITE_BOOL_FIELD(absent_on_null);
1642
0
  WRITE_BOOL_FIELD(unique);
1643
0
  WRITE_LOCATION_FIELD(location);
1644
0
}
1645
1646
static void
1647
_outJsonArrayConstructor(StringInfo str, const JsonArrayConstructor *node)
1648
0
{
1649
0
  WRITE_NODE_TYPE("JSONARRAYCONSTRUCTOR");
1650
1651
0
  WRITE_NODE_FIELD(exprs);
1652
0
  WRITE_NODE_FIELD(output);
1653
0
  WRITE_BOOL_FIELD(absent_on_null);
1654
0
  WRITE_LOCATION_FIELD(location);
1655
0
}
1656
1657
static void
1658
_outJsonArrayQueryConstructor(StringInfo str, const JsonArrayQueryConstructor *node)
1659
0
{
1660
0
  WRITE_NODE_TYPE("JSONARRAYQUERYCONSTRUCTOR");
1661
1662
0
  WRITE_NODE_FIELD(query);
1663
0
  WRITE_NODE_FIELD(output);
1664
0
  WRITE_NODE_FIELD(format);
1665
0
  WRITE_BOOL_FIELD(absent_on_null);
1666
0
  WRITE_LOCATION_FIELD(location);
1667
0
}
1668
1669
static void
1670
_outJsonAggConstructor(StringInfo str, const JsonAggConstructor *node)
1671
0
{
1672
0
  WRITE_NODE_TYPE("JSONAGGCONSTRUCTOR");
1673
1674
0
  WRITE_NODE_FIELD(output);
1675
0
  WRITE_NODE_FIELD(agg_filter);
1676
0
  WRITE_NODE_FIELD(agg_order);
1677
0
  WRITE_NODE_FIELD(over);
1678
0
  WRITE_LOCATION_FIELD(location);
1679
0
}
1680
1681
static void
1682
_outJsonObjectAgg(StringInfo str, const JsonObjectAgg *node)
1683
0
{
1684
0
  WRITE_NODE_TYPE("JSONOBJECTAGG");
1685
1686
0
  WRITE_NODE_FIELD(constructor);
1687
0
  WRITE_NODE_FIELD(arg);
1688
0
  WRITE_BOOL_FIELD(absent_on_null);
1689
0
  WRITE_BOOL_FIELD(unique);
1690
0
}
1691
1692
static void
1693
_outJsonArrayAgg(StringInfo str, const JsonArrayAgg *node)
1694
0
{
1695
0
  WRITE_NODE_TYPE("JSONARRAYAGG");
1696
1697
0
  WRITE_NODE_FIELD(constructor);
1698
0
  WRITE_NODE_FIELD(arg);
1699
0
  WRITE_BOOL_FIELD(absent_on_null);
1700
0
}
1701
1702
static void
1703
_outRawStmt(StringInfo str, const RawStmt *node)
1704
0
{
1705
0
  WRITE_NODE_TYPE("RAWSTMT");
1706
1707
0
  WRITE_NODE_FIELD(stmt);
1708
0
  WRITE_LOCATION_FIELD(stmt_location);
1709
0
  WRITE_LOCATION_FIELD(stmt_len);
1710
0
}
1711
1712
static void
1713
_outInsertStmt(StringInfo str, const InsertStmt *node)
1714
0
{
1715
0
  WRITE_NODE_TYPE("INSERTSTMT");
1716
1717
0
  WRITE_NODE_FIELD(relation);
1718
0
  WRITE_NODE_FIELD(cols);
1719
0
  WRITE_NODE_FIELD(selectStmt);
1720
0
  WRITE_NODE_FIELD(onConflictClause);
1721
0
  WRITE_NODE_FIELD(returningClause);
1722
0
  WRITE_NODE_FIELD(withClause);
1723
0
  WRITE_ENUM_FIELD(override, OverridingKind);
1724
0
}
1725
1726
static void
1727
_outDeleteStmt(StringInfo str, const DeleteStmt *node)
1728
0
{
1729
0
  WRITE_NODE_TYPE("DELETESTMT");
1730
1731
0
  WRITE_NODE_FIELD(relation);
1732
0
  WRITE_NODE_FIELD(usingClause);
1733
0
  WRITE_NODE_FIELD(whereClause);
1734
0
  WRITE_NODE_FIELD(returningClause);
1735
0
  WRITE_NODE_FIELD(withClause);
1736
0
}
1737
1738
static void
1739
_outUpdateStmt(StringInfo str, const UpdateStmt *node)
1740
0
{
1741
0
  WRITE_NODE_TYPE("UPDATESTMT");
1742
1743
0
  WRITE_NODE_FIELD(relation);
1744
0
  WRITE_NODE_FIELD(targetList);
1745
0
  WRITE_NODE_FIELD(whereClause);
1746
0
  WRITE_NODE_FIELD(fromClause);
1747
0
  WRITE_NODE_FIELD(returningClause);
1748
0
  WRITE_NODE_FIELD(withClause);
1749
0
}
1750
1751
static void
1752
_outMergeStmt(StringInfo str, const MergeStmt *node)
1753
0
{
1754
0
  WRITE_NODE_TYPE("MERGESTMT");
1755
1756
0
  WRITE_NODE_FIELD(relation);
1757
0
  WRITE_NODE_FIELD(sourceRelation);
1758
0
  WRITE_NODE_FIELD(joinCondition);
1759
0
  WRITE_NODE_FIELD(mergeWhenClauses);
1760
0
  WRITE_NODE_FIELD(returningClause);
1761
0
  WRITE_NODE_FIELD(withClause);
1762
0
}
1763
1764
static void
1765
_outSelectStmt(StringInfo str, const SelectStmt *node)
1766
0
{
1767
0
  WRITE_NODE_TYPE("SELECTSTMT");
1768
1769
0
  WRITE_NODE_FIELD(distinctClause);
1770
0
  WRITE_NODE_FIELD(intoClause);
1771
0
  WRITE_NODE_FIELD(targetList);
1772
0
  WRITE_NODE_FIELD(fromClause);
1773
0
  WRITE_NODE_FIELD(whereClause);
1774
0
  WRITE_NODE_FIELD(groupClause);
1775
0
  WRITE_BOOL_FIELD(groupDistinct);
1776
0
  WRITE_BOOL_FIELD(groupByAll);
1777
0
  WRITE_NODE_FIELD(havingClause);
1778
0
  WRITE_NODE_FIELD(windowClause);
1779
0
  WRITE_NODE_FIELD(valuesLists);
1780
0
  WRITE_NODE_FIELD(sortClause);
1781
0
  WRITE_NODE_FIELD(limitOffset);
1782
0
  WRITE_NODE_FIELD(limitCount);
1783
0
  WRITE_ENUM_FIELD(limitOption, LimitOption);
1784
0
  WRITE_NODE_FIELD(lockingClause);
1785
0
  WRITE_NODE_FIELD(withClause);
1786
0
  WRITE_ENUM_FIELD(op, SetOperation);
1787
0
  WRITE_BOOL_FIELD(all);
1788
0
  WRITE_NODE_FIELD(larg);
1789
0
  WRITE_NODE_FIELD(rarg);
1790
0
}
1791
1792
static void
1793
_outSetOperationStmt(StringInfo str, const SetOperationStmt *node)
1794
0
{
1795
0
  WRITE_NODE_TYPE("SETOPERATIONSTMT");
1796
1797
0
  WRITE_ENUM_FIELD(op, SetOperation);
1798
0
  WRITE_BOOL_FIELD(all);
1799
0
  WRITE_NODE_FIELD(larg);
1800
0
  WRITE_NODE_FIELD(rarg);
1801
0
  WRITE_NODE_FIELD(colTypes);
1802
0
  WRITE_NODE_FIELD(colTypmods);
1803
0
  WRITE_NODE_FIELD(colCollations);
1804
0
  WRITE_NODE_FIELD(groupClauses);
1805
0
}
1806
1807
static void
1808
_outReturnStmt(StringInfo str, const ReturnStmt *node)
1809
0
{
1810
0
  WRITE_NODE_TYPE("RETURNSTMT");
1811
1812
0
  WRITE_NODE_FIELD(returnval);
1813
0
}
1814
1815
static void
1816
_outPLAssignStmt(StringInfo str, const PLAssignStmt *node)
1817
0
{
1818
0
  WRITE_NODE_TYPE("PLASSIGNSTMT");
1819
1820
0
  WRITE_STRING_FIELD(name);
1821
0
  WRITE_NODE_FIELD(indirection);
1822
0
  WRITE_INT_FIELD(nnames);
1823
0
  WRITE_NODE_FIELD(val);
1824
0
  WRITE_LOCATION_FIELD(location);
1825
0
}
1826
1827
static void
1828
_outCreateSchemaStmt(StringInfo str, const CreateSchemaStmt *node)
1829
0
{
1830
0
  WRITE_NODE_TYPE("CREATESCHEMASTMT");
1831
1832
0
  WRITE_STRING_FIELD(schemaname);
1833
0
  WRITE_NODE_FIELD(authrole);
1834
0
  WRITE_NODE_FIELD(schemaElts);
1835
0
  WRITE_BOOL_FIELD(if_not_exists);
1836
0
}
1837
1838
static void
1839
_outAlterTableStmt(StringInfo str, const AlterTableStmt *node)
1840
0
{
1841
0
  WRITE_NODE_TYPE("ALTERTABLESTMT");
1842
1843
0
  WRITE_NODE_FIELD(relation);
1844
0
  WRITE_NODE_FIELD(cmds);
1845
0
  WRITE_ENUM_FIELD(objtype, ObjectType);
1846
0
  WRITE_BOOL_FIELD(missing_ok);
1847
0
}
1848
1849
static void
1850
_outAlterTableCmd(StringInfo str, const AlterTableCmd *node)
1851
0
{
1852
0
  WRITE_NODE_TYPE("ALTERTABLECMD");
1853
1854
0
  WRITE_ENUM_FIELD(subtype, AlterTableType);
1855
0
  WRITE_STRING_FIELD(name);
1856
0
  WRITE_INT_FIELD(num);
1857
0
  WRITE_NODE_FIELD(newowner);
1858
0
  WRITE_NODE_FIELD(def);
1859
0
  WRITE_ENUM_FIELD(behavior, DropBehavior);
1860
0
  WRITE_BOOL_FIELD(missing_ok);
1861
0
  WRITE_BOOL_FIELD(recurse);
1862
0
}
1863
1864
static void
1865
_outATAlterConstraint(StringInfo str, const ATAlterConstraint *node)
1866
0
{
1867
0
  WRITE_NODE_TYPE("ATALTERCONSTRAINT");
1868
1869
0
  WRITE_STRING_FIELD(conname);
1870
0
  WRITE_BOOL_FIELD(alterEnforceability);
1871
0
  WRITE_BOOL_FIELD(is_enforced);
1872
0
  WRITE_BOOL_FIELD(alterDeferrability);
1873
0
  WRITE_BOOL_FIELD(deferrable);
1874
0
  WRITE_BOOL_FIELD(initdeferred);
1875
0
  WRITE_BOOL_FIELD(alterInheritability);
1876
0
  WRITE_BOOL_FIELD(noinherit);
1877
0
}
1878
1879
static void
1880
_outReplicaIdentityStmt(StringInfo str, const ReplicaIdentityStmt *node)
1881
0
{
1882
0
  WRITE_NODE_TYPE("REPLICAIDENTITYSTMT");
1883
1884
0
  WRITE_CHAR_FIELD(identity_type);
1885
0
  WRITE_STRING_FIELD(name);
1886
0
}
1887
1888
static void
1889
_outAlterCollationStmt(StringInfo str, const AlterCollationStmt *node)
1890
0
{
1891
0
  WRITE_NODE_TYPE("ALTERCOLLATIONSTMT");
1892
1893
0
  WRITE_NODE_FIELD(collname);
1894
0
}
1895
1896
static void
1897
_outAlterDomainStmt(StringInfo str, const AlterDomainStmt *node)
1898
0
{
1899
0
  WRITE_NODE_TYPE("ALTERDOMAINSTMT");
1900
1901
0
  WRITE_ENUM_FIELD(subtype, AlterDomainType);
1902
0
  WRITE_NODE_FIELD(typeName);
1903
0
  WRITE_STRING_FIELD(name);
1904
0
  WRITE_NODE_FIELD(def);
1905
0
  WRITE_ENUM_FIELD(behavior, DropBehavior);
1906
0
  WRITE_BOOL_FIELD(missing_ok);
1907
0
}
1908
1909
static void
1910
_outGrantStmt(StringInfo str, const GrantStmt *node)
1911
0
{
1912
0
  WRITE_NODE_TYPE("GRANTSTMT");
1913
1914
0
  WRITE_BOOL_FIELD(is_grant);
1915
0
  WRITE_ENUM_FIELD(targtype, GrantTargetType);
1916
0
  WRITE_ENUM_FIELD(objtype, ObjectType);
1917
0
  WRITE_NODE_FIELD(objects);
1918
0
  WRITE_NODE_FIELD(privileges);
1919
0
  WRITE_NODE_FIELD(grantees);
1920
0
  WRITE_BOOL_FIELD(grant_option);
1921
0
  WRITE_NODE_FIELD(grantor);
1922
0
  WRITE_ENUM_FIELD(behavior, DropBehavior);
1923
0
}
1924
1925
static void
1926
_outObjectWithArgs(StringInfo str, const ObjectWithArgs *node)
1927
0
{
1928
0
  WRITE_NODE_TYPE("OBJECTWITHARGS");
1929
1930
0
  WRITE_NODE_FIELD(objname);
1931
0
  WRITE_NODE_FIELD(objargs);
1932
0
  WRITE_NODE_FIELD(objfuncargs);
1933
0
  WRITE_BOOL_FIELD(args_unspecified);
1934
0
}
1935
1936
static void
1937
_outAccessPriv(StringInfo str, const AccessPriv *node)
1938
0
{
1939
0
  WRITE_NODE_TYPE("ACCESSPRIV");
1940
1941
0
  WRITE_STRING_FIELD(priv_name);
1942
0
  WRITE_NODE_FIELD(cols);
1943
0
}
1944
1945
static void
1946
_outGrantRoleStmt(StringInfo str, const GrantRoleStmt *node)
1947
0
{
1948
0
  WRITE_NODE_TYPE("GRANTROLESTMT");
1949
1950
0
  WRITE_NODE_FIELD(granted_roles);
1951
0
  WRITE_NODE_FIELD(grantee_roles);
1952
0
  WRITE_BOOL_FIELD(is_grant);
1953
0
  WRITE_NODE_FIELD(opt);
1954
0
  WRITE_NODE_FIELD(grantor);
1955
0
  WRITE_ENUM_FIELD(behavior, DropBehavior);
1956
0
}
1957
1958
static void
1959
_outAlterDefaultPrivilegesStmt(StringInfo str, const AlterDefaultPrivilegesStmt *node)
1960
0
{
1961
0
  WRITE_NODE_TYPE("ALTERDEFAULTPRIVILEGESSTMT");
1962
1963
0
  WRITE_NODE_FIELD(options);
1964
0
  WRITE_NODE_FIELD(action);
1965
0
}
1966
1967
static void
1968
_outCopyStmt(StringInfo str, const CopyStmt *node)
1969
0
{
1970
0
  WRITE_NODE_TYPE("COPYSTMT");
1971
1972
0
  WRITE_NODE_FIELD(relation);
1973
0
  WRITE_NODE_FIELD(query);
1974
0
  WRITE_NODE_FIELD(attlist);
1975
0
  WRITE_BOOL_FIELD(is_from);
1976
0
  WRITE_BOOL_FIELD(is_program);
1977
0
  WRITE_STRING_FIELD(filename);
1978
0
  WRITE_NODE_FIELD(options);
1979
0
  WRITE_NODE_FIELD(whereClause);
1980
0
}
1981
1982
static void
1983
_outVariableSetStmt(StringInfo str, const VariableSetStmt *node)
1984
0
{
1985
0
  WRITE_NODE_TYPE("VARIABLESETSTMT");
1986
1987
0
  WRITE_ENUM_FIELD(kind, VariableSetKind);
1988
0
  WRITE_STRING_FIELD(name);
1989
0
  WRITE_NODE_FIELD(args);
1990
0
  WRITE_BOOL_FIELD(jumble_args);
1991
0
  WRITE_BOOL_FIELD(is_local);
1992
0
  WRITE_LOCATION_FIELD(location);
1993
0
}
1994
1995
static void
1996
_outVariableShowStmt(StringInfo str, const VariableShowStmt *node)
1997
0
{
1998
0
  WRITE_NODE_TYPE("VARIABLESHOWSTMT");
1999
2000
0
  WRITE_STRING_FIELD(name);
2001
0
}
2002
2003
static void
2004
_outCreateStmt(StringInfo str, const CreateStmt *node)
2005
0
{
2006
0
  WRITE_NODE_TYPE("CREATESTMT");
2007
2008
0
  WRITE_NODE_FIELD(relation);
2009
0
  WRITE_NODE_FIELD(tableElts);
2010
0
  WRITE_NODE_FIELD(inhRelations);
2011
0
  WRITE_NODE_FIELD(partbound);
2012
0
  WRITE_NODE_FIELD(partspec);
2013
0
  WRITE_NODE_FIELD(ofTypename);
2014
0
  WRITE_NODE_FIELD(constraints);
2015
0
  WRITE_NODE_FIELD(nnconstraints);
2016
0
  WRITE_NODE_FIELD(options);
2017
0
  WRITE_ENUM_FIELD(oncommit, OnCommitAction);
2018
0
  WRITE_STRING_FIELD(tablespacename);
2019
0
  WRITE_STRING_FIELD(accessMethod);
2020
0
  WRITE_BOOL_FIELD(if_not_exists);
2021
0
}
2022
2023
static void
2024
_outConstraint(StringInfo str, const Constraint *node)
2025
0
{
2026
0
  WRITE_NODE_TYPE("CONSTRAINT");
2027
2028
0
  WRITE_ENUM_FIELD(contype, ConstrType);
2029
0
  WRITE_STRING_FIELD(conname);
2030
0
  WRITE_BOOL_FIELD(deferrable);
2031
0
  WRITE_BOOL_FIELD(initdeferred);
2032
0
  WRITE_BOOL_FIELD(is_enforced);
2033
0
  WRITE_BOOL_FIELD(skip_validation);
2034
0
  WRITE_BOOL_FIELD(initially_valid);
2035
0
  WRITE_BOOL_FIELD(is_no_inherit);
2036
0
  WRITE_NODE_FIELD(raw_expr);
2037
0
  WRITE_STRING_FIELD(cooked_expr);
2038
0
  WRITE_CHAR_FIELD(generated_when);
2039
0
  WRITE_CHAR_FIELD(generated_kind);
2040
0
  WRITE_BOOL_FIELD(nulls_not_distinct);
2041
0
  WRITE_NODE_FIELD(keys);
2042
0
  WRITE_BOOL_FIELD(without_overlaps);
2043
0
  WRITE_NODE_FIELD(including);
2044
0
  WRITE_NODE_FIELD(exclusions);
2045
0
  WRITE_NODE_FIELD(options);
2046
0
  WRITE_STRING_FIELD(indexname);
2047
0
  WRITE_STRING_FIELD(indexspace);
2048
0
  WRITE_BOOL_FIELD(reset_default_tblspc);
2049
0
  WRITE_STRING_FIELD(access_method);
2050
0
  WRITE_NODE_FIELD(where_clause);
2051
0
  WRITE_NODE_FIELD(pktable);
2052
0
  WRITE_NODE_FIELD(fk_attrs);
2053
0
  WRITE_NODE_FIELD(pk_attrs);
2054
0
  WRITE_BOOL_FIELD(fk_with_period);
2055
0
  WRITE_BOOL_FIELD(pk_with_period);
2056
0
  WRITE_CHAR_FIELD(fk_matchtype);
2057
0
  WRITE_CHAR_FIELD(fk_upd_action);
2058
0
  WRITE_CHAR_FIELD(fk_del_action);
2059
0
  WRITE_NODE_FIELD(fk_del_set_cols);
2060
0
  WRITE_NODE_FIELD(old_conpfeqop);
2061
0
  WRITE_OID_FIELD(old_pktable_oid);
2062
0
  WRITE_LOCATION_FIELD(location);
2063
0
}
2064
2065
static void
2066
_outCreateTableSpaceStmt(StringInfo str, const CreateTableSpaceStmt *node)
2067
0
{
2068
0
  WRITE_NODE_TYPE("CREATETABLESPACESTMT");
2069
2070
0
  WRITE_STRING_FIELD(tablespacename);
2071
0
  WRITE_NODE_FIELD(owner);
2072
0
  WRITE_STRING_FIELD(location);
2073
0
  WRITE_NODE_FIELD(options);
2074
0
}
2075
2076
static void
2077
_outDropTableSpaceStmt(StringInfo str, const DropTableSpaceStmt *node)
2078
0
{
2079
0
  WRITE_NODE_TYPE("DROPTABLESPACESTMT");
2080
2081
0
  WRITE_STRING_FIELD(tablespacename);
2082
0
  WRITE_BOOL_FIELD(missing_ok);
2083
0
}
2084
2085
static void
2086
_outAlterTableSpaceOptionsStmt(StringInfo str, const AlterTableSpaceOptionsStmt *node)
2087
0
{
2088
0
  WRITE_NODE_TYPE("ALTERTABLESPACEOPTIONSSTMT");
2089
2090
0
  WRITE_STRING_FIELD(tablespacename);
2091
0
  WRITE_NODE_FIELD(options);
2092
0
  WRITE_BOOL_FIELD(isReset);
2093
0
}
2094
2095
static void
2096
_outAlterTableMoveAllStmt(StringInfo str, const AlterTableMoveAllStmt *node)
2097
0
{
2098
0
  WRITE_NODE_TYPE("ALTERTABLEMOVEALLSTMT");
2099
2100
0
  WRITE_STRING_FIELD(orig_tablespacename);
2101
0
  WRITE_ENUM_FIELD(objtype, ObjectType);
2102
0
  WRITE_NODE_FIELD(roles);
2103
0
  WRITE_STRING_FIELD(new_tablespacename);
2104
0
  WRITE_BOOL_FIELD(nowait);
2105
0
}
2106
2107
static void
2108
_outCreateExtensionStmt(StringInfo str, const CreateExtensionStmt *node)
2109
0
{
2110
0
  WRITE_NODE_TYPE("CREATEEXTENSIONSTMT");
2111
2112
0
  WRITE_STRING_FIELD(extname);
2113
0
  WRITE_BOOL_FIELD(if_not_exists);
2114
0
  WRITE_NODE_FIELD(options);
2115
0
}
2116
2117
static void
2118
_outAlterExtensionStmt(StringInfo str, const AlterExtensionStmt *node)
2119
0
{
2120
0
  WRITE_NODE_TYPE("ALTEREXTENSIONSTMT");
2121
2122
0
  WRITE_STRING_FIELD(extname);
2123
0
  WRITE_NODE_FIELD(options);
2124
0
}
2125
2126
static void
2127
_outAlterExtensionContentsStmt(StringInfo str, const AlterExtensionContentsStmt *node)
2128
0
{
2129
0
  WRITE_NODE_TYPE("ALTEREXTENSIONCONTENTSSTMT");
2130
2131
0
  WRITE_STRING_FIELD(extname);
2132
0
  WRITE_INT_FIELD(action);
2133
0
  WRITE_ENUM_FIELD(objtype, ObjectType);
2134
0
  WRITE_NODE_FIELD(object);
2135
0
}
2136
2137
static void
2138
_outCreateFdwStmt(StringInfo str, const CreateFdwStmt *node)
2139
0
{
2140
0
  WRITE_NODE_TYPE("CREATEFDWSTMT");
2141
2142
0
  WRITE_STRING_FIELD(fdwname);
2143
0
  WRITE_NODE_FIELD(func_options);
2144
0
  WRITE_NODE_FIELD(options);
2145
0
}
2146
2147
static void
2148
_outAlterFdwStmt(StringInfo str, const AlterFdwStmt *node)
2149
0
{
2150
0
  WRITE_NODE_TYPE("ALTERFDWSTMT");
2151
2152
0
  WRITE_STRING_FIELD(fdwname);
2153
0
  WRITE_NODE_FIELD(func_options);
2154
0
  WRITE_NODE_FIELD(options);
2155
0
}
2156
2157
static void
2158
_outCreateForeignServerStmt(StringInfo str, const CreateForeignServerStmt *node)
2159
0
{
2160
0
  WRITE_NODE_TYPE("CREATEFOREIGNSERVERSTMT");
2161
2162
0
  WRITE_STRING_FIELD(servername);
2163
0
  WRITE_STRING_FIELD(servertype);
2164
0
  WRITE_STRING_FIELD(version);
2165
0
  WRITE_STRING_FIELD(fdwname);
2166
0
  WRITE_BOOL_FIELD(if_not_exists);
2167
0
  WRITE_NODE_FIELD(options);
2168
0
}
2169
2170
static void
2171
_outAlterForeignServerStmt(StringInfo str, const AlterForeignServerStmt *node)
2172
0
{
2173
0
  WRITE_NODE_TYPE("ALTERFOREIGNSERVERSTMT");
2174
2175
0
  WRITE_STRING_FIELD(servername);
2176
0
  WRITE_STRING_FIELD(version);
2177
0
  WRITE_NODE_FIELD(options);
2178
0
  WRITE_BOOL_FIELD(has_version);
2179
0
}
2180
2181
static void
2182
_outCreateForeignTableStmt(StringInfo str, const CreateForeignTableStmt *node)
2183
0
{
2184
0
  WRITE_NODE_TYPE("CREATEFOREIGNTABLESTMT");
2185
2186
0
  WRITE_NODE_FIELD(base.relation);
2187
0
  WRITE_NODE_FIELD(base.tableElts);
2188
0
  WRITE_NODE_FIELD(base.inhRelations);
2189
0
  WRITE_NODE_FIELD(base.partbound);
2190
0
  WRITE_NODE_FIELD(base.partspec);
2191
0
  WRITE_NODE_FIELD(base.ofTypename);
2192
0
  WRITE_NODE_FIELD(base.constraints);
2193
0
  WRITE_NODE_FIELD(base.nnconstraints);
2194
0
  WRITE_NODE_FIELD(base.options);
2195
0
  WRITE_ENUM_FIELD(base.oncommit, OnCommitAction);
2196
0
  WRITE_STRING_FIELD(base.tablespacename);
2197
0
  WRITE_STRING_FIELD(base.accessMethod);
2198
0
  WRITE_BOOL_FIELD(base.if_not_exists);
2199
0
  WRITE_STRING_FIELD(servername);
2200
0
  WRITE_NODE_FIELD(options);
2201
0
}
2202
2203
static void
2204
_outCreateUserMappingStmt(StringInfo str, const CreateUserMappingStmt *node)
2205
0
{
2206
0
  WRITE_NODE_TYPE("CREATEUSERMAPPINGSTMT");
2207
2208
0
  WRITE_NODE_FIELD(user);
2209
0
  WRITE_STRING_FIELD(servername);
2210
0
  WRITE_BOOL_FIELD(if_not_exists);
2211
0
  WRITE_NODE_FIELD(options);
2212
0
}
2213
2214
static void
2215
_outAlterUserMappingStmt(StringInfo str, const AlterUserMappingStmt *node)
2216
0
{
2217
0
  WRITE_NODE_TYPE("ALTERUSERMAPPINGSTMT");
2218
2219
0
  WRITE_NODE_FIELD(user);
2220
0
  WRITE_STRING_FIELD(servername);
2221
0
  WRITE_NODE_FIELD(options);
2222
0
}
2223
2224
static void
2225
_outDropUserMappingStmt(StringInfo str, const DropUserMappingStmt *node)
2226
0
{
2227
0
  WRITE_NODE_TYPE("DROPUSERMAPPINGSTMT");
2228
2229
0
  WRITE_NODE_FIELD(user);
2230
0
  WRITE_STRING_FIELD(servername);
2231
0
  WRITE_BOOL_FIELD(missing_ok);
2232
0
}
2233
2234
static void
2235
_outImportForeignSchemaStmt(StringInfo str, const ImportForeignSchemaStmt *node)
2236
0
{
2237
0
  WRITE_NODE_TYPE("IMPORTFOREIGNSCHEMASTMT");
2238
2239
0
  WRITE_STRING_FIELD(server_name);
2240
0
  WRITE_STRING_FIELD(remote_schema);
2241
0
  WRITE_STRING_FIELD(local_schema);
2242
0
  WRITE_ENUM_FIELD(list_type, ImportForeignSchemaType);
2243
0
  WRITE_NODE_FIELD(table_list);
2244
0
  WRITE_NODE_FIELD(options);
2245
0
}
2246
2247
static void
2248
_outCreatePolicyStmt(StringInfo str, const CreatePolicyStmt *node)
2249
0
{
2250
0
  WRITE_NODE_TYPE("CREATEPOLICYSTMT");
2251
2252
0
  WRITE_STRING_FIELD(policy_name);
2253
0
  WRITE_NODE_FIELD(table);
2254
0
  WRITE_STRING_FIELD(cmd_name);
2255
0
  WRITE_BOOL_FIELD(permissive);
2256
0
  WRITE_NODE_FIELD(roles);
2257
0
  WRITE_NODE_FIELD(qual);
2258
0
  WRITE_NODE_FIELD(with_check);
2259
0
}
2260
2261
static void
2262
_outAlterPolicyStmt(StringInfo str, const AlterPolicyStmt *node)
2263
0
{
2264
0
  WRITE_NODE_TYPE("ALTERPOLICYSTMT");
2265
2266
0
  WRITE_STRING_FIELD(policy_name);
2267
0
  WRITE_NODE_FIELD(table);
2268
0
  WRITE_NODE_FIELD(roles);
2269
0
  WRITE_NODE_FIELD(qual);
2270
0
  WRITE_NODE_FIELD(with_check);
2271
0
}
2272
2273
static void
2274
_outCreateAmStmt(StringInfo str, const CreateAmStmt *node)
2275
0
{
2276
0
  WRITE_NODE_TYPE("CREATEAMSTMT");
2277
2278
0
  WRITE_STRING_FIELD(amname);
2279
0
  WRITE_NODE_FIELD(handler_name);
2280
0
  WRITE_CHAR_FIELD(amtype);
2281
0
}
2282
2283
static void
2284
_outCreateTrigStmt(StringInfo str, const CreateTrigStmt *node)
2285
0
{
2286
0
  WRITE_NODE_TYPE("CREATETRIGSTMT");
2287
2288
0
  WRITE_BOOL_FIELD(replace);
2289
0
  WRITE_BOOL_FIELD(isconstraint);
2290
0
  WRITE_STRING_FIELD(trigname);
2291
0
  WRITE_NODE_FIELD(relation);
2292
0
  WRITE_NODE_FIELD(funcname);
2293
0
  WRITE_NODE_FIELD(args);
2294
0
  WRITE_BOOL_FIELD(row);
2295
0
  WRITE_INT_FIELD(timing);
2296
0
  WRITE_INT_FIELD(events);
2297
0
  WRITE_NODE_FIELD(columns);
2298
0
  WRITE_NODE_FIELD(whenClause);
2299
0
  WRITE_NODE_FIELD(transitionRels);
2300
0
  WRITE_BOOL_FIELD(deferrable);
2301
0
  WRITE_BOOL_FIELD(initdeferred);
2302
0
  WRITE_NODE_FIELD(constrrel);
2303
0
}
2304
2305
static void
2306
_outCreateEventTrigStmt(StringInfo str, const CreateEventTrigStmt *node)
2307
0
{
2308
0
  WRITE_NODE_TYPE("CREATEEVENTTRIGSTMT");
2309
2310
0
  WRITE_STRING_FIELD(trigname);
2311
0
  WRITE_STRING_FIELD(eventname);
2312
0
  WRITE_NODE_FIELD(whenclause);
2313
0
  WRITE_NODE_FIELD(funcname);
2314
0
}
2315
2316
static void
2317
_outAlterEventTrigStmt(StringInfo str, const AlterEventTrigStmt *node)
2318
0
{
2319
0
  WRITE_NODE_TYPE("ALTEREVENTTRIGSTMT");
2320
2321
0
  WRITE_STRING_FIELD(trigname);
2322
0
  WRITE_CHAR_FIELD(tgenabled);
2323
0
}
2324
2325
static void
2326
_outCreatePLangStmt(StringInfo str, const CreatePLangStmt *node)
2327
0
{
2328
0
  WRITE_NODE_TYPE("CREATEPLANGSTMT");
2329
2330
0
  WRITE_BOOL_FIELD(replace);
2331
0
  WRITE_STRING_FIELD(plname);
2332
0
  WRITE_NODE_FIELD(plhandler);
2333
0
  WRITE_NODE_FIELD(plinline);
2334
0
  WRITE_NODE_FIELD(plvalidator);
2335
0
  WRITE_BOOL_FIELD(pltrusted);
2336
0
}
2337
2338
static void
2339
_outCreateRoleStmt(StringInfo str, const CreateRoleStmt *node)
2340
0
{
2341
0
  WRITE_NODE_TYPE("CREATEROLESTMT");
2342
2343
0
  WRITE_ENUM_FIELD(stmt_type, RoleStmtType);
2344
0
  WRITE_STRING_FIELD(role);
2345
0
  WRITE_NODE_FIELD(options);
2346
0
}
2347
2348
static void
2349
_outAlterRoleStmt(StringInfo str, const AlterRoleStmt *node)
2350
0
{
2351
0
  WRITE_NODE_TYPE("ALTERROLESTMT");
2352
2353
0
  WRITE_NODE_FIELD(role);
2354
0
  WRITE_NODE_FIELD(options);
2355
0
  WRITE_INT_FIELD(action);
2356
0
}
2357
2358
static void
2359
_outAlterRoleSetStmt(StringInfo str, const AlterRoleSetStmt *node)
2360
0
{
2361
0
  WRITE_NODE_TYPE("ALTERROLESETSTMT");
2362
2363
0
  WRITE_NODE_FIELD(role);
2364
0
  WRITE_STRING_FIELD(database);
2365
0
  WRITE_NODE_FIELD(setstmt);
2366
0
}
2367
2368
static void
2369
_outDropRoleStmt(StringInfo str, const DropRoleStmt *node)
2370
0
{
2371
0
  WRITE_NODE_TYPE("DROPROLESTMT");
2372
2373
0
  WRITE_NODE_FIELD(roles);
2374
0
  WRITE_BOOL_FIELD(missing_ok);
2375
0
}
2376
2377
static void
2378
_outCreateSeqStmt(StringInfo str, const CreateSeqStmt *node)
2379
0
{
2380
0
  WRITE_NODE_TYPE("CREATESEQSTMT");
2381
2382
0
  WRITE_NODE_FIELD(sequence);
2383
0
  WRITE_NODE_FIELD(options);
2384
0
  WRITE_OID_FIELD(ownerId);
2385
0
  WRITE_BOOL_FIELD(for_identity);
2386
0
  WRITE_BOOL_FIELD(if_not_exists);
2387
0
}
2388
2389
static void
2390
_outAlterSeqStmt(StringInfo str, const AlterSeqStmt *node)
2391
0
{
2392
0
  WRITE_NODE_TYPE("ALTERSEQSTMT");
2393
2394
0
  WRITE_NODE_FIELD(sequence);
2395
0
  WRITE_NODE_FIELD(options);
2396
0
  WRITE_BOOL_FIELD(for_identity);
2397
0
  WRITE_BOOL_FIELD(missing_ok);
2398
0
}
2399
2400
static void
2401
_outDefineStmt(StringInfo str, const DefineStmt *node)
2402
0
{
2403
0
  WRITE_NODE_TYPE("DEFINESTMT");
2404
2405
0
  WRITE_ENUM_FIELD(kind, ObjectType);
2406
0
  WRITE_BOOL_FIELD(oldstyle);
2407
0
  WRITE_NODE_FIELD(defnames);
2408
0
  WRITE_NODE_FIELD(args);
2409
0
  WRITE_NODE_FIELD(definition);
2410
0
  WRITE_BOOL_FIELD(if_not_exists);
2411
0
  WRITE_BOOL_FIELD(replace);
2412
0
}
2413
2414
static void
2415
_outCreateDomainStmt(StringInfo str, const CreateDomainStmt *node)
2416
0
{
2417
0
  WRITE_NODE_TYPE("CREATEDOMAINSTMT");
2418
2419
0
  WRITE_NODE_FIELD(domainname);
2420
0
  WRITE_NODE_FIELD(typeName);
2421
0
  WRITE_NODE_FIELD(collClause);
2422
0
  WRITE_NODE_FIELD(constraints);
2423
0
}
2424
2425
static void
2426
_outCreateOpClassStmt(StringInfo str, const CreateOpClassStmt *node)
2427
0
{
2428
0
  WRITE_NODE_TYPE("CREATEOPCLASSSTMT");
2429
2430
0
  WRITE_NODE_FIELD(opclassname);
2431
0
  WRITE_NODE_FIELD(opfamilyname);
2432
0
  WRITE_STRING_FIELD(amname);
2433
0
  WRITE_NODE_FIELD(datatype);
2434
0
  WRITE_NODE_FIELD(items);
2435
0
  WRITE_BOOL_FIELD(isDefault);
2436
0
}
2437
2438
static void
2439
_outCreateOpClassItem(StringInfo str, const CreateOpClassItem *node)
2440
0
{
2441
0
  WRITE_NODE_TYPE("CREATEOPCLASSITEM");
2442
2443
0
  WRITE_INT_FIELD(itemtype);
2444
0
  WRITE_NODE_FIELD(name);
2445
0
  WRITE_INT_FIELD(number);
2446
0
  WRITE_NODE_FIELD(order_family);
2447
0
  WRITE_NODE_FIELD(class_args);
2448
0
  WRITE_NODE_FIELD(storedtype);
2449
0
}
2450
2451
static void
2452
_outCreateOpFamilyStmt(StringInfo str, const CreateOpFamilyStmt *node)
2453
0
{
2454
0
  WRITE_NODE_TYPE("CREATEOPFAMILYSTMT");
2455
2456
0
  WRITE_NODE_FIELD(opfamilyname);
2457
0
  WRITE_STRING_FIELD(amname);
2458
0
}
2459
2460
static void
2461
_outAlterOpFamilyStmt(StringInfo str, const AlterOpFamilyStmt *node)
2462
0
{
2463
0
  WRITE_NODE_TYPE("ALTEROPFAMILYSTMT");
2464
2465
0
  WRITE_NODE_FIELD(opfamilyname);
2466
0
  WRITE_STRING_FIELD(amname);
2467
0
  WRITE_BOOL_FIELD(isDrop);
2468
0
  WRITE_NODE_FIELD(items);
2469
0
}
2470
2471
static void
2472
_outDropStmt(StringInfo str, const DropStmt *node)
2473
0
{
2474
0
  WRITE_NODE_TYPE("DROPSTMT");
2475
2476
0
  WRITE_NODE_FIELD(objects);
2477
0
  WRITE_ENUM_FIELD(removeType, ObjectType);
2478
0
  WRITE_ENUM_FIELD(behavior, DropBehavior);
2479
0
  WRITE_BOOL_FIELD(missing_ok);
2480
0
  WRITE_BOOL_FIELD(concurrent);
2481
0
}
2482
2483
static void
2484
_outTruncateStmt(StringInfo str, const TruncateStmt *node)
2485
0
{
2486
0
  WRITE_NODE_TYPE("TRUNCATESTMT");
2487
2488
0
  WRITE_NODE_FIELD(relations);
2489
0
  WRITE_BOOL_FIELD(restart_seqs);
2490
0
  WRITE_ENUM_FIELD(behavior, DropBehavior);
2491
0
}
2492
2493
static void
2494
_outCommentStmt(StringInfo str, const CommentStmt *node)
2495
0
{
2496
0
  WRITE_NODE_TYPE("COMMENTSTMT");
2497
2498
0
  WRITE_ENUM_FIELD(objtype, ObjectType);
2499
0
  WRITE_NODE_FIELD(object);
2500
0
  WRITE_STRING_FIELD(comment);
2501
0
}
2502
2503
static void
2504
_outSecLabelStmt(StringInfo str, const SecLabelStmt *node)
2505
0
{
2506
0
  WRITE_NODE_TYPE("SECLABELSTMT");
2507
2508
0
  WRITE_ENUM_FIELD(objtype, ObjectType);
2509
0
  WRITE_NODE_FIELD(object);
2510
0
  WRITE_STRING_FIELD(provider);
2511
0
  WRITE_STRING_FIELD(label);
2512
0
}
2513
2514
static void
2515
_outDeclareCursorStmt(StringInfo str, const DeclareCursorStmt *node)
2516
0
{
2517
0
  WRITE_NODE_TYPE("DECLARECURSORSTMT");
2518
2519
0
  WRITE_STRING_FIELD(portalname);
2520
0
  WRITE_INT_FIELD(options);
2521
0
  WRITE_NODE_FIELD(query);
2522
0
}
2523
2524
static void
2525
_outClosePortalStmt(StringInfo str, const ClosePortalStmt *node)
2526
0
{
2527
0
  WRITE_NODE_TYPE("CLOSEPORTALSTMT");
2528
2529
0
  WRITE_STRING_FIELD(portalname);
2530
0
}
2531
2532
static void
2533
_outFetchStmt(StringInfo str, const FetchStmt *node)
2534
0
{
2535
0
  WRITE_NODE_TYPE("FETCHSTMT");
2536
2537
0
  WRITE_ENUM_FIELD(direction, FetchDirection);
2538
0
  WRITE_LONG_FIELD(howMany);
2539
0
  WRITE_STRING_FIELD(portalname);
2540
0
  WRITE_BOOL_FIELD(ismove);
2541
0
  WRITE_ENUM_FIELD(direction_keyword, FetchDirectionKeywords);
2542
0
  WRITE_LOCATION_FIELD(location);
2543
0
}
2544
2545
static void
2546
_outIndexStmt(StringInfo str, const IndexStmt *node)
2547
0
{
2548
0
  WRITE_NODE_TYPE("INDEXSTMT");
2549
2550
0
  WRITE_STRING_FIELD(idxname);
2551
0
  WRITE_NODE_FIELD(relation);
2552
0
  WRITE_STRING_FIELD(accessMethod);
2553
0
  WRITE_STRING_FIELD(tableSpace);
2554
0
  WRITE_NODE_FIELD(indexParams);
2555
0
  WRITE_NODE_FIELD(indexIncludingParams);
2556
0
  WRITE_NODE_FIELD(options);
2557
0
  WRITE_NODE_FIELD(whereClause);
2558
0
  WRITE_NODE_FIELD(excludeOpNames);
2559
0
  WRITE_STRING_FIELD(idxcomment);
2560
0
  WRITE_OID_FIELD(indexOid);
2561
0
  WRITE_OID_FIELD(oldNumber);
2562
0
  WRITE_UINT_FIELD(oldCreateSubid);
2563
0
  WRITE_UINT_FIELD(oldFirstRelfilelocatorSubid);
2564
0
  WRITE_BOOL_FIELD(unique);
2565
0
  WRITE_BOOL_FIELD(nulls_not_distinct);
2566
0
  WRITE_BOOL_FIELD(primary);
2567
0
  WRITE_BOOL_FIELD(isconstraint);
2568
0
  WRITE_BOOL_FIELD(iswithoutoverlaps);
2569
0
  WRITE_BOOL_FIELD(deferrable);
2570
0
  WRITE_BOOL_FIELD(initdeferred);
2571
0
  WRITE_BOOL_FIELD(transformed);
2572
0
  WRITE_BOOL_FIELD(concurrent);
2573
0
  WRITE_BOOL_FIELD(if_not_exists);
2574
0
  WRITE_BOOL_FIELD(reset_default_tblspc);
2575
0
}
2576
2577
static void
2578
_outCreateStatsStmt(StringInfo str, const CreateStatsStmt *node)
2579
0
{
2580
0
  WRITE_NODE_TYPE("CREATESTATSSTMT");
2581
2582
0
  WRITE_NODE_FIELD(defnames);
2583
0
  WRITE_NODE_FIELD(stat_types);
2584
0
  WRITE_NODE_FIELD(exprs);
2585
0
  WRITE_NODE_FIELD(relations);
2586
0
  WRITE_STRING_FIELD(stxcomment);
2587
0
  WRITE_BOOL_FIELD(transformed);
2588
0
  WRITE_BOOL_FIELD(if_not_exists);
2589
0
}
2590
2591
static void
2592
_outStatsElem(StringInfo str, const StatsElem *node)
2593
0
{
2594
0
  WRITE_NODE_TYPE("STATSELEM");
2595
2596
0
  WRITE_STRING_FIELD(name);
2597
0
  WRITE_NODE_FIELD(expr);
2598
0
}
2599
2600
static void
2601
_outAlterStatsStmt(StringInfo str, const AlterStatsStmt *node)
2602
0
{
2603
0
  WRITE_NODE_TYPE("ALTERSTATSSTMT");
2604
2605
0
  WRITE_NODE_FIELD(defnames);
2606
0
  WRITE_NODE_FIELD(stxstattarget);
2607
0
  WRITE_BOOL_FIELD(missing_ok);
2608
0
}
2609
2610
static void
2611
_outCreateFunctionStmt(StringInfo str, const CreateFunctionStmt *node)
2612
0
{
2613
0
  WRITE_NODE_TYPE("CREATEFUNCTIONSTMT");
2614
2615
0
  WRITE_BOOL_FIELD(is_procedure);
2616
0
  WRITE_BOOL_FIELD(replace);
2617
0
  WRITE_NODE_FIELD(funcname);
2618
0
  WRITE_NODE_FIELD(parameters);
2619
0
  WRITE_NODE_FIELD(returnType);
2620
0
  WRITE_NODE_FIELD(options);
2621
0
  WRITE_NODE_FIELD(sql_body);
2622
0
}
2623
2624
static void
2625
_outFunctionParameter(StringInfo str, const FunctionParameter *node)
2626
0
{
2627
0
  WRITE_NODE_TYPE("FUNCTIONPARAMETER");
2628
2629
0
  WRITE_STRING_FIELD(name);
2630
0
  WRITE_NODE_FIELD(argType);
2631
0
  WRITE_ENUM_FIELD(mode, FunctionParameterMode);
2632
0
  WRITE_NODE_FIELD(defexpr);
2633
0
  WRITE_LOCATION_FIELD(location);
2634
0
}
2635
2636
static void
2637
_outAlterFunctionStmt(StringInfo str, const AlterFunctionStmt *node)
2638
0
{
2639
0
  WRITE_NODE_TYPE("ALTERFUNCTIONSTMT");
2640
2641
0
  WRITE_ENUM_FIELD(objtype, ObjectType);
2642
0
  WRITE_NODE_FIELD(func);
2643
0
  WRITE_NODE_FIELD(actions);
2644
0
}
2645
2646
static void
2647
_outDoStmt(StringInfo str, const DoStmt *node)
2648
0
{
2649
0
  WRITE_NODE_TYPE("DOSTMT");
2650
2651
0
  WRITE_NODE_FIELD(args);
2652
0
}
2653
2654
static void
2655
_outCallStmt(StringInfo str, const CallStmt *node)
2656
0
{
2657
0
  WRITE_NODE_TYPE("CALLSTMT");
2658
2659
0
  WRITE_NODE_FIELD(funccall);
2660
0
  WRITE_NODE_FIELD(funcexpr);
2661
0
  WRITE_NODE_FIELD(outargs);
2662
0
}
2663
2664
static void
2665
_outRenameStmt(StringInfo str, const RenameStmt *node)
2666
0
{
2667
0
  WRITE_NODE_TYPE("RENAMESTMT");
2668
2669
0
  WRITE_ENUM_FIELD(renameType, ObjectType);
2670
0
  WRITE_ENUM_FIELD(relationType, ObjectType);
2671
0
  WRITE_NODE_FIELD(relation);
2672
0
  WRITE_NODE_FIELD(object);
2673
0
  WRITE_STRING_FIELD(subname);
2674
0
  WRITE_STRING_FIELD(newname);
2675
0
  WRITE_ENUM_FIELD(behavior, DropBehavior);
2676
0
  WRITE_BOOL_FIELD(missing_ok);
2677
0
}
2678
2679
static void
2680
_outAlterObjectDependsStmt(StringInfo str, const AlterObjectDependsStmt *node)
2681
0
{
2682
0
  WRITE_NODE_TYPE("ALTEROBJECTDEPENDSSTMT");
2683
2684
0
  WRITE_ENUM_FIELD(objectType, ObjectType);
2685
0
  WRITE_NODE_FIELD(relation);
2686
0
  WRITE_NODE_FIELD(object);
2687
0
  WRITE_NODE_FIELD(extname);
2688
0
  WRITE_BOOL_FIELD(remove);
2689
0
}
2690
2691
static void
2692
_outAlterObjectSchemaStmt(StringInfo str, const AlterObjectSchemaStmt *node)
2693
0
{
2694
0
  WRITE_NODE_TYPE("ALTEROBJECTSCHEMASTMT");
2695
2696
0
  WRITE_ENUM_FIELD(objectType, ObjectType);
2697
0
  WRITE_NODE_FIELD(relation);
2698
0
  WRITE_NODE_FIELD(object);
2699
0
  WRITE_STRING_FIELD(newschema);
2700
0
  WRITE_BOOL_FIELD(missing_ok);
2701
0
}
2702
2703
static void
2704
_outAlterOwnerStmt(StringInfo str, const AlterOwnerStmt *node)
2705
0
{
2706
0
  WRITE_NODE_TYPE("ALTEROWNERSTMT");
2707
2708
0
  WRITE_ENUM_FIELD(objectType, ObjectType);
2709
0
  WRITE_NODE_FIELD(relation);
2710
0
  WRITE_NODE_FIELD(object);
2711
0
  WRITE_NODE_FIELD(newowner);
2712
0
}
2713
2714
static void
2715
_outAlterOperatorStmt(StringInfo str, const AlterOperatorStmt *node)
2716
0
{
2717
0
  WRITE_NODE_TYPE("ALTEROPERATORSTMT");
2718
2719
0
  WRITE_NODE_FIELD(opername);
2720
0
  WRITE_NODE_FIELD(options);
2721
0
}
2722
2723
static void
2724
_outAlterTypeStmt(StringInfo str, const AlterTypeStmt *node)
2725
0
{
2726
0
  WRITE_NODE_TYPE("ALTERTYPESTMT");
2727
2728
0
  WRITE_NODE_FIELD(typeName);
2729
0
  WRITE_NODE_FIELD(options);
2730
0
}
2731
2732
static void
2733
_outRuleStmt(StringInfo str, const RuleStmt *node)
2734
0
{
2735
0
  WRITE_NODE_TYPE("RULESTMT");
2736
2737
0
  WRITE_NODE_FIELD(relation);
2738
0
  WRITE_STRING_FIELD(rulename);
2739
0
  WRITE_NODE_FIELD(whereClause);
2740
0
  WRITE_ENUM_FIELD(event, CmdType);
2741
0
  WRITE_BOOL_FIELD(instead);
2742
0
  WRITE_NODE_FIELD(actions);
2743
0
  WRITE_BOOL_FIELD(replace);
2744
0
}
2745
2746
static void
2747
_outNotifyStmt(StringInfo str, const NotifyStmt *node)
2748
0
{
2749
0
  WRITE_NODE_TYPE("NOTIFYSTMT");
2750
2751
0
  WRITE_STRING_FIELD(conditionname);
2752
0
  WRITE_STRING_FIELD(payload);
2753
0
}
2754
2755
static void
2756
_outListenStmt(StringInfo str, const ListenStmt *node)
2757
0
{
2758
0
  WRITE_NODE_TYPE("LISTENSTMT");
2759
2760
0
  WRITE_STRING_FIELD(conditionname);
2761
0
}
2762
2763
static void
2764
_outUnlistenStmt(StringInfo str, const UnlistenStmt *node)
2765
0
{
2766
0
  WRITE_NODE_TYPE("UNLISTENSTMT");
2767
2768
0
  WRITE_STRING_FIELD(conditionname);
2769
0
}
2770
2771
static void
2772
_outTransactionStmt(StringInfo str, const TransactionStmt *node)
2773
0
{
2774
0
  WRITE_NODE_TYPE("TRANSACTIONSTMT");
2775
2776
0
  WRITE_ENUM_FIELD(kind, TransactionStmtKind);
2777
0
  WRITE_NODE_FIELD(options);
2778
0
  WRITE_STRING_FIELD(savepoint_name);
2779
0
  WRITE_STRING_FIELD(gid);
2780
0
  WRITE_BOOL_FIELD(chain);
2781
0
  WRITE_LOCATION_FIELD(location);
2782
0
}
2783
2784
static void
2785
_outCompositeTypeStmt(StringInfo str, const CompositeTypeStmt *node)
2786
0
{
2787
0
  WRITE_NODE_TYPE("COMPOSITETYPESTMT");
2788
2789
0
  WRITE_NODE_FIELD(typevar);
2790
0
  WRITE_NODE_FIELD(coldeflist);
2791
0
}
2792
2793
static void
2794
_outCreateEnumStmt(StringInfo str, const CreateEnumStmt *node)
2795
0
{
2796
0
  WRITE_NODE_TYPE("CREATEENUMSTMT");
2797
2798
0
  WRITE_NODE_FIELD(typeName);
2799
0
  WRITE_NODE_FIELD(vals);
2800
0
}
2801
2802
static void
2803
_outCreateRangeStmt(StringInfo str, const CreateRangeStmt *node)
2804
0
{
2805
0
  WRITE_NODE_TYPE("CREATERANGESTMT");
2806
2807
0
  WRITE_NODE_FIELD(typeName);
2808
0
  WRITE_NODE_FIELD(params);
2809
0
}
2810
2811
static void
2812
_outAlterEnumStmt(StringInfo str, const AlterEnumStmt *node)
2813
0
{
2814
0
  WRITE_NODE_TYPE("ALTERENUMSTMT");
2815
2816
0
  WRITE_NODE_FIELD(typeName);
2817
0
  WRITE_STRING_FIELD(oldVal);
2818
0
  WRITE_STRING_FIELD(newVal);
2819
0
  WRITE_STRING_FIELD(newValNeighbor);
2820
0
  WRITE_BOOL_FIELD(newValIsAfter);
2821
0
  WRITE_BOOL_FIELD(skipIfNewValExists);
2822
0
}
2823
2824
static void
2825
_outViewStmt(StringInfo str, const ViewStmt *node)
2826
0
{
2827
0
  WRITE_NODE_TYPE("VIEWSTMT");
2828
2829
0
  WRITE_NODE_FIELD(view);
2830
0
  WRITE_NODE_FIELD(aliases);
2831
0
  WRITE_NODE_FIELD(query);
2832
0
  WRITE_BOOL_FIELD(replace);
2833
0
  WRITE_NODE_FIELD(options);
2834
0
  WRITE_ENUM_FIELD(withCheckOption, ViewCheckOption);
2835
0
}
2836
2837
static void
2838
_outLoadStmt(StringInfo str, const LoadStmt *node)
2839
0
{
2840
0
  WRITE_NODE_TYPE("LOADSTMT");
2841
2842
0
  WRITE_STRING_FIELD(filename);
2843
0
}
2844
2845
static void
2846
_outCreatedbStmt(StringInfo str, const CreatedbStmt *node)
2847
0
{
2848
0
  WRITE_NODE_TYPE("CREATEDBSTMT");
2849
2850
0
  WRITE_STRING_FIELD(dbname);
2851
0
  WRITE_NODE_FIELD(options);
2852
0
}
2853
2854
static void
2855
_outAlterDatabaseStmt(StringInfo str, const AlterDatabaseStmt *node)
2856
0
{
2857
0
  WRITE_NODE_TYPE("ALTERDATABASESTMT");
2858
2859
0
  WRITE_STRING_FIELD(dbname);
2860
0
  WRITE_NODE_FIELD(options);
2861
0
}
2862
2863
static void
2864
_outAlterDatabaseRefreshCollStmt(StringInfo str, const AlterDatabaseRefreshCollStmt *node)
2865
0
{
2866
0
  WRITE_NODE_TYPE("ALTERDATABASEREFRESHCOLLSTMT");
2867
2868
0
  WRITE_STRING_FIELD(dbname);
2869
0
}
2870
2871
static void
2872
_outAlterDatabaseSetStmt(StringInfo str, const AlterDatabaseSetStmt *node)
2873
0
{
2874
0
  WRITE_NODE_TYPE("ALTERDATABASESETSTMT");
2875
2876
0
  WRITE_STRING_FIELD(dbname);
2877
0
  WRITE_NODE_FIELD(setstmt);
2878
0
}
2879
2880
static void
2881
_outDropdbStmt(StringInfo str, const DropdbStmt *node)
2882
0
{
2883
0
  WRITE_NODE_TYPE("DROPDBSTMT");
2884
2885
0
  WRITE_STRING_FIELD(dbname);
2886
0
  WRITE_BOOL_FIELD(missing_ok);
2887
0
  WRITE_NODE_FIELD(options);
2888
0
}
2889
2890
static void
2891
_outAlterSystemStmt(StringInfo str, const AlterSystemStmt *node)
2892
0
{
2893
0
  WRITE_NODE_TYPE("ALTERSYSTEMSTMT");
2894
2895
0
  WRITE_NODE_FIELD(setstmt);
2896
0
}
2897
2898
static void
2899
_outClusterStmt(StringInfo str, const ClusterStmt *node)
2900
0
{
2901
0
  WRITE_NODE_TYPE("CLUSTERSTMT");
2902
2903
0
  WRITE_NODE_FIELD(relation);
2904
0
  WRITE_STRING_FIELD(indexname);
2905
0
  WRITE_NODE_FIELD(params);
2906
0
}
2907
2908
static void
2909
_outVacuumStmt(StringInfo str, const VacuumStmt *node)
2910
0
{
2911
0
  WRITE_NODE_TYPE("VACUUMSTMT");
2912
2913
0
  WRITE_NODE_FIELD(options);
2914
0
  WRITE_NODE_FIELD(rels);
2915
0
  WRITE_BOOL_FIELD(is_vacuumcmd);
2916
0
}
2917
2918
static void
2919
_outVacuumRelation(StringInfo str, const VacuumRelation *node)
2920
0
{
2921
0
  WRITE_NODE_TYPE("VACUUMRELATION");
2922
2923
0
  WRITE_NODE_FIELD(relation);
2924
0
  WRITE_OID_FIELD(oid);
2925
0
  WRITE_NODE_FIELD(va_cols);
2926
0
}
2927
2928
static void
2929
_outExplainStmt(StringInfo str, const ExplainStmt *node)
2930
0
{
2931
0
  WRITE_NODE_TYPE("EXPLAINSTMT");
2932
2933
0
  WRITE_NODE_FIELD(query);
2934
0
  WRITE_NODE_FIELD(options);
2935
0
}
2936
2937
static void
2938
_outCreateTableAsStmt(StringInfo str, const CreateTableAsStmt *node)
2939
0
{
2940
0
  WRITE_NODE_TYPE("CREATETABLEASSTMT");
2941
2942
0
  WRITE_NODE_FIELD(query);
2943
0
  WRITE_NODE_FIELD(into);
2944
0
  WRITE_ENUM_FIELD(objtype, ObjectType);
2945
0
  WRITE_BOOL_FIELD(is_select_into);
2946
0
  WRITE_BOOL_FIELD(if_not_exists);
2947
0
}
2948
2949
static void
2950
_outRefreshMatViewStmt(StringInfo str, const RefreshMatViewStmt *node)
2951
0
{
2952
0
  WRITE_NODE_TYPE("REFRESHMATVIEWSTMT");
2953
2954
0
  WRITE_BOOL_FIELD(concurrent);
2955
0
  WRITE_BOOL_FIELD(skipData);
2956
0
  WRITE_NODE_FIELD(relation);
2957
0
}
2958
2959
static void
2960
_outCheckPointStmt(StringInfo str, const CheckPointStmt *node)
2961
0
{
2962
0
  WRITE_NODE_TYPE("CHECKPOINTSTMT");
2963
2964
0
  WRITE_NODE_FIELD(options);
2965
0
}
2966
2967
static void
2968
_outDiscardStmt(StringInfo str, const DiscardStmt *node)
2969
0
{
2970
0
  WRITE_NODE_TYPE("DISCARDSTMT");
2971
2972
0
  WRITE_ENUM_FIELD(target, DiscardMode);
2973
0
}
2974
2975
static void
2976
_outLockStmt(StringInfo str, const LockStmt *node)
2977
0
{
2978
0
  WRITE_NODE_TYPE("LOCKSTMT");
2979
2980
0
  WRITE_NODE_FIELD(relations);
2981
0
  WRITE_INT_FIELD(mode);
2982
0
  WRITE_BOOL_FIELD(nowait);
2983
0
}
2984
2985
static void
2986
_outConstraintsSetStmt(StringInfo str, const ConstraintsSetStmt *node)
2987
0
{
2988
0
  WRITE_NODE_TYPE("CONSTRAINTSSETSTMT");
2989
2990
0
  WRITE_NODE_FIELD(constraints);
2991
0
  WRITE_BOOL_FIELD(deferred);
2992
0
}
2993
2994
static void
2995
_outReindexStmt(StringInfo str, const ReindexStmt *node)
2996
0
{
2997
0
  WRITE_NODE_TYPE("REINDEXSTMT");
2998
2999
0
  WRITE_ENUM_FIELD(kind, ReindexObjectType);
3000
0
  WRITE_NODE_FIELD(relation);
3001
0
  WRITE_STRING_FIELD(name);
3002
0
  WRITE_NODE_FIELD(params);
3003
0
}
3004
3005
static void
3006
_outCreateConversionStmt(StringInfo str, const CreateConversionStmt *node)
3007
0
{
3008
0
  WRITE_NODE_TYPE("CREATECONVERSIONSTMT");
3009
3010
0
  WRITE_NODE_FIELD(conversion_name);
3011
0
  WRITE_STRING_FIELD(for_encoding_name);
3012
0
  WRITE_STRING_FIELD(to_encoding_name);
3013
0
  WRITE_NODE_FIELD(func_name);
3014
0
  WRITE_BOOL_FIELD(def);
3015
0
}
3016
3017
static void
3018
_outCreateCastStmt(StringInfo str, const CreateCastStmt *node)
3019
0
{
3020
0
  WRITE_NODE_TYPE("CREATECASTSTMT");
3021
3022
0
  WRITE_NODE_FIELD(sourcetype);
3023
0
  WRITE_NODE_FIELD(targettype);
3024
0
  WRITE_NODE_FIELD(func);
3025
0
  WRITE_ENUM_FIELD(context, CoercionContext);
3026
0
  WRITE_BOOL_FIELD(inout);
3027
0
}
3028
3029
static void
3030
_outCreateTransformStmt(StringInfo str, const CreateTransformStmt *node)
3031
0
{
3032
0
  WRITE_NODE_TYPE("CREATETRANSFORMSTMT");
3033
3034
0
  WRITE_BOOL_FIELD(replace);
3035
0
  WRITE_NODE_FIELD(type_name);
3036
0
  WRITE_STRING_FIELD(lang);
3037
0
  WRITE_NODE_FIELD(fromsql);
3038
0
  WRITE_NODE_FIELD(tosql);
3039
0
}
3040
3041
static void
3042
_outPrepareStmt(StringInfo str, const PrepareStmt *node)
3043
0
{
3044
0
  WRITE_NODE_TYPE("PREPARESTMT");
3045
3046
0
  WRITE_STRING_FIELD(name);
3047
0
  WRITE_NODE_FIELD(argtypes);
3048
0
  WRITE_NODE_FIELD(query);
3049
0
}
3050
3051
static void
3052
_outExecuteStmt(StringInfo str, const ExecuteStmt *node)
3053
0
{
3054
0
  WRITE_NODE_TYPE("EXECUTESTMT");
3055
3056
0
  WRITE_STRING_FIELD(name);
3057
0
  WRITE_NODE_FIELD(params);
3058
0
}
3059
3060
static void
3061
_outDeallocateStmt(StringInfo str, const DeallocateStmt *node)
3062
0
{
3063
0
  WRITE_NODE_TYPE("DEALLOCATESTMT");
3064
3065
0
  WRITE_STRING_FIELD(name);
3066
0
  WRITE_BOOL_FIELD(isall);
3067
0
  WRITE_LOCATION_FIELD(location);
3068
0
}
3069
3070
static void
3071
_outDropOwnedStmt(StringInfo str, const DropOwnedStmt *node)
3072
0
{
3073
0
  WRITE_NODE_TYPE("DROPOWNEDSTMT");
3074
3075
0
  WRITE_NODE_FIELD(roles);
3076
0
  WRITE_ENUM_FIELD(behavior, DropBehavior);
3077
0
}
3078
3079
static void
3080
_outReassignOwnedStmt(StringInfo str, const ReassignOwnedStmt *node)
3081
0
{
3082
0
  WRITE_NODE_TYPE("REASSIGNOWNEDSTMT");
3083
3084
0
  WRITE_NODE_FIELD(roles);
3085
0
  WRITE_NODE_FIELD(newrole);
3086
0
}
3087
3088
static void
3089
_outAlterTSDictionaryStmt(StringInfo str, const AlterTSDictionaryStmt *node)
3090
0
{
3091
0
  WRITE_NODE_TYPE("ALTERTSDICTIONARYSTMT");
3092
3093
0
  WRITE_NODE_FIELD(dictname);
3094
0
  WRITE_NODE_FIELD(options);
3095
0
}
3096
3097
static void
3098
_outAlterTSConfigurationStmt(StringInfo str, const AlterTSConfigurationStmt *node)
3099
0
{
3100
0
  WRITE_NODE_TYPE("ALTERTSCONFIGURATIONSTMT");
3101
3102
0
  WRITE_ENUM_FIELD(kind, AlterTSConfigType);
3103
0
  WRITE_NODE_FIELD(cfgname);
3104
0
  WRITE_NODE_FIELD(tokentype);
3105
0
  WRITE_NODE_FIELD(dicts);
3106
0
  WRITE_BOOL_FIELD(override);
3107
0
  WRITE_BOOL_FIELD(replace);
3108
0
  WRITE_BOOL_FIELD(missing_ok);
3109
0
}
3110
3111
static void
3112
_outPublicationTable(StringInfo str, const PublicationTable *node)
3113
0
{
3114
0
  WRITE_NODE_TYPE("PUBLICATIONTABLE");
3115
3116
0
  WRITE_NODE_FIELD(relation);
3117
0
  WRITE_NODE_FIELD(whereClause);
3118
0
  WRITE_NODE_FIELD(columns);
3119
0
}
3120
3121
static void
3122
_outPublicationObjSpec(StringInfo str, const PublicationObjSpec *node)
3123
0
{
3124
0
  WRITE_NODE_TYPE("PUBLICATIONOBJSPEC");
3125
3126
0
  WRITE_ENUM_FIELD(pubobjtype, PublicationObjSpecType);
3127
0
  WRITE_STRING_FIELD(name);
3128
0
  WRITE_NODE_FIELD(pubtable);
3129
0
  WRITE_LOCATION_FIELD(location);
3130
0
}
3131
3132
static void
3133
_outPublicationAllObjSpec(StringInfo str, const PublicationAllObjSpec *node)
3134
0
{
3135
0
  WRITE_NODE_TYPE("PUBLICATIONALLOBJSPEC");
3136
3137
0
  WRITE_ENUM_FIELD(pubobjtype, PublicationAllObjType);
3138
0
  WRITE_LOCATION_FIELD(location);
3139
0
}
3140
3141
static void
3142
_outCreatePublicationStmt(StringInfo str, const CreatePublicationStmt *node)
3143
0
{
3144
0
  WRITE_NODE_TYPE("CREATEPUBLICATIONSTMT");
3145
3146
0
  WRITE_STRING_FIELD(pubname);
3147
0
  WRITE_NODE_FIELD(options);
3148
0
  WRITE_NODE_FIELD(pubobjects);
3149
0
  WRITE_BOOL_FIELD(for_all_tables);
3150
0
  WRITE_BOOL_FIELD(for_all_sequences);
3151
0
}
3152
3153
static void
3154
_outAlterPublicationStmt(StringInfo str, const AlterPublicationStmt *node)
3155
0
{
3156
0
  WRITE_NODE_TYPE("ALTERPUBLICATIONSTMT");
3157
3158
0
  WRITE_STRING_FIELD(pubname);
3159
0
  WRITE_NODE_FIELD(options);
3160
0
  WRITE_NODE_FIELD(pubobjects);
3161
0
  WRITE_ENUM_FIELD(action, AlterPublicationAction);
3162
0
}
3163
3164
static void
3165
_outCreateSubscriptionStmt(StringInfo str, const CreateSubscriptionStmt *node)
3166
0
{
3167
0
  WRITE_NODE_TYPE("CREATESUBSCRIPTIONSTMT");
3168
3169
0
  WRITE_STRING_FIELD(subname);
3170
0
  WRITE_STRING_FIELD(conninfo);
3171
0
  WRITE_NODE_FIELD(publication);
3172
0
  WRITE_NODE_FIELD(options);
3173
0
}
3174
3175
static void
3176
_outAlterSubscriptionStmt(StringInfo str, const AlterSubscriptionStmt *node)
3177
0
{
3178
0
  WRITE_NODE_TYPE("ALTERSUBSCRIPTIONSTMT");
3179
3180
0
  WRITE_ENUM_FIELD(kind, AlterSubscriptionType);
3181
0
  WRITE_STRING_FIELD(subname);
3182
0
  WRITE_STRING_FIELD(conninfo);
3183
0
  WRITE_NODE_FIELD(publication);
3184
0
  WRITE_NODE_FIELD(options);
3185
0
}
3186
3187
static void
3188
_outDropSubscriptionStmt(StringInfo str, const DropSubscriptionStmt *node)
3189
0
{
3190
0
  WRITE_NODE_TYPE("DROPSUBSCRIPTIONSTMT");
3191
3192
0
  WRITE_STRING_FIELD(subname);
3193
0
  WRITE_BOOL_FIELD(missing_ok);
3194
0
  WRITE_ENUM_FIELD(behavior, DropBehavior);
3195
0
}
3196
3197
static void
3198
_outPlannerGlobal(StringInfo str, const PlannerGlobal *node)
3199
0
{
3200
0
  WRITE_NODE_TYPE("PLANNERGLOBAL");
3201
3202
0
  WRITE_NODE_FIELD(subplans);
3203
0
  WRITE_NODE_FIELD(subpaths);
3204
0
  WRITE_BITMAPSET_FIELD(rewindPlanIDs);
3205
0
  WRITE_NODE_FIELD(finalrtable);
3206
0
  WRITE_BITMAPSET_FIELD(allRelids);
3207
0
  WRITE_BITMAPSET_FIELD(prunableRelids);
3208
0
  WRITE_NODE_FIELD(finalrteperminfos);
3209
0
  WRITE_NODE_FIELD(finalrowmarks);
3210
0
  WRITE_NODE_FIELD(resultRelations);
3211
0
  WRITE_NODE_FIELD(appendRelations);
3212
0
  WRITE_NODE_FIELD(partPruneInfos);
3213
0
  WRITE_NODE_FIELD(relationOids);
3214
0
  WRITE_NODE_FIELD(invalItems);
3215
0
  WRITE_NODE_FIELD(paramExecTypes);
3216
0
  WRITE_UINT_FIELD(lastPHId);
3217
0
  WRITE_UINT_FIELD(lastRowMarkId);
3218
0
  WRITE_INT_FIELD(lastPlanNodeId);
3219
0
  WRITE_BOOL_FIELD(transientPlan);
3220
0
  WRITE_BOOL_FIELD(dependsOnRole);
3221
0
  WRITE_BOOL_FIELD(parallelModeOK);
3222
0
  WRITE_BOOL_FIELD(parallelModeNeeded);
3223
0
  WRITE_CHAR_FIELD(maxParallelHazard);
3224
0
  WRITE_INT_FIELD(extension_state_allocated);
3225
0
}
3226
3227
static void
3228
_outPlannerInfo(StringInfo str, const PlannerInfo *node)
3229
0
{
3230
0
  WRITE_NODE_TYPE("PLANNERINFO");
3231
3232
0
  WRITE_NODE_FIELD(parse);
3233
0
  WRITE_NODE_FIELD(glob);
3234
0
  WRITE_UINT_FIELD(query_level);
3235
0
  WRITE_STRING_FIELD(plan_name);
3236
0
  WRITE_NODE_FIELD(plan_params);
3237
0
  WRITE_BITMAPSET_FIELD(outer_params);
3238
0
  WRITE_NODE_ARRAY(simple_rel_array, node->simple_rel_array_size);
3239
0
  WRITE_INT_FIELD(simple_rel_array_size);
3240
0
  WRITE_BITMAPSET_FIELD(all_baserels);
3241
0
  WRITE_BITMAPSET_FIELD(outer_join_rels);
3242
0
  WRITE_BITMAPSET_FIELD(all_query_rels);
3243
0
  WRITE_NODE_FIELD(join_rel_list);
3244
0
  WRITE_INT_FIELD(join_cur_level);
3245
0
  WRITE_NODE_FIELD(init_plans);
3246
0
  WRITE_NODE_FIELD(cte_plan_ids);
3247
0
  WRITE_NODE_FIELD(multiexpr_params);
3248
0
  WRITE_NODE_FIELD(join_domains);
3249
0
  WRITE_NODE_FIELD(eq_classes);
3250
0
  WRITE_BOOL_FIELD(ec_merging_done);
3251
0
  WRITE_NODE_FIELD(canon_pathkeys);
3252
0
  WRITE_NODE_FIELD(left_join_clauses);
3253
0
  WRITE_NODE_FIELD(right_join_clauses);
3254
0
  WRITE_NODE_FIELD(full_join_clauses);
3255
0
  WRITE_NODE_FIELD(join_info_list);
3256
0
  WRITE_INT_FIELD(last_rinfo_serial);
3257
0
  WRITE_BITMAPSET_FIELD(all_result_relids);
3258
0
  WRITE_BITMAPSET_FIELD(leaf_result_relids);
3259
0
  WRITE_NODE_FIELD(append_rel_list);
3260
0
  WRITE_NODE_FIELD(row_identity_vars);
3261
0
  WRITE_NODE_FIELD(rowMarks);
3262
0
  WRITE_NODE_FIELD(placeholder_list);
3263
0
  WRITE_NODE_FIELD(agg_clause_list);
3264
0
  WRITE_NODE_FIELD(group_expr_list);
3265
0
  WRITE_NODE_FIELD(tlist_vars);
3266
0
  WRITE_NODE_FIELD(fkey_list);
3267
0
  WRITE_NODE_FIELD(query_pathkeys);
3268
0
  WRITE_NODE_FIELD(group_pathkeys);
3269
0
  WRITE_INT_FIELD(num_groupby_pathkeys);
3270
0
  WRITE_NODE_FIELD(window_pathkeys);
3271
0
  WRITE_NODE_FIELD(distinct_pathkeys);
3272
0
  WRITE_NODE_FIELD(sort_pathkeys);
3273
0
  WRITE_NODE_FIELD(setop_pathkeys);
3274
0
  WRITE_NODE_FIELD(processed_groupClause);
3275
0
  WRITE_NODE_FIELD(processed_distinctClause);
3276
0
  WRITE_NODE_FIELD(processed_tlist);
3277
0
  WRITE_NODE_FIELD(update_colnos);
3278
0
  WRITE_NODE_FIELD(minmax_aggs);
3279
0
  WRITE_FLOAT_FIELD(total_table_pages);
3280
0
  WRITE_FLOAT_FIELD(tuple_fraction);
3281
0
  WRITE_FLOAT_FIELD(limit_tuples);
3282
0
  WRITE_UINT_FIELD(qual_security_level);
3283
0
  WRITE_BOOL_FIELD(hasJoinRTEs);
3284
0
  WRITE_BOOL_FIELD(hasLateralRTEs);
3285
0
  WRITE_BOOL_FIELD(hasHavingQual);
3286
0
  WRITE_BOOL_FIELD(hasPseudoConstantQuals);
3287
0
  WRITE_BOOL_FIELD(hasAlternativeSubPlans);
3288
0
  WRITE_BOOL_FIELD(placeholdersFrozen);
3289
0
  WRITE_BOOL_FIELD(hasRecursion);
3290
0
  WRITE_BOOL_FIELD(assumeReplanning);
3291
0
  WRITE_INT_FIELD(group_rtindex);
3292
0
  WRITE_NODE_FIELD(agginfos);
3293
0
  WRITE_NODE_FIELD(aggtransinfos);
3294
0
  WRITE_INT_FIELD(numOrderedAggs);
3295
0
  WRITE_BOOL_FIELD(hasNonPartialAggs);
3296
0
  WRITE_BOOL_FIELD(hasNonSerialAggs);
3297
0
  WRITE_INT_FIELD(wt_param_id);
3298
0
  WRITE_NODE_FIELD(non_recursive_path);
3299
0
  WRITE_BITMAPSET_FIELD(curOuterRels);
3300
0
  WRITE_NODE_FIELD(curOuterParams);
3301
0
  WRITE_BOOL_FIELD(partColsUpdated);
3302
0
  WRITE_NODE_FIELD(partPruneInfos);
3303
0
  WRITE_INT_FIELD(extension_state_allocated);
3304
0
}
3305
3306
static void
3307
_outRelOptInfo(StringInfo str, const RelOptInfo *node)
3308
0
{
3309
0
  WRITE_NODE_TYPE("RELOPTINFO");
3310
3311
0
  WRITE_ENUM_FIELD(reloptkind, RelOptKind);
3312
0
  WRITE_BITMAPSET_FIELD(relids);
3313
0
  WRITE_FLOAT_FIELD(rows);
3314
0
  WRITE_BOOL_FIELD(consider_startup);
3315
0
  WRITE_BOOL_FIELD(consider_param_startup);
3316
0
  WRITE_BOOL_FIELD(consider_parallel);
3317
0
  WRITE_NODE_FIELD(reltarget);
3318
0
  WRITE_NODE_FIELD(pathlist);
3319
0
  WRITE_NODE_FIELD(ppilist);
3320
0
  WRITE_NODE_FIELD(partial_pathlist);
3321
0
  WRITE_NODE_FIELD(cheapest_startup_path);
3322
0
  WRITE_NODE_FIELD(cheapest_total_path);
3323
0
  WRITE_NODE_FIELD(cheapest_parameterized_paths);
3324
0
  WRITE_BITMAPSET_FIELD(direct_lateral_relids);
3325
0
  WRITE_BITMAPSET_FIELD(lateral_relids);
3326
0
  WRITE_UINT_FIELD(relid);
3327
0
  WRITE_OID_FIELD(reltablespace);
3328
0
  WRITE_ENUM_FIELD(rtekind, RTEKind);
3329
0
  WRITE_INT_FIELD(min_attr);
3330
0
  WRITE_INT_FIELD(max_attr);
3331
0
  WRITE_BITMAPSET_FIELD(notnullattnums);
3332
0
  WRITE_BITMAPSET_FIELD(nulling_relids);
3333
0
  WRITE_NODE_FIELD(lateral_vars);
3334
0
  WRITE_BITMAPSET_FIELD(lateral_referencers);
3335
0
  WRITE_NODE_FIELD(indexlist);
3336
0
  WRITE_NODE_FIELD(statlist);
3337
0
  WRITE_UINT_FIELD(pages);
3338
0
  WRITE_FLOAT_FIELD(tuples);
3339
0
  WRITE_FLOAT_FIELD(allvisfrac);
3340
0
  WRITE_BITMAPSET_FIELD(eclass_indexes);
3341
0
  WRITE_NODE_FIELD(subroot);
3342
0
  WRITE_NODE_FIELD(subplan_params);
3343
0
  WRITE_INT_FIELD(rel_parallel_workers);
3344
0
  WRITE_UINT_FIELD(amflags);
3345
0
  WRITE_OID_FIELD(serverid);
3346
0
  WRITE_OID_FIELD(userid);
3347
0
  WRITE_BOOL_FIELD(useridiscurrent);
3348
0
  WRITE_NODE_FIELD(unique_for_rels);
3349
0
  WRITE_NODE_FIELD(non_unique_for_rels);
3350
0
  WRITE_NODE_FIELD(unique_rel);
3351
0
  WRITE_NODE_FIELD(unique_pathkeys);
3352
0
  WRITE_NODE_FIELD(unique_groupclause);
3353
0
  WRITE_NODE_FIELD(baserestrictinfo);
3354
0
  WRITE_FLOAT_FIELD(baserestrictcost.startup);
3355
0
  WRITE_FLOAT_FIELD(baserestrictcost.per_tuple);
3356
0
  WRITE_UINT_FIELD(baserestrict_min_security);
3357
0
  WRITE_NODE_FIELD(joininfo);
3358
0
  WRITE_BOOL_FIELD(has_eclass_joins);
3359
0
  WRITE_BOOL_FIELD(consider_partitionwise_join);
3360
0
  WRITE_NODE_FIELD(agg_info);
3361
0
  WRITE_NODE_FIELD(grouped_rel);
3362
0
  WRITE_BITMAPSET_FIELD(top_parent_relids);
3363
0
  WRITE_INT_FIELD(nparts);
3364
0
  WRITE_BOOL_FIELD(partbounds_merged);
3365
0
  WRITE_NODE_FIELD(partition_qual);
3366
0
  WRITE_BITMAPSET_FIELD(live_parts);
3367
0
  WRITE_BITMAPSET_FIELD(all_partrels);
3368
0
  WRITE_INT_FIELD(extension_state_allocated);
3369
0
}
3370
3371
static void
3372
_outRelAggInfo(StringInfo str, const RelAggInfo *node)
3373
0
{
3374
0
  WRITE_NODE_TYPE("RELAGGINFO");
3375
3376
0
  WRITE_NODE_FIELD(target);
3377
0
  WRITE_NODE_FIELD(agg_input);
3378
0
  WRITE_NODE_FIELD(group_clauses);
3379
0
  WRITE_NODE_FIELD(group_exprs);
3380
0
  WRITE_BITMAPSET_FIELD(apply_at);
3381
0
  WRITE_FLOAT_FIELD(grouped_rows);
3382
0
  WRITE_BOOL_FIELD(agg_useful);
3383
0
}
3384
3385
static void
3386
_outIndexOptInfo(StringInfo str, const IndexOptInfo *node)
3387
0
{
3388
0
  WRITE_NODE_TYPE("INDEXOPTINFO");
3389
3390
0
  WRITE_OID_FIELD(indexoid);
3391
0
  WRITE_OID_FIELD(reltablespace);
3392
0
  WRITE_UINT_FIELD(pages);
3393
0
  WRITE_FLOAT_FIELD(tuples);
3394
0
  WRITE_INT_FIELD(tree_height);
3395
0
  WRITE_INT_FIELD(ncolumns);
3396
0
  WRITE_INT_FIELD(nkeycolumns);
3397
0
  WRITE_INT_ARRAY(indexkeys, node->ncolumns);
3398
0
  WRITE_OID_ARRAY(indexcollations, node->nkeycolumns);
3399
0
  WRITE_OID_ARRAY(opfamily, node->nkeycolumns);
3400
0
  WRITE_OID_ARRAY(opcintype, node->nkeycolumns);
3401
0
  WRITE_OID_ARRAY(sortopfamily, node->nkeycolumns);
3402
0
  WRITE_BOOL_ARRAY(reverse_sort, node->nkeycolumns);
3403
0
  WRITE_BOOL_ARRAY(nulls_first, node->nkeycolumns);
3404
0
  WRITE_BOOL_ARRAY(canreturn, node->ncolumns);
3405
0
  WRITE_OID_FIELD(relam);
3406
0
  WRITE_NODE_FIELD(indpred);
3407
0
  WRITE_NODE_FIELD(indextlist);
3408
0
  WRITE_NODE_FIELD(indrestrictinfo);
3409
0
  WRITE_BOOL_FIELD(predOK);
3410
0
  WRITE_BOOL_FIELD(unique);
3411
0
  WRITE_BOOL_FIELD(nullsnotdistinct);
3412
0
  WRITE_BOOL_FIELD(immediate);
3413
0
  WRITE_BOOL_FIELD(hypothetical);
3414
0
  WRITE_BOOL_FIELD(amcanorderbyop);
3415
0
  WRITE_BOOL_FIELD(amoptionalkey);
3416
0
  WRITE_BOOL_FIELD(amsearcharray);
3417
0
  WRITE_BOOL_FIELD(amsearchnulls);
3418
0
  WRITE_BOOL_FIELD(amhasgettuple);
3419
0
  WRITE_BOOL_FIELD(amhasgetbitmap);
3420
0
  WRITE_BOOL_FIELD(amcanparallel);
3421
0
  WRITE_BOOL_FIELD(amcanmarkpos);
3422
0
}
3423
3424
static void
3425
_outStatisticExtInfo(StringInfo str, const StatisticExtInfo *node)
3426
0
{
3427
0
  WRITE_NODE_TYPE("STATISTICEXTINFO");
3428
3429
0
  WRITE_OID_FIELD(statOid);
3430
0
  WRITE_BOOL_FIELD(inherit);
3431
0
  WRITE_CHAR_FIELD(kind);
3432
0
  WRITE_BITMAPSET_FIELD(keys);
3433
0
  WRITE_NODE_FIELD(exprs);
3434
0
}
3435
3436
static void
3437
_outJoinDomain(StringInfo str, const JoinDomain *node)
3438
0
{
3439
0
  WRITE_NODE_TYPE("JOINDOMAIN");
3440
3441
0
  WRITE_BITMAPSET_FIELD(jd_relids);
3442
0
}
3443
3444
static void
3445
_outEquivalenceMember(StringInfo str, const EquivalenceMember *node)
3446
0
{
3447
0
  WRITE_NODE_TYPE("EQUIVALENCEMEMBER");
3448
3449
0
  WRITE_NODE_FIELD(em_expr);
3450
0
  WRITE_BITMAPSET_FIELD(em_relids);
3451
0
  WRITE_BOOL_FIELD(em_is_const);
3452
0
  WRITE_BOOL_FIELD(em_is_child);
3453
0
  WRITE_OID_FIELD(em_datatype);
3454
0
  WRITE_NODE_FIELD(em_jdomain);
3455
0
}
3456
3457
static void
3458
_outPathKey(StringInfo str, const PathKey *node)
3459
0
{
3460
0
  WRITE_NODE_TYPE("PATHKEY");
3461
3462
0
  WRITE_NODE_FIELD(pk_eclass);
3463
0
  WRITE_OID_FIELD(pk_opfamily);
3464
0
  WRITE_ENUM_FIELD(pk_cmptype, CompareType);
3465
0
  WRITE_BOOL_FIELD(pk_nulls_first);
3466
0
}
3467
3468
static void
3469
_outGroupByOrdering(StringInfo str, const GroupByOrdering *node)
3470
0
{
3471
0
  WRITE_NODE_TYPE("GROUPBYORDERING");
3472
3473
0
  WRITE_NODE_FIELD(pathkeys);
3474
0
  WRITE_NODE_FIELD(clauses);
3475
0
}
3476
3477
static void
3478
_outPathTarget(StringInfo str, const PathTarget *node)
3479
0
{
3480
0
  WRITE_NODE_TYPE("PATHTARGET");
3481
3482
0
  WRITE_NODE_FIELD(exprs);
3483
0
  WRITE_INDEX_ARRAY(sortgrouprefs, list_length(node->exprs));
3484
0
  WRITE_FLOAT_FIELD(cost.startup);
3485
0
  WRITE_FLOAT_FIELD(cost.per_tuple);
3486
0
  WRITE_INT_FIELD(width);
3487
0
  WRITE_ENUM_FIELD(has_volatile_expr, VolatileFunctionStatus);
3488
0
}
3489
3490
static void
3491
_outParamPathInfo(StringInfo str, const ParamPathInfo *node)
3492
0
{
3493
0
  WRITE_NODE_TYPE("PARAMPATHINFO");
3494
3495
0
  WRITE_BITMAPSET_FIELD(ppi_req_outer);
3496
0
  WRITE_FLOAT_FIELD(ppi_rows);
3497
0
  WRITE_NODE_FIELD(ppi_clauses);
3498
0
  WRITE_BITMAPSET_FIELD(ppi_serials);
3499
0
}
3500
3501
static void
3502
_outPath(StringInfo str, const Path *node)
3503
0
{
3504
0
  WRITE_NODE_TYPE("PATH");
3505
3506
0
  WRITE_ENUM_FIELD(pathtype, NodeTag);
3507
0
  appendStringInfoString(str, " :parent_relids ");
3508
0
  outBitmapset(str, node->parent->relids);
3509
0
  if (node->pathtarget != node->parent->reltarget)
3510
0
    WRITE_NODE_FIELD(pathtarget);
3511
0
  appendStringInfoString(str, " :required_outer ");
3512
0
  if (node->param_info)
3513
0
    outBitmapset(str, node->param_info->ppi_req_outer);
3514
0
  else
3515
0
    outBitmapset(str, NULL);
3516
0
  WRITE_BOOL_FIELD(parallel_aware);
3517
0
  WRITE_BOOL_FIELD(parallel_safe);
3518
0
  WRITE_INT_FIELD(parallel_workers);
3519
0
  WRITE_FLOAT_FIELD(rows);
3520
0
  WRITE_INT_FIELD(disabled_nodes);
3521
0
  WRITE_FLOAT_FIELD(startup_cost);
3522
0
  WRITE_FLOAT_FIELD(total_cost);
3523
0
  WRITE_NODE_FIELD(pathkeys);
3524
0
}
3525
3526
static void
3527
_outIndexPath(StringInfo str, const IndexPath *node)
3528
0
{
3529
0
  WRITE_NODE_TYPE("INDEXPATH");
3530
3531
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
3532
0
  appendStringInfoString(str, " :parent_relids ");
3533
0
  outBitmapset(str, node->path.parent->relids);
3534
0
  if (node->path.pathtarget != node->path.parent->reltarget)
3535
0
    WRITE_NODE_FIELD(path.pathtarget);
3536
0
  appendStringInfoString(str, " :required_outer ");
3537
0
  if (node->path.param_info)
3538
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
3539
0
  else
3540
0
    outBitmapset(str, NULL);
3541
0
  WRITE_BOOL_FIELD(path.parallel_aware);
3542
0
  WRITE_BOOL_FIELD(path.parallel_safe);
3543
0
  WRITE_INT_FIELD(path.parallel_workers);
3544
0
  WRITE_FLOAT_FIELD(path.rows);
3545
0
  WRITE_INT_FIELD(path.disabled_nodes);
3546
0
  WRITE_FLOAT_FIELD(path.startup_cost);
3547
0
  WRITE_FLOAT_FIELD(path.total_cost);
3548
0
  WRITE_NODE_FIELD(path.pathkeys);
3549
0
  WRITE_NODE_FIELD(indexinfo);
3550
0
  WRITE_NODE_FIELD(indexclauses);
3551
0
  WRITE_NODE_FIELD(indexorderbys);
3552
0
  WRITE_NODE_FIELD(indexorderbycols);
3553
0
  WRITE_ENUM_FIELD(indexscandir, ScanDirection);
3554
0
  WRITE_FLOAT_FIELD(indextotalcost);
3555
0
  WRITE_FLOAT_FIELD(indexselectivity);
3556
0
}
3557
3558
static void
3559
_outIndexClause(StringInfo str, const IndexClause *node)
3560
0
{
3561
0
  WRITE_NODE_TYPE("INDEXCLAUSE");
3562
3563
0
  WRITE_NODE_FIELD(rinfo);
3564
0
  WRITE_NODE_FIELD(indexquals);
3565
0
  WRITE_BOOL_FIELD(lossy);
3566
0
  WRITE_INT_FIELD(indexcol);
3567
0
  WRITE_NODE_FIELD(indexcols);
3568
0
}
3569
3570
static void
3571
_outBitmapHeapPath(StringInfo str, const BitmapHeapPath *node)
3572
0
{
3573
0
  WRITE_NODE_TYPE("BITMAPHEAPPATH");
3574
3575
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
3576
0
  appendStringInfoString(str, " :parent_relids ");
3577
0
  outBitmapset(str, node->path.parent->relids);
3578
0
  if (node->path.pathtarget != node->path.parent->reltarget)
3579
0
    WRITE_NODE_FIELD(path.pathtarget);
3580
0
  appendStringInfoString(str, " :required_outer ");
3581
0
  if (node->path.param_info)
3582
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
3583
0
  else
3584
0
    outBitmapset(str, NULL);
3585
0
  WRITE_BOOL_FIELD(path.parallel_aware);
3586
0
  WRITE_BOOL_FIELD(path.parallel_safe);
3587
0
  WRITE_INT_FIELD(path.parallel_workers);
3588
0
  WRITE_FLOAT_FIELD(path.rows);
3589
0
  WRITE_INT_FIELD(path.disabled_nodes);
3590
0
  WRITE_FLOAT_FIELD(path.startup_cost);
3591
0
  WRITE_FLOAT_FIELD(path.total_cost);
3592
0
  WRITE_NODE_FIELD(path.pathkeys);
3593
0
  WRITE_NODE_FIELD(bitmapqual);
3594
0
}
3595
3596
static void
3597
_outBitmapAndPath(StringInfo str, const BitmapAndPath *node)
3598
0
{
3599
0
  WRITE_NODE_TYPE("BITMAPANDPATH");
3600
3601
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
3602
0
  appendStringInfoString(str, " :parent_relids ");
3603
0
  outBitmapset(str, node->path.parent->relids);
3604
0
  if (node->path.pathtarget != node->path.parent->reltarget)
3605
0
    WRITE_NODE_FIELD(path.pathtarget);
3606
0
  appendStringInfoString(str, " :required_outer ");
3607
0
  if (node->path.param_info)
3608
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
3609
0
  else
3610
0
    outBitmapset(str, NULL);
3611
0
  WRITE_BOOL_FIELD(path.parallel_aware);
3612
0
  WRITE_BOOL_FIELD(path.parallel_safe);
3613
0
  WRITE_INT_FIELD(path.parallel_workers);
3614
0
  WRITE_FLOAT_FIELD(path.rows);
3615
0
  WRITE_INT_FIELD(path.disabled_nodes);
3616
0
  WRITE_FLOAT_FIELD(path.startup_cost);
3617
0
  WRITE_FLOAT_FIELD(path.total_cost);
3618
0
  WRITE_NODE_FIELD(path.pathkeys);
3619
0
  WRITE_NODE_FIELD(bitmapquals);
3620
0
  WRITE_FLOAT_FIELD(bitmapselectivity);
3621
0
}
3622
3623
static void
3624
_outBitmapOrPath(StringInfo str, const BitmapOrPath *node)
3625
0
{
3626
0
  WRITE_NODE_TYPE("BITMAPORPATH");
3627
3628
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
3629
0
  appendStringInfoString(str, " :parent_relids ");
3630
0
  outBitmapset(str, node->path.parent->relids);
3631
0
  if (node->path.pathtarget != node->path.parent->reltarget)
3632
0
    WRITE_NODE_FIELD(path.pathtarget);
3633
0
  appendStringInfoString(str, " :required_outer ");
3634
0
  if (node->path.param_info)
3635
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
3636
0
  else
3637
0
    outBitmapset(str, NULL);
3638
0
  WRITE_BOOL_FIELD(path.parallel_aware);
3639
0
  WRITE_BOOL_FIELD(path.parallel_safe);
3640
0
  WRITE_INT_FIELD(path.parallel_workers);
3641
0
  WRITE_FLOAT_FIELD(path.rows);
3642
0
  WRITE_INT_FIELD(path.disabled_nodes);
3643
0
  WRITE_FLOAT_FIELD(path.startup_cost);
3644
0
  WRITE_FLOAT_FIELD(path.total_cost);
3645
0
  WRITE_NODE_FIELD(path.pathkeys);
3646
0
  WRITE_NODE_FIELD(bitmapquals);
3647
0
  WRITE_FLOAT_FIELD(bitmapselectivity);
3648
0
}
3649
3650
static void
3651
_outTidPath(StringInfo str, const TidPath *node)
3652
0
{
3653
0
  WRITE_NODE_TYPE("TIDPATH");
3654
3655
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
3656
0
  appendStringInfoString(str, " :parent_relids ");
3657
0
  outBitmapset(str, node->path.parent->relids);
3658
0
  if (node->path.pathtarget != node->path.parent->reltarget)
3659
0
    WRITE_NODE_FIELD(path.pathtarget);
3660
0
  appendStringInfoString(str, " :required_outer ");
3661
0
  if (node->path.param_info)
3662
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
3663
0
  else
3664
0
    outBitmapset(str, NULL);
3665
0
  WRITE_BOOL_FIELD(path.parallel_aware);
3666
0
  WRITE_BOOL_FIELD(path.parallel_safe);
3667
0
  WRITE_INT_FIELD(path.parallel_workers);
3668
0
  WRITE_FLOAT_FIELD(path.rows);
3669
0
  WRITE_INT_FIELD(path.disabled_nodes);
3670
0
  WRITE_FLOAT_FIELD(path.startup_cost);
3671
0
  WRITE_FLOAT_FIELD(path.total_cost);
3672
0
  WRITE_NODE_FIELD(path.pathkeys);
3673
0
  WRITE_NODE_FIELD(tidquals);
3674
0
}
3675
3676
static void
3677
_outTidRangePath(StringInfo str, const TidRangePath *node)
3678
0
{
3679
0
  WRITE_NODE_TYPE("TIDRANGEPATH");
3680
3681
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
3682
0
  appendStringInfoString(str, " :parent_relids ");
3683
0
  outBitmapset(str, node->path.parent->relids);
3684
0
  if (node->path.pathtarget != node->path.parent->reltarget)
3685
0
    WRITE_NODE_FIELD(path.pathtarget);
3686
0
  appendStringInfoString(str, " :required_outer ");
3687
0
  if (node->path.param_info)
3688
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
3689
0
  else
3690
0
    outBitmapset(str, NULL);
3691
0
  WRITE_BOOL_FIELD(path.parallel_aware);
3692
0
  WRITE_BOOL_FIELD(path.parallel_safe);
3693
0
  WRITE_INT_FIELD(path.parallel_workers);
3694
0
  WRITE_FLOAT_FIELD(path.rows);
3695
0
  WRITE_INT_FIELD(path.disabled_nodes);
3696
0
  WRITE_FLOAT_FIELD(path.startup_cost);
3697
0
  WRITE_FLOAT_FIELD(path.total_cost);
3698
0
  WRITE_NODE_FIELD(path.pathkeys);
3699
0
  WRITE_NODE_FIELD(tidrangequals);
3700
0
}
3701
3702
static void
3703
_outSubqueryScanPath(StringInfo str, const SubqueryScanPath *node)
3704
0
{
3705
0
  WRITE_NODE_TYPE("SUBQUERYSCANPATH");
3706
3707
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
3708
0
  appendStringInfoString(str, " :parent_relids ");
3709
0
  outBitmapset(str, node->path.parent->relids);
3710
0
  if (node->path.pathtarget != node->path.parent->reltarget)
3711
0
    WRITE_NODE_FIELD(path.pathtarget);
3712
0
  appendStringInfoString(str, " :required_outer ");
3713
0
  if (node->path.param_info)
3714
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
3715
0
  else
3716
0
    outBitmapset(str, NULL);
3717
0
  WRITE_BOOL_FIELD(path.parallel_aware);
3718
0
  WRITE_BOOL_FIELD(path.parallel_safe);
3719
0
  WRITE_INT_FIELD(path.parallel_workers);
3720
0
  WRITE_FLOAT_FIELD(path.rows);
3721
0
  WRITE_INT_FIELD(path.disabled_nodes);
3722
0
  WRITE_FLOAT_FIELD(path.startup_cost);
3723
0
  WRITE_FLOAT_FIELD(path.total_cost);
3724
0
  WRITE_NODE_FIELD(path.pathkeys);
3725
0
  WRITE_NODE_FIELD(subpath);
3726
0
}
3727
3728
static void
3729
_outForeignPath(StringInfo str, const ForeignPath *node)
3730
0
{
3731
0
  WRITE_NODE_TYPE("FOREIGNPATH");
3732
3733
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
3734
0
  appendStringInfoString(str, " :parent_relids ");
3735
0
  outBitmapset(str, node->path.parent->relids);
3736
0
  if (node->path.pathtarget != node->path.parent->reltarget)
3737
0
    WRITE_NODE_FIELD(path.pathtarget);
3738
0
  appendStringInfoString(str, " :required_outer ");
3739
0
  if (node->path.param_info)
3740
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
3741
0
  else
3742
0
    outBitmapset(str, NULL);
3743
0
  WRITE_BOOL_FIELD(path.parallel_aware);
3744
0
  WRITE_BOOL_FIELD(path.parallel_safe);
3745
0
  WRITE_INT_FIELD(path.parallel_workers);
3746
0
  WRITE_FLOAT_FIELD(path.rows);
3747
0
  WRITE_INT_FIELD(path.disabled_nodes);
3748
0
  WRITE_FLOAT_FIELD(path.startup_cost);
3749
0
  WRITE_FLOAT_FIELD(path.total_cost);
3750
0
  WRITE_NODE_FIELD(path.pathkeys);
3751
0
  WRITE_NODE_FIELD(fdw_outerpath);
3752
0
  WRITE_NODE_FIELD(fdw_restrictinfo);
3753
0
  WRITE_NODE_FIELD(fdw_private);
3754
0
}
3755
3756
static void
3757
_outCustomPath(StringInfo str, const CustomPath *node)
3758
0
{
3759
0
  WRITE_NODE_TYPE("CUSTOMPATH");
3760
3761
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
3762
0
  appendStringInfoString(str, " :parent_relids ");
3763
0
  outBitmapset(str, node->path.parent->relids);
3764
0
  if (node->path.pathtarget != node->path.parent->reltarget)
3765
0
    WRITE_NODE_FIELD(path.pathtarget);
3766
0
  appendStringInfoString(str, " :required_outer ");
3767
0
  if (node->path.param_info)
3768
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
3769
0
  else
3770
0
    outBitmapset(str, NULL);
3771
0
  WRITE_BOOL_FIELD(path.parallel_aware);
3772
0
  WRITE_BOOL_FIELD(path.parallel_safe);
3773
0
  WRITE_INT_FIELD(path.parallel_workers);
3774
0
  WRITE_FLOAT_FIELD(path.rows);
3775
0
  WRITE_INT_FIELD(path.disabled_nodes);
3776
0
  WRITE_FLOAT_FIELD(path.startup_cost);
3777
0
  WRITE_FLOAT_FIELD(path.total_cost);
3778
0
  WRITE_NODE_FIELD(path.pathkeys);
3779
0
  WRITE_UINT_FIELD(flags);
3780
0
  WRITE_NODE_FIELD(custom_paths);
3781
0
  WRITE_NODE_FIELD(custom_restrictinfo);
3782
0
  WRITE_NODE_FIELD(custom_private);
3783
3784
  /* CustomName is a key to lookup CustomScanMethods */
3785
0
  appendStringInfoString(str, " :methods ");
3786
0
  outToken(str, node->methods->CustomName);
3787
0
}
3788
3789
static void
3790
_outAppendPath(StringInfo str, const AppendPath *node)
3791
0
{
3792
0
  WRITE_NODE_TYPE("APPENDPATH");
3793
3794
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
3795
0
  appendStringInfoString(str, " :parent_relids ");
3796
0
  outBitmapset(str, node->path.parent->relids);
3797
0
  if (node->path.pathtarget != node->path.parent->reltarget)
3798
0
    WRITE_NODE_FIELD(path.pathtarget);
3799
0
  appendStringInfoString(str, " :required_outer ");
3800
0
  if (node->path.param_info)
3801
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
3802
0
  else
3803
0
    outBitmapset(str, NULL);
3804
0
  WRITE_BOOL_FIELD(path.parallel_aware);
3805
0
  WRITE_BOOL_FIELD(path.parallel_safe);
3806
0
  WRITE_INT_FIELD(path.parallel_workers);
3807
0
  WRITE_FLOAT_FIELD(path.rows);
3808
0
  WRITE_INT_FIELD(path.disabled_nodes);
3809
0
  WRITE_FLOAT_FIELD(path.startup_cost);
3810
0
  WRITE_FLOAT_FIELD(path.total_cost);
3811
0
  WRITE_NODE_FIELD(path.pathkeys);
3812
0
  WRITE_NODE_FIELD(subpaths);
3813
0
  WRITE_INT_FIELD(first_partial_path);
3814
0
  WRITE_FLOAT_FIELD(limit_tuples);
3815
0
}
3816
3817
static void
3818
_outMergeAppendPath(StringInfo str, const MergeAppendPath *node)
3819
0
{
3820
0
  WRITE_NODE_TYPE("MERGEAPPENDPATH");
3821
3822
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
3823
0
  appendStringInfoString(str, " :parent_relids ");
3824
0
  outBitmapset(str, node->path.parent->relids);
3825
0
  if (node->path.pathtarget != node->path.parent->reltarget)
3826
0
    WRITE_NODE_FIELD(path.pathtarget);
3827
0
  appendStringInfoString(str, " :required_outer ");
3828
0
  if (node->path.param_info)
3829
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
3830
0
  else
3831
0
    outBitmapset(str, NULL);
3832
0
  WRITE_BOOL_FIELD(path.parallel_aware);
3833
0
  WRITE_BOOL_FIELD(path.parallel_safe);
3834
0
  WRITE_INT_FIELD(path.parallel_workers);
3835
0
  WRITE_FLOAT_FIELD(path.rows);
3836
0
  WRITE_INT_FIELD(path.disabled_nodes);
3837
0
  WRITE_FLOAT_FIELD(path.startup_cost);
3838
0
  WRITE_FLOAT_FIELD(path.total_cost);
3839
0
  WRITE_NODE_FIELD(path.pathkeys);
3840
0
  WRITE_NODE_FIELD(subpaths);
3841
0
  WRITE_FLOAT_FIELD(limit_tuples);
3842
0
}
3843
3844
static void
3845
_outGroupResultPath(StringInfo str, const GroupResultPath *node)
3846
0
{
3847
0
  WRITE_NODE_TYPE("GROUPRESULTPATH");
3848
3849
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
3850
0
  appendStringInfoString(str, " :parent_relids ");
3851
0
  outBitmapset(str, node->path.parent->relids);
3852
0
  if (node->path.pathtarget != node->path.parent->reltarget)
3853
0
    WRITE_NODE_FIELD(path.pathtarget);
3854
0
  appendStringInfoString(str, " :required_outer ");
3855
0
  if (node->path.param_info)
3856
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
3857
0
  else
3858
0
    outBitmapset(str, NULL);
3859
0
  WRITE_BOOL_FIELD(path.parallel_aware);
3860
0
  WRITE_BOOL_FIELD(path.parallel_safe);
3861
0
  WRITE_INT_FIELD(path.parallel_workers);
3862
0
  WRITE_FLOAT_FIELD(path.rows);
3863
0
  WRITE_INT_FIELD(path.disabled_nodes);
3864
0
  WRITE_FLOAT_FIELD(path.startup_cost);
3865
0
  WRITE_FLOAT_FIELD(path.total_cost);
3866
0
  WRITE_NODE_FIELD(path.pathkeys);
3867
0
  WRITE_NODE_FIELD(quals);
3868
0
}
3869
3870
static void
3871
_outMaterialPath(StringInfo str, const MaterialPath *node)
3872
0
{
3873
0
  WRITE_NODE_TYPE("MATERIALPATH");
3874
3875
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
3876
0
  appendStringInfoString(str, " :parent_relids ");
3877
0
  outBitmapset(str, node->path.parent->relids);
3878
0
  if (node->path.pathtarget != node->path.parent->reltarget)
3879
0
    WRITE_NODE_FIELD(path.pathtarget);
3880
0
  appendStringInfoString(str, " :required_outer ");
3881
0
  if (node->path.param_info)
3882
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
3883
0
  else
3884
0
    outBitmapset(str, NULL);
3885
0
  WRITE_BOOL_FIELD(path.parallel_aware);
3886
0
  WRITE_BOOL_FIELD(path.parallel_safe);
3887
0
  WRITE_INT_FIELD(path.parallel_workers);
3888
0
  WRITE_FLOAT_FIELD(path.rows);
3889
0
  WRITE_INT_FIELD(path.disabled_nodes);
3890
0
  WRITE_FLOAT_FIELD(path.startup_cost);
3891
0
  WRITE_FLOAT_FIELD(path.total_cost);
3892
0
  WRITE_NODE_FIELD(path.pathkeys);
3893
0
  WRITE_NODE_FIELD(subpath);
3894
0
}
3895
3896
static void
3897
_outMemoizePath(StringInfo str, const MemoizePath *node)
3898
0
{
3899
0
  WRITE_NODE_TYPE("MEMOIZEPATH");
3900
3901
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
3902
0
  appendStringInfoString(str, " :parent_relids ");
3903
0
  outBitmapset(str, node->path.parent->relids);
3904
0
  if (node->path.pathtarget != node->path.parent->reltarget)
3905
0
    WRITE_NODE_FIELD(path.pathtarget);
3906
0
  appendStringInfoString(str, " :required_outer ");
3907
0
  if (node->path.param_info)
3908
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
3909
0
  else
3910
0
    outBitmapset(str, NULL);
3911
0
  WRITE_BOOL_FIELD(path.parallel_aware);
3912
0
  WRITE_BOOL_FIELD(path.parallel_safe);
3913
0
  WRITE_INT_FIELD(path.parallel_workers);
3914
0
  WRITE_FLOAT_FIELD(path.rows);
3915
0
  WRITE_INT_FIELD(path.disabled_nodes);
3916
0
  WRITE_FLOAT_FIELD(path.startup_cost);
3917
0
  WRITE_FLOAT_FIELD(path.total_cost);
3918
0
  WRITE_NODE_FIELD(path.pathkeys);
3919
0
  WRITE_NODE_FIELD(subpath);
3920
0
  WRITE_NODE_FIELD(hash_operators);
3921
0
  WRITE_NODE_FIELD(param_exprs);
3922
0
  WRITE_BOOL_FIELD(singlerow);
3923
0
  WRITE_BOOL_FIELD(binary_mode);
3924
0
  WRITE_UINT_FIELD(est_entries);
3925
0
  WRITE_FLOAT_FIELD(est_calls);
3926
0
  WRITE_FLOAT_FIELD(est_unique_keys);
3927
0
  WRITE_FLOAT_FIELD(est_hit_ratio);
3928
0
}
3929
3930
static void
3931
_outGatherPath(StringInfo str, const GatherPath *node)
3932
0
{
3933
0
  WRITE_NODE_TYPE("GATHERPATH");
3934
3935
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
3936
0
  appendStringInfoString(str, " :parent_relids ");
3937
0
  outBitmapset(str, node->path.parent->relids);
3938
0
  if (node->path.pathtarget != node->path.parent->reltarget)
3939
0
    WRITE_NODE_FIELD(path.pathtarget);
3940
0
  appendStringInfoString(str, " :required_outer ");
3941
0
  if (node->path.param_info)
3942
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
3943
0
  else
3944
0
    outBitmapset(str, NULL);
3945
0
  WRITE_BOOL_FIELD(path.parallel_aware);
3946
0
  WRITE_BOOL_FIELD(path.parallel_safe);
3947
0
  WRITE_INT_FIELD(path.parallel_workers);
3948
0
  WRITE_FLOAT_FIELD(path.rows);
3949
0
  WRITE_INT_FIELD(path.disabled_nodes);
3950
0
  WRITE_FLOAT_FIELD(path.startup_cost);
3951
0
  WRITE_FLOAT_FIELD(path.total_cost);
3952
0
  WRITE_NODE_FIELD(path.pathkeys);
3953
0
  WRITE_NODE_FIELD(subpath);
3954
0
  WRITE_BOOL_FIELD(single_copy);
3955
0
  WRITE_INT_FIELD(num_workers);
3956
0
}
3957
3958
static void
3959
_outGatherMergePath(StringInfo str, const GatherMergePath *node)
3960
0
{
3961
0
  WRITE_NODE_TYPE("GATHERMERGEPATH");
3962
3963
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
3964
0
  appendStringInfoString(str, " :parent_relids ");
3965
0
  outBitmapset(str, node->path.parent->relids);
3966
0
  if (node->path.pathtarget != node->path.parent->reltarget)
3967
0
    WRITE_NODE_FIELD(path.pathtarget);
3968
0
  appendStringInfoString(str, " :required_outer ");
3969
0
  if (node->path.param_info)
3970
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
3971
0
  else
3972
0
    outBitmapset(str, NULL);
3973
0
  WRITE_BOOL_FIELD(path.parallel_aware);
3974
0
  WRITE_BOOL_FIELD(path.parallel_safe);
3975
0
  WRITE_INT_FIELD(path.parallel_workers);
3976
0
  WRITE_FLOAT_FIELD(path.rows);
3977
0
  WRITE_INT_FIELD(path.disabled_nodes);
3978
0
  WRITE_FLOAT_FIELD(path.startup_cost);
3979
0
  WRITE_FLOAT_FIELD(path.total_cost);
3980
0
  WRITE_NODE_FIELD(path.pathkeys);
3981
0
  WRITE_NODE_FIELD(subpath);
3982
0
  WRITE_INT_FIELD(num_workers);
3983
0
}
3984
3985
static void
3986
_outNestPath(StringInfo str, const NestPath *node)
3987
0
{
3988
0
  WRITE_NODE_TYPE("NESTPATH");
3989
3990
0
  WRITE_ENUM_FIELD(jpath.path.pathtype, NodeTag);
3991
0
  appendStringInfoString(str, " :parent_relids ");
3992
0
  outBitmapset(str, node->jpath.path.parent->relids);
3993
0
  if (node->jpath.path.pathtarget != node->jpath.path.parent->reltarget)
3994
0
    WRITE_NODE_FIELD(jpath.path.pathtarget);
3995
0
  appendStringInfoString(str, " :required_outer ");
3996
0
  if (node->jpath.path.param_info)
3997
0
    outBitmapset(str, node->jpath.path.param_info->ppi_req_outer);
3998
0
  else
3999
0
    outBitmapset(str, NULL);
4000
0
  WRITE_BOOL_FIELD(jpath.path.parallel_aware);
4001
0
  WRITE_BOOL_FIELD(jpath.path.parallel_safe);
4002
0
  WRITE_INT_FIELD(jpath.path.parallel_workers);
4003
0
  WRITE_FLOAT_FIELD(jpath.path.rows);
4004
0
  WRITE_INT_FIELD(jpath.path.disabled_nodes);
4005
0
  WRITE_FLOAT_FIELD(jpath.path.startup_cost);
4006
0
  WRITE_FLOAT_FIELD(jpath.path.total_cost);
4007
0
  WRITE_NODE_FIELD(jpath.path.pathkeys);
4008
0
  WRITE_ENUM_FIELD(jpath.jointype, JoinType);
4009
0
  WRITE_BOOL_FIELD(jpath.inner_unique);
4010
0
  WRITE_NODE_FIELD(jpath.outerjoinpath);
4011
0
  WRITE_NODE_FIELD(jpath.innerjoinpath);
4012
0
  WRITE_NODE_FIELD(jpath.joinrestrictinfo);
4013
0
}
4014
4015
static void
4016
_outMergePath(StringInfo str, const MergePath *node)
4017
0
{
4018
0
  WRITE_NODE_TYPE("MERGEPATH");
4019
4020
0
  WRITE_ENUM_FIELD(jpath.path.pathtype, NodeTag);
4021
0
  appendStringInfoString(str, " :parent_relids ");
4022
0
  outBitmapset(str, node->jpath.path.parent->relids);
4023
0
  if (node->jpath.path.pathtarget != node->jpath.path.parent->reltarget)
4024
0
    WRITE_NODE_FIELD(jpath.path.pathtarget);
4025
0
  appendStringInfoString(str, " :required_outer ");
4026
0
  if (node->jpath.path.param_info)
4027
0
    outBitmapset(str, node->jpath.path.param_info->ppi_req_outer);
4028
0
  else
4029
0
    outBitmapset(str, NULL);
4030
0
  WRITE_BOOL_FIELD(jpath.path.parallel_aware);
4031
0
  WRITE_BOOL_FIELD(jpath.path.parallel_safe);
4032
0
  WRITE_INT_FIELD(jpath.path.parallel_workers);
4033
0
  WRITE_FLOAT_FIELD(jpath.path.rows);
4034
0
  WRITE_INT_FIELD(jpath.path.disabled_nodes);
4035
0
  WRITE_FLOAT_FIELD(jpath.path.startup_cost);
4036
0
  WRITE_FLOAT_FIELD(jpath.path.total_cost);
4037
0
  WRITE_NODE_FIELD(jpath.path.pathkeys);
4038
0
  WRITE_ENUM_FIELD(jpath.jointype, JoinType);
4039
0
  WRITE_BOOL_FIELD(jpath.inner_unique);
4040
0
  WRITE_NODE_FIELD(jpath.outerjoinpath);
4041
0
  WRITE_NODE_FIELD(jpath.innerjoinpath);
4042
0
  WRITE_NODE_FIELD(jpath.joinrestrictinfo);
4043
0
  WRITE_NODE_FIELD(path_mergeclauses);
4044
0
  WRITE_NODE_FIELD(outersortkeys);
4045
0
  WRITE_NODE_FIELD(innersortkeys);
4046
0
  WRITE_INT_FIELD(outer_presorted_keys);
4047
0
  WRITE_BOOL_FIELD(skip_mark_restore);
4048
0
  WRITE_BOOL_FIELD(materialize_inner);
4049
0
}
4050
4051
static void
4052
_outHashPath(StringInfo str, const HashPath *node)
4053
0
{
4054
0
  WRITE_NODE_TYPE("HASHPATH");
4055
4056
0
  WRITE_ENUM_FIELD(jpath.path.pathtype, NodeTag);
4057
0
  appendStringInfoString(str, " :parent_relids ");
4058
0
  outBitmapset(str, node->jpath.path.parent->relids);
4059
0
  if (node->jpath.path.pathtarget != node->jpath.path.parent->reltarget)
4060
0
    WRITE_NODE_FIELD(jpath.path.pathtarget);
4061
0
  appendStringInfoString(str, " :required_outer ");
4062
0
  if (node->jpath.path.param_info)
4063
0
    outBitmapset(str, node->jpath.path.param_info->ppi_req_outer);
4064
0
  else
4065
0
    outBitmapset(str, NULL);
4066
0
  WRITE_BOOL_FIELD(jpath.path.parallel_aware);
4067
0
  WRITE_BOOL_FIELD(jpath.path.parallel_safe);
4068
0
  WRITE_INT_FIELD(jpath.path.parallel_workers);
4069
0
  WRITE_FLOAT_FIELD(jpath.path.rows);
4070
0
  WRITE_INT_FIELD(jpath.path.disabled_nodes);
4071
0
  WRITE_FLOAT_FIELD(jpath.path.startup_cost);
4072
0
  WRITE_FLOAT_FIELD(jpath.path.total_cost);
4073
0
  WRITE_NODE_FIELD(jpath.path.pathkeys);
4074
0
  WRITE_ENUM_FIELD(jpath.jointype, JoinType);
4075
0
  WRITE_BOOL_FIELD(jpath.inner_unique);
4076
0
  WRITE_NODE_FIELD(jpath.outerjoinpath);
4077
0
  WRITE_NODE_FIELD(jpath.innerjoinpath);
4078
0
  WRITE_NODE_FIELD(jpath.joinrestrictinfo);
4079
0
  WRITE_NODE_FIELD(path_hashclauses);
4080
0
  WRITE_INT_FIELD(num_batches);
4081
0
  WRITE_FLOAT_FIELD(inner_rows_total);
4082
0
}
4083
4084
static void
4085
_outProjectionPath(StringInfo str, const ProjectionPath *node)
4086
0
{
4087
0
  WRITE_NODE_TYPE("PROJECTIONPATH");
4088
4089
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
4090
0
  appendStringInfoString(str, " :parent_relids ");
4091
0
  outBitmapset(str, node->path.parent->relids);
4092
0
  if (node->path.pathtarget != node->path.parent->reltarget)
4093
0
    WRITE_NODE_FIELD(path.pathtarget);
4094
0
  appendStringInfoString(str, " :required_outer ");
4095
0
  if (node->path.param_info)
4096
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
4097
0
  else
4098
0
    outBitmapset(str, NULL);
4099
0
  WRITE_BOOL_FIELD(path.parallel_aware);
4100
0
  WRITE_BOOL_FIELD(path.parallel_safe);
4101
0
  WRITE_INT_FIELD(path.parallel_workers);
4102
0
  WRITE_FLOAT_FIELD(path.rows);
4103
0
  WRITE_INT_FIELD(path.disabled_nodes);
4104
0
  WRITE_FLOAT_FIELD(path.startup_cost);
4105
0
  WRITE_FLOAT_FIELD(path.total_cost);
4106
0
  WRITE_NODE_FIELD(path.pathkeys);
4107
0
  WRITE_NODE_FIELD(subpath);
4108
0
  WRITE_BOOL_FIELD(dummypp);
4109
0
}
4110
4111
static void
4112
_outProjectSetPath(StringInfo str, const ProjectSetPath *node)
4113
0
{
4114
0
  WRITE_NODE_TYPE("PROJECTSETPATH");
4115
4116
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
4117
0
  appendStringInfoString(str, " :parent_relids ");
4118
0
  outBitmapset(str, node->path.parent->relids);
4119
0
  if (node->path.pathtarget != node->path.parent->reltarget)
4120
0
    WRITE_NODE_FIELD(path.pathtarget);
4121
0
  appendStringInfoString(str, " :required_outer ");
4122
0
  if (node->path.param_info)
4123
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
4124
0
  else
4125
0
    outBitmapset(str, NULL);
4126
0
  WRITE_BOOL_FIELD(path.parallel_aware);
4127
0
  WRITE_BOOL_FIELD(path.parallel_safe);
4128
0
  WRITE_INT_FIELD(path.parallel_workers);
4129
0
  WRITE_FLOAT_FIELD(path.rows);
4130
0
  WRITE_INT_FIELD(path.disabled_nodes);
4131
0
  WRITE_FLOAT_FIELD(path.startup_cost);
4132
0
  WRITE_FLOAT_FIELD(path.total_cost);
4133
0
  WRITE_NODE_FIELD(path.pathkeys);
4134
0
  WRITE_NODE_FIELD(subpath);
4135
0
}
4136
4137
static void
4138
_outSortPath(StringInfo str, const SortPath *node)
4139
0
{
4140
0
  WRITE_NODE_TYPE("SORTPATH");
4141
4142
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
4143
0
  appendStringInfoString(str, " :parent_relids ");
4144
0
  outBitmapset(str, node->path.parent->relids);
4145
0
  if (node->path.pathtarget != node->path.parent->reltarget)
4146
0
    WRITE_NODE_FIELD(path.pathtarget);
4147
0
  appendStringInfoString(str, " :required_outer ");
4148
0
  if (node->path.param_info)
4149
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
4150
0
  else
4151
0
    outBitmapset(str, NULL);
4152
0
  WRITE_BOOL_FIELD(path.parallel_aware);
4153
0
  WRITE_BOOL_FIELD(path.parallel_safe);
4154
0
  WRITE_INT_FIELD(path.parallel_workers);
4155
0
  WRITE_FLOAT_FIELD(path.rows);
4156
0
  WRITE_INT_FIELD(path.disabled_nodes);
4157
0
  WRITE_FLOAT_FIELD(path.startup_cost);
4158
0
  WRITE_FLOAT_FIELD(path.total_cost);
4159
0
  WRITE_NODE_FIELD(path.pathkeys);
4160
0
  WRITE_NODE_FIELD(subpath);
4161
0
}
4162
4163
static void
4164
_outIncrementalSortPath(StringInfo str, const IncrementalSortPath *node)
4165
0
{
4166
0
  WRITE_NODE_TYPE("INCREMENTALSORTPATH");
4167
4168
0
  WRITE_ENUM_FIELD(spath.path.pathtype, NodeTag);
4169
0
  appendStringInfoString(str, " :parent_relids ");
4170
0
  outBitmapset(str, node->spath.path.parent->relids);
4171
0
  if (node->spath.path.pathtarget != node->spath.path.parent->reltarget)
4172
0
    WRITE_NODE_FIELD(spath.path.pathtarget);
4173
0
  appendStringInfoString(str, " :required_outer ");
4174
0
  if (node->spath.path.param_info)
4175
0
    outBitmapset(str, node->spath.path.param_info->ppi_req_outer);
4176
0
  else
4177
0
    outBitmapset(str, NULL);
4178
0
  WRITE_BOOL_FIELD(spath.path.parallel_aware);
4179
0
  WRITE_BOOL_FIELD(spath.path.parallel_safe);
4180
0
  WRITE_INT_FIELD(spath.path.parallel_workers);
4181
0
  WRITE_FLOAT_FIELD(spath.path.rows);
4182
0
  WRITE_INT_FIELD(spath.path.disabled_nodes);
4183
0
  WRITE_FLOAT_FIELD(spath.path.startup_cost);
4184
0
  WRITE_FLOAT_FIELD(spath.path.total_cost);
4185
0
  WRITE_NODE_FIELD(spath.path.pathkeys);
4186
0
  WRITE_NODE_FIELD(spath.subpath);
4187
0
  WRITE_INT_FIELD(nPresortedCols);
4188
0
}
4189
4190
static void
4191
_outGroupPath(StringInfo str, const GroupPath *node)
4192
0
{
4193
0
  WRITE_NODE_TYPE("GROUPPATH");
4194
4195
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
4196
0
  appendStringInfoString(str, " :parent_relids ");
4197
0
  outBitmapset(str, node->path.parent->relids);
4198
0
  if (node->path.pathtarget != node->path.parent->reltarget)
4199
0
    WRITE_NODE_FIELD(path.pathtarget);
4200
0
  appendStringInfoString(str, " :required_outer ");
4201
0
  if (node->path.param_info)
4202
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
4203
0
  else
4204
0
    outBitmapset(str, NULL);
4205
0
  WRITE_BOOL_FIELD(path.parallel_aware);
4206
0
  WRITE_BOOL_FIELD(path.parallel_safe);
4207
0
  WRITE_INT_FIELD(path.parallel_workers);
4208
0
  WRITE_FLOAT_FIELD(path.rows);
4209
0
  WRITE_INT_FIELD(path.disabled_nodes);
4210
0
  WRITE_FLOAT_FIELD(path.startup_cost);
4211
0
  WRITE_FLOAT_FIELD(path.total_cost);
4212
0
  WRITE_NODE_FIELD(path.pathkeys);
4213
0
  WRITE_NODE_FIELD(subpath);
4214
0
  WRITE_NODE_FIELD(groupClause);
4215
0
  WRITE_NODE_FIELD(qual);
4216
0
}
4217
4218
static void
4219
_outUniquePath(StringInfo str, const UniquePath *node)
4220
0
{
4221
0
  WRITE_NODE_TYPE("UNIQUEPATH");
4222
4223
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
4224
0
  appendStringInfoString(str, " :parent_relids ");
4225
0
  outBitmapset(str, node->path.parent->relids);
4226
0
  if (node->path.pathtarget != node->path.parent->reltarget)
4227
0
    WRITE_NODE_FIELD(path.pathtarget);
4228
0
  appendStringInfoString(str, " :required_outer ");
4229
0
  if (node->path.param_info)
4230
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
4231
0
  else
4232
0
    outBitmapset(str, NULL);
4233
0
  WRITE_BOOL_FIELD(path.parallel_aware);
4234
0
  WRITE_BOOL_FIELD(path.parallel_safe);
4235
0
  WRITE_INT_FIELD(path.parallel_workers);
4236
0
  WRITE_FLOAT_FIELD(path.rows);
4237
0
  WRITE_INT_FIELD(path.disabled_nodes);
4238
0
  WRITE_FLOAT_FIELD(path.startup_cost);
4239
0
  WRITE_FLOAT_FIELD(path.total_cost);
4240
0
  WRITE_NODE_FIELD(path.pathkeys);
4241
0
  WRITE_NODE_FIELD(subpath);
4242
0
  WRITE_INT_FIELD(numkeys);
4243
0
}
4244
4245
static void
4246
_outAggPath(StringInfo str, const AggPath *node)
4247
0
{
4248
0
  WRITE_NODE_TYPE("AGGPATH");
4249
4250
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
4251
0
  appendStringInfoString(str, " :parent_relids ");
4252
0
  outBitmapset(str, node->path.parent->relids);
4253
0
  if (node->path.pathtarget != node->path.parent->reltarget)
4254
0
    WRITE_NODE_FIELD(path.pathtarget);
4255
0
  appendStringInfoString(str, " :required_outer ");
4256
0
  if (node->path.param_info)
4257
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
4258
0
  else
4259
0
    outBitmapset(str, NULL);
4260
0
  WRITE_BOOL_FIELD(path.parallel_aware);
4261
0
  WRITE_BOOL_FIELD(path.parallel_safe);
4262
0
  WRITE_INT_FIELD(path.parallel_workers);
4263
0
  WRITE_FLOAT_FIELD(path.rows);
4264
0
  WRITE_INT_FIELD(path.disabled_nodes);
4265
0
  WRITE_FLOAT_FIELD(path.startup_cost);
4266
0
  WRITE_FLOAT_FIELD(path.total_cost);
4267
0
  WRITE_NODE_FIELD(path.pathkeys);
4268
0
  WRITE_NODE_FIELD(subpath);
4269
0
  WRITE_ENUM_FIELD(aggstrategy, AggStrategy);
4270
0
  WRITE_ENUM_FIELD(aggsplit, AggSplit);
4271
0
  WRITE_FLOAT_FIELD(numGroups);
4272
0
  WRITE_UINT64_FIELD(transitionSpace);
4273
0
  WRITE_NODE_FIELD(groupClause);
4274
0
  WRITE_NODE_FIELD(qual);
4275
0
}
4276
4277
static void
4278
_outGroupingSetData(StringInfo str, const GroupingSetData *node)
4279
0
{
4280
0
  WRITE_NODE_TYPE("GROUPINGSETDATA");
4281
4282
0
  WRITE_NODE_FIELD(set);
4283
0
  WRITE_FLOAT_FIELD(numGroups);
4284
0
}
4285
4286
static void
4287
_outRollupData(StringInfo str, const RollupData *node)
4288
0
{
4289
0
  WRITE_NODE_TYPE("ROLLUPDATA");
4290
4291
0
  WRITE_NODE_FIELD(groupClause);
4292
0
  WRITE_NODE_FIELD(gsets);
4293
0
  WRITE_NODE_FIELD(gsets_data);
4294
0
  WRITE_FLOAT_FIELD(numGroups);
4295
0
  WRITE_BOOL_FIELD(hashable);
4296
0
  WRITE_BOOL_FIELD(is_hashed);
4297
0
}
4298
4299
static void
4300
_outGroupingSetsPath(StringInfo str, const GroupingSetsPath *node)
4301
0
{
4302
0
  WRITE_NODE_TYPE("GROUPINGSETSPATH");
4303
4304
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
4305
0
  appendStringInfoString(str, " :parent_relids ");
4306
0
  outBitmapset(str, node->path.parent->relids);
4307
0
  if (node->path.pathtarget != node->path.parent->reltarget)
4308
0
    WRITE_NODE_FIELD(path.pathtarget);
4309
0
  appendStringInfoString(str, " :required_outer ");
4310
0
  if (node->path.param_info)
4311
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
4312
0
  else
4313
0
    outBitmapset(str, NULL);
4314
0
  WRITE_BOOL_FIELD(path.parallel_aware);
4315
0
  WRITE_BOOL_FIELD(path.parallel_safe);
4316
0
  WRITE_INT_FIELD(path.parallel_workers);
4317
0
  WRITE_FLOAT_FIELD(path.rows);
4318
0
  WRITE_INT_FIELD(path.disabled_nodes);
4319
0
  WRITE_FLOAT_FIELD(path.startup_cost);
4320
0
  WRITE_FLOAT_FIELD(path.total_cost);
4321
0
  WRITE_NODE_FIELD(path.pathkeys);
4322
0
  WRITE_NODE_FIELD(subpath);
4323
0
  WRITE_ENUM_FIELD(aggstrategy, AggStrategy);
4324
0
  WRITE_NODE_FIELD(rollups);
4325
0
  WRITE_NODE_FIELD(qual);
4326
0
  WRITE_UINT64_FIELD(transitionSpace);
4327
0
}
4328
4329
static void
4330
_outMinMaxAggPath(StringInfo str, const MinMaxAggPath *node)
4331
0
{
4332
0
  WRITE_NODE_TYPE("MINMAXAGGPATH");
4333
4334
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
4335
0
  appendStringInfoString(str, " :parent_relids ");
4336
0
  outBitmapset(str, node->path.parent->relids);
4337
0
  if (node->path.pathtarget != node->path.parent->reltarget)
4338
0
    WRITE_NODE_FIELD(path.pathtarget);
4339
0
  appendStringInfoString(str, " :required_outer ");
4340
0
  if (node->path.param_info)
4341
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
4342
0
  else
4343
0
    outBitmapset(str, NULL);
4344
0
  WRITE_BOOL_FIELD(path.parallel_aware);
4345
0
  WRITE_BOOL_FIELD(path.parallel_safe);
4346
0
  WRITE_INT_FIELD(path.parallel_workers);
4347
0
  WRITE_FLOAT_FIELD(path.rows);
4348
0
  WRITE_INT_FIELD(path.disabled_nodes);
4349
0
  WRITE_FLOAT_FIELD(path.startup_cost);
4350
0
  WRITE_FLOAT_FIELD(path.total_cost);
4351
0
  WRITE_NODE_FIELD(path.pathkeys);
4352
0
  WRITE_NODE_FIELD(mmaggregates);
4353
0
  WRITE_NODE_FIELD(quals);
4354
0
}
4355
4356
static void
4357
_outWindowAggPath(StringInfo str, const WindowAggPath *node)
4358
0
{
4359
0
  WRITE_NODE_TYPE("WINDOWAGGPATH");
4360
4361
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
4362
0
  appendStringInfoString(str, " :parent_relids ");
4363
0
  outBitmapset(str, node->path.parent->relids);
4364
0
  if (node->path.pathtarget != node->path.parent->reltarget)
4365
0
    WRITE_NODE_FIELD(path.pathtarget);
4366
0
  appendStringInfoString(str, " :required_outer ");
4367
0
  if (node->path.param_info)
4368
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
4369
0
  else
4370
0
    outBitmapset(str, NULL);
4371
0
  WRITE_BOOL_FIELD(path.parallel_aware);
4372
0
  WRITE_BOOL_FIELD(path.parallel_safe);
4373
0
  WRITE_INT_FIELD(path.parallel_workers);
4374
0
  WRITE_FLOAT_FIELD(path.rows);
4375
0
  WRITE_INT_FIELD(path.disabled_nodes);
4376
0
  WRITE_FLOAT_FIELD(path.startup_cost);
4377
0
  WRITE_FLOAT_FIELD(path.total_cost);
4378
0
  WRITE_NODE_FIELD(path.pathkeys);
4379
0
  WRITE_NODE_FIELD(subpath);
4380
0
  WRITE_NODE_FIELD(winclause);
4381
0
  WRITE_NODE_FIELD(qual);
4382
0
  WRITE_NODE_FIELD(runCondition);
4383
0
  WRITE_BOOL_FIELD(topwindow);
4384
0
}
4385
4386
static void
4387
_outSetOpPath(StringInfo str, const SetOpPath *node)
4388
0
{
4389
0
  WRITE_NODE_TYPE("SETOPPATH");
4390
4391
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
4392
0
  appendStringInfoString(str, " :parent_relids ");
4393
0
  outBitmapset(str, node->path.parent->relids);
4394
0
  if (node->path.pathtarget != node->path.parent->reltarget)
4395
0
    WRITE_NODE_FIELD(path.pathtarget);
4396
0
  appendStringInfoString(str, " :required_outer ");
4397
0
  if (node->path.param_info)
4398
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
4399
0
  else
4400
0
    outBitmapset(str, NULL);
4401
0
  WRITE_BOOL_FIELD(path.parallel_aware);
4402
0
  WRITE_BOOL_FIELD(path.parallel_safe);
4403
0
  WRITE_INT_FIELD(path.parallel_workers);
4404
0
  WRITE_FLOAT_FIELD(path.rows);
4405
0
  WRITE_INT_FIELD(path.disabled_nodes);
4406
0
  WRITE_FLOAT_FIELD(path.startup_cost);
4407
0
  WRITE_FLOAT_FIELD(path.total_cost);
4408
0
  WRITE_NODE_FIELD(path.pathkeys);
4409
0
  WRITE_NODE_FIELD(leftpath);
4410
0
  WRITE_NODE_FIELD(rightpath);
4411
0
  WRITE_ENUM_FIELD(cmd, SetOpCmd);
4412
0
  WRITE_ENUM_FIELD(strategy, SetOpStrategy);
4413
0
  WRITE_NODE_FIELD(groupList);
4414
0
  WRITE_FLOAT_FIELD(numGroups);
4415
0
}
4416
4417
static void
4418
_outRecursiveUnionPath(StringInfo str, const RecursiveUnionPath *node)
4419
0
{
4420
0
  WRITE_NODE_TYPE("RECURSIVEUNIONPATH");
4421
4422
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
4423
0
  appendStringInfoString(str, " :parent_relids ");
4424
0
  outBitmapset(str, node->path.parent->relids);
4425
0
  if (node->path.pathtarget != node->path.parent->reltarget)
4426
0
    WRITE_NODE_FIELD(path.pathtarget);
4427
0
  appendStringInfoString(str, " :required_outer ");
4428
0
  if (node->path.param_info)
4429
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
4430
0
  else
4431
0
    outBitmapset(str, NULL);
4432
0
  WRITE_BOOL_FIELD(path.parallel_aware);
4433
0
  WRITE_BOOL_FIELD(path.parallel_safe);
4434
0
  WRITE_INT_FIELD(path.parallel_workers);
4435
0
  WRITE_FLOAT_FIELD(path.rows);
4436
0
  WRITE_INT_FIELD(path.disabled_nodes);
4437
0
  WRITE_FLOAT_FIELD(path.startup_cost);
4438
0
  WRITE_FLOAT_FIELD(path.total_cost);
4439
0
  WRITE_NODE_FIELD(path.pathkeys);
4440
0
  WRITE_NODE_FIELD(leftpath);
4441
0
  WRITE_NODE_FIELD(rightpath);
4442
0
  WRITE_NODE_FIELD(distinctList);
4443
0
  WRITE_INT_FIELD(wtParam);
4444
0
  WRITE_FLOAT_FIELD(numGroups);
4445
0
}
4446
4447
static void
4448
_outLockRowsPath(StringInfo str, const LockRowsPath *node)
4449
0
{
4450
0
  WRITE_NODE_TYPE("LOCKROWSPATH");
4451
4452
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
4453
0
  appendStringInfoString(str, " :parent_relids ");
4454
0
  outBitmapset(str, node->path.parent->relids);
4455
0
  if (node->path.pathtarget != node->path.parent->reltarget)
4456
0
    WRITE_NODE_FIELD(path.pathtarget);
4457
0
  appendStringInfoString(str, " :required_outer ");
4458
0
  if (node->path.param_info)
4459
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
4460
0
  else
4461
0
    outBitmapset(str, NULL);
4462
0
  WRITE_BOOL_FIELD(path.parallel_aware);
4463
0
  WRITE_BOOL_FIELD(path.parallel_safe);
4464
0
  WRITE_INT_FIELD(path.parallel_workers);
4465
0
  WRITE_FLOAT_FIELD(path.rows);
4466
0
  WRITE_INT_FIELD(path.disabled_nodes);
4467
0
  WRITE_FLOAT_FIELD(path.startup_cost);
4468
0
  WRITE_FLOAT_FIELD(path.total_cost);
4469
0
  WRITE_NODE_FIELD(path.pathkeys);
4470
0
  WRITE_NODE_FIELD(subpath);
4471
0
  WRITE_NODE_FIELD(rowMarks);
4472
0
  WRITE_INT_FIELD(epqParam);
4473
0
}
4474
4475
static void
4476
_outModifyTablePath(StringInfo str, const ModifyTablePath *node)
4477
0
{
4478
0
  WRITE_NODE_TYPE("MODIFYTABLEPATH");
4479
4480
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
4481
0
  appendStringInfoString(str, " :parent_relids ");
4482
0
  outBitmapset(str, node->path.parent->relids);
4483
0
  if (node->path.pathtarget != node->path.parent->reltarget)
4484
0
    WRITE_NODE_FIELD(path.pathtarget);
4485
0
  appendStringInfoString(str, " :required_outer ");
4486
0
  if (node->path.param_info)
4487
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
4488
0
  else
4489
0
    outBitmapset(str, NULL);
4490
0
  WRITE_BOOL_FIELD(path.parallel_aware);
4491
0
  WRITE_BOOL_FIELD(path.parallel_safe);
4492
0
  WRITE_INT_FIELD(path.parallel_workers);
4493
0
  WRITE_FLOAT_FIELD(path.rows);
4494
0
  WRITE_INT_FIELD(path.disabled_nodes);
4495
0
  WRITE_FLOAT_FIELD(path.startup_cost);
4496
0
  WRITE_FLOAT_FIELD(path.total_cost);
4497
0
  WRITE_NODE_FIELD(path.pathkeys);
4498
0
  WRITE_NODE_FIELD(subpath);
4499
0
  WRITE_ENUM_FIELD(operation, CmdType);
4500
0
  WRITE_BOOL_FIELD(canSetTag);
4501
0
  WRITE_UINT_FIELD(nominalRelation);
4502
0
  WRITE_UINT_FIELD(rootRelation);
4503
0
  WRITE_BOOL_FIELD(partColsUpdated);
4504
0
  WRITE_NODE_FIELD(resultRelations);
4505
0
  WRITE_NODE_FIELD(updateColnosLists);
4506
0
  WRITE_NODE_FIELD(withCheckOptionLists);
4507
0
  WRITE_NODE_FIELD(returningLists);
4508
0
  WRITE_NODE_FIELD(rowMarks);
4509
0
  WRITE_NODE_FIELD(onconflict);
4510
0
  WRITE_INT_FIELD(epqParam);
4511
0
  WRITE_NODE_FIELD(mergeActionLists);
4512
0
  WRITE_NODE_FIELD(mergeJoinConditions);
4513
0
}
4514
4515
static void
4516
_outLimitPath(StringInfo str, const LimitPath *node)
4517
0
{
4518
0
  WRITE_NODE_TYPE("LIMITPATH");
4519
4520
0
  WRITE_ENUM_FIELD(path.pathtype, NodeTag);
4521
0
  appendStringInfoString(str, " :parent_relids ");
4522
0
  outBitmapset(str, node->path.parent->relids);
4523
0
  if (node->path.pathtarget != node->path.parent->reltarget)
4524
0
    WRITE_NODE_FIELD(path.pathtarget);
4525
0
  appendStringInfoString(str, " :required_outer ");
4526
0
  if (node->path.param_info)
4527
0
    outBitmapset(str, node->path.param_info->ppi_req_outer);
4528
0
  else
4529
0
    outBitmapset(str, NULL);
4530
0
  WRITE_BOOL_FIELD(path.parallel_aware);
4531
0
  WRITE_BOOL_FIELD(path.parallel_safe);
4532
0
  WRITE_INT_FIELD(path.parallel_workers);
4533
0
  WRITE_FLOAT_FIELD(path.rows);
4534
0
  WRITE_INT_FIELD(path.disabled_nodes);
4535
0
  WRITE_FLOAT_FIELD(path.startup_cost);
4536
0
  WRITE_FLOAT_FIELD(path.total_cost);
4537
0
  WRITE_NODE_FIELD(path.pathkeys);
4538
0
  WRITE_NODE_FIELD(subpath);
4539
0
  WRITE_NODE_FIELD(limitOffset);
4540
0
  WRITE_NODE_FIELD(limitCount);
4541
0
  WRITE_ENUM_FIELD(limitOption, LimitOption);
4542
0
}
4543
4544
static void
4545
_outRestrictInfo(StringInfo str, const RestrictInfo *node)
4546
0
{
4547
0
  WRITE_NODE_TYPE("RESTRICTINFO");
4548
4549
0
  WRITE_NODE_FIELD(clause);
4550
0
  WRITE_BOOL_FIELD(is_pushed_down);
4551
0
  WRITE_BOOL_FIELD(can_join);
4552
0
  WRITE_BOOL_FIELD(pseudoconstant);
4553
0
  WRITE_BOOL_FIELD(has_clone);
4554
0
  WRITE_BOOL_FIELD(is_clone);
4555
0
  WRITE_BOOL_FIELD(leakproof);
4556
0
  WRITE_ENUM_FIELD(has_volatile, VolatileFunctionStatus);
4557
0
  WRITE_UINT_FIELD(security_level);
4558
0
  WRITE_INT_FIELD(num_base_rels);
4559
0
  WRITE_BITMAPSET_FIELD(clause_relids);
4560
0
  WRITE_BITMAPSET_FIELD(required_relids);
4561
0
  WRITE_BITMAPSET_FIELD(incompatible_relids);
4562
0
  WRITE_BITMAPSET_FIELD(outer_relids);
4563
0
  WRITE_BITMAPSET_FIELD(left_relids);
4564
0
  WRITE_BITMAPSET_FIELD(right_relids);
4565
0
  WRITE_NODE_FIELD(orclause);
4566
0
  WRITE_INT_FIELD(rinfo_serial);
4567
0
  WRITE_FLOAT_FIELD(eval_cost.startup);
4568
0
  WRITE_FLOAT_FIELD(eval_cost.per_tuple);
4569
0
  WRITE_FLOAT_FIELD(norm_selec);
4570
0
  WRITE_FLOAT_FIELD(outer_selec);
4571
0
  WRITE_NODE_FIELD(mergeopfamilies);
4572
0
  WRITE_NODE_FIELD(left_em);
4573
0
  WRITE_NODE_FIELD(right_em);
4574
0
  WRITE_BOOL_FIELD(outer_is_left);
4575
0
  WRITE_OID_FIELD(hashjoinoperator);
4576
0
  WRITE_FLOAT_FIELD(left_bucketsize);
4577
0
  WRITE_FLOAT_FIELD(right_bucketsize);
4578
0
  WRITE_FLOAT_FIELD(left_mcvfreq);
4579
0
  WRITE_FLOAT_FIELD(right_mcvfreq);
4580
0
  WRITE_OID_FIELD(left_hasheqoperator);
4581
0
  WRITE_OID_FIELD(right_hasheqoperator);
4582
0
}
4583
4584
static void
4585
_outPlaceHolderVar(StringInfo str, const PlaceHolderVar *node)
4586
0
{
4587
0
  WRITE_NODE_TYPE("PLACEHOLDERVAR");
4588
4589
0
  WRITE_NODE_FIELD(phexpr);
4590
0
  WRITE_BITMAPSET_FIELD(phrels);
4591
0
  WRITE_BITMAPSET_FIELD(phnullingrels);
4592
0
  WRITE_UINT_FIELD(phid);
4593
0
  WRITE_UINT_FIELD(phlevelsup);
4594
0
}
4595
4596
static void
4597
_outSpecialJoinInfo(StringInfo str, const SpecialJoinInfo *node)
4598
0
{
4599
0
  WRITE_NODE_TYPE("SPECIALJOININFO");
4600
4601
0
  WRITE_BITMAPSET_FIELD(min_lefthand);
4602
0
  WRITE_BITMAPSET_FIELD(min_righthand);
4603
0
  WRITE_BITMAPSET_FIELD(syn_lefthand);
4604
0
  WRITE_BITMAPSET_FIELD(syn_righthand);
4605
0
  WRITE_ENUM_FIELD(jointype, JoinType);
4606
0
  WRITE_UINT_FIELD(ojrelid);
4607
0
  WRITE_BITMAPSET_FIELD(commute_above_l);
4608
0
  WRITE_BITMAPSET_FIELD(commute_above_r);
4609
0
  WRITE_BITMAPSET_FIELD(commute_below_l);
4610
0
  WRITE_BITMAPSET_FIELD(commute_below_r);
4611
0
  WRITE_BOOL_FIELD(lhs_strict);
4612
0
  WRITE_BOOL_FIELD(semi_can_btree);
4613
0
  WRITE_BOOL_FIELD(semi_can_hash);
4614
0
  WRITE_NODE_FIELD(semi_operators);
4615
0
  WRITE_NODE_FIELD(semi_rhs_exprs);
4616
0
}
4617
4618
static void
4619
_outOuterJoinClauseInfo(StringInfo str, const OuterJoinClauseInfo *node)
4620
0
{
4621
0
  WRITE_NODE_TYPE("OUTERJOINCLAUSEINFO");
4622
4623
0
  WRITE_NODE_FIELD(rinfo);
4624
0
  WRITE_NODE_FIELD(sjinfo);
4625
0
}
4626
4627
static void
4628
_outAppendRelInfo(StringInfo str, const AppendRelInfo *node)
4629
0
{
4630
0
  WRITE_NODE_TYPE("APPENDRELINFO");
4631
4632
0
  WRITE_UINT_FIELD(parent_relid);
4633
0
  WRITE_UINT_FIELD(child_relid);
4634
0
  WRITE_OID_FIELD(parent_reltype);
4635
0
  WRITE_OID_FIELD(child_reltype);
4636
0
  WRITE_NODE_FIELD(translated_vars);
4637
0
  WRITE_INT_FIELD(num_child_cols);
4638
0
  WRITE_ATTRNUMBER_ARRAY(parent_colnos, node->num_child_cols);
4639
0
  WRITE_OID_FIELD(parent_reloid);
4640
0
}
4641
4642
static void
4643
_outRowIdentityVarInfo(StringInfo str, const RowIdentityVarInfo *node)
4644
0
{
4645
0
  WRITE_NODE_TYPE("ROWIDENTITYVARINFO");
4646
4647
0
  WRITE_NODE_FIELD(rowidvar);
4648
0
  WRITE_INT_FIELD(rowidwidth);
4649
0
  WRITE_STRING_FIELD(rowidname);
4650
0
  WRITE_BITMAPSET_FIELD(rowidrels);
4651
0
}
4652
4653
static void
4654
_outPlaceHolderInfo(StringInfo str, const PlaceHolderInfo *node)
4655
0
{
4656
0
  WRITE_NODE_TYPE("PLACEHOLDERINFO");
4657
4658
0
  WRITE_UINT_FIELD(phid);
4659
0
  WRITE_NODE_FIELD(ph_var);
4660
0
  WRITE_BITMAPSET_FIELD(ph_eval_at);
4661
0
  WRITE_BITMAPSET_FIELD(ph_lateral);
4662
0
  WRITE_BITMAPSET_FIELD(ph_needed);
4663
0
  WRITE_INT_FIELD(ph_width);
4664
0
}
4665
4666
static void
4667
_outMinMaxAggInfo(StringInfo str, const MinMaxAggInfo *node)
4668
0
{
4669
0
  WRITE_NODE_TYPE("MINMAXAGGINFO");
4670
4671
0
  WRITE_OID_FIELD(aggfnoid);
4672
0
  WRITE_OID_FIELD(aggsortop);
4673
0
  WRITE_NODE_FIELD(target);
4674
0
  WRITE_NODE_FIELD(path);
4675
0
  WRITE_FLOAT_FIELD(pathcost);
4676
0
  WRITE_NODE_FIELD(param);
4677
0
}
4678
4679
static void
4680
_outAggClauseInfo(StringInfo str, const AggClauseInfo *node)
4681
0
{
4682
0
  WRITE_NODE_TYPE("AGGCLAUSEINFO");
4683
4684
0
  WRITE_NODE_FIELD(aggref);
4685
0
  WRITE_BITMAPSET_FIELD(agg_eval_at);
4686
0
}
4687
4688
static void
4689
_outGroupingExprInfo(StringInfo str, const GroupingExprInfo *node)
4690
0
{
4691
0
  WRITE_NODE_TYPE("GROUPINGEXPRINFO");
4692
4693
0
  WRITE_NODE_FIELD(expr);
4694
0
  WRITE_UINT_FIELD(sortgroupref);
4695
0
  WRITE_NODE_FIELD(ec);
4696
0
}
4697
4698
static void
4699
_outPlannerParamItem(StringInfo str, const PlannerParamItem *node)
4700
0
{
4701
0
  WRITE_NODE_TYPE("PLANNERPARAMITEM");
4702
4703
0
  WRITE_NODE_FIELD(item);
4704
0
  WRITE_INT_FIELD(paramId);
4705
0
}
4706
4707
static void
4708
_outAggInfo(StringInfo str, const AggInfo *node)
4709
0
{
4710
0
  WRITE_NODE_TYPE("AGGINFO");
4711
4712
0
  WRITE_NODE_FIELD(aggrefs);
4713
0
  WRITE_INT_FIELD(transno);
4714
0
  WRITE_BOOL_FIELD(shareable);
4715
0
  WRITE_OID_FIELD(finalfn_oid);
4716
0
}
4717
4718
static void
4719
_outAggTransInfo(StringInfo str, const AggTransInfo *node)
4720
0
{
4721
0
  WRITE_NODE_TYPE("AGGTRANSINFO");
4722
4723
0
  WRITE_NODE_FIELD(args);
4724
0
  WRITE_NODE_FIELD(aggfilter);
4725
0
  WRITE_OID_FIELD(transfn_oid);
4726
0
  WRITE_OID_FIELD(serialfn_oid);
4727
0
  WRITE_OID_FIELD(deserialfn_oid);
4728
0
  WRITE_OID_FIELD(combinefn_oid);
4729
0
  WRITE_OID_FIELD(aggtranstype);
4730
0
  WRITE_INT_FIELD(aggtranstypmod);
4731
0
  WRITE_INT_FIELD(transtypeLen);
4732
0
  WRITE_BOOL_FIELD(transtypeByVal);
4733
0
  WRITE_INT_FIELD(aggtransspace);
4734
0
  WRITE_BOOL_FIELD(initValueIsNull);
4735
0
}
4736
4737
static void
4738
_outUniqueRelInfo(StringInfo str, const UniqueRelInfo *node)
4739
0
{
4740
0
  WRITE_NODE_TYPE("UNIQUERELINFO");
4741
4742
0
  WRITE_BITMAPSET_FIELD(outerrelids);
4743
0
  WRITE_BOOL_FIELD(self_join);
4744
0
  WRITE_NODE_FIELD(extra_clauses);
4745
0
}
4746
4747
static void
4748
_outPlannedStmt(StringInfo str, const PlannedStmt *node)
4749
0
{
4750
0
  WRITE_NODE_TYPE("PLANNEDSTMT");
4751
4752
0
  WRITE_ENUM_FIELD(commandType, CmdType);
4753
0
  WRITE_INT64_FIELD(queryId);
4754
0
  WRITE_INT64_FIELD(planId);
4755
0
  WRITE_ENUM_FIELD(planOrigin, PlannedStmtOrigin);
4756
0
  WRITE_BOOL_FIELD(hasReturning);
4757
0
  WRITE_BOOL_FIELD(hasModifyingCTE);
4758
0
  WRITE_BOOL_FIELD(canSetTag);
4759
0
  WRITE_BOOL_FIELD(transientPlan);
4760
0
  WRITE_BOOL_FIELD(dependsOnRole);
4761
0
  WRITE_BOOL_FIELD(parallelModeNeeded);
4762
0
  WRITE_INT_FIELD(jitFlags);
4763
0
  WRITE_NODE_FIELD(planTree);
4764
0
  WRITE_NODE_FIELD(partPruneInfos);
4765
0
  WRITE_NODE_FIELD(rtable);
4766
0
  WRITE_BITMAPSET_FIELD(unprunableRelids);
4767
0
  WRITE_NODE_FIELD(permInfos);
4768
0
  WRITE_NODE_FIELD(resultRelations);
4769
0
  WRITE_NODE_FIELD(appendRelations);
4770
0
  WRITE_NODE_FIELD(subplans);
4771
0
  WRITE_BITMAPSET_FIELD(rewindPlanIDs);
4772
0
  WRITE_NODE_FIELD(rowMarks);
4773
0
  WRITE_NODE_FIELD(relationOids);
4774
0
  WRITE_NODE_FIELD(invalItems);
4775
0
  WRITE_NODE_FIELD(paramExecTypes);
4776
0
  WRITE_NODE_FIELD(utilityStmt);
4777
0
  WRITE_NODE_FIELD(extension_state);
4778
0
  WRITE_LOCATION_FIELD(stmt_location);
4779
0
  WRITE_LOCATION_FIELD(stmt_len);
4780
0
}
4781
4782
static void
4783
_outResult(StringInfo str, const Result *node)
4784
0
{
4785
0
  WRITE_NODE_TYPE("RESULT");
4786
4787
0
  WRITE_INT_FIELD(plan.disabled_nodes);
4788
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
4789
0
  WRITE_FLOAT_FIELD(plan.total_cost);
4790
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
4791
0
  WRITE_INT_FIELD(plan.plan_width);
4792
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
4793
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
4794
0
  WRITE_BOOL_FIELD(plan.async_capable);
4795
0
  WRITE_INT_FIELD(plan.plan_node_id);
4796
0
  WRITE_NODE_FIELD(plan.targetlist);
4797
0
  WRITE_NODE_FIELD(plan.qual);
4798
0
  WRITE_NODE_FIELD(plan.lefttree);
4799
0
  WRITE_NODE_FIELD(plan.righttree);
4800
0
  WRITE_NODE_FIELD(plan.initPlan);
4801
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
4802
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
4803
0
  WRITE_ENUM_FIELD(result_type, ResultType);
4804
0
  WRITE_NODE_FIELD(resconstantqual);
4805
0
  WRITE_BITMAPSET_FIELD(relids);
4806
0
}
4807
4808
static void
4809
_outProjectSet(StringInfo str, const ProjectSet *node)
4810
0
{
4811
0
  WRITE_NODE_TYPE("PROJECTSET");
4812
4813
0
  WRITE_INT_FIELD(plan.disabled_nodes);
4814
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
4815
0
  WRITE_FLOAT_FIELD(plan.total_cost);
4816
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
4817
0
  WRITE_INT_FIELD(plan.plan_width);
4818
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
4819
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
4820
0
  WRITE_BOOL_FIELD(plan.async_capable);
4821
0
  WRITE_INT_FIELD(plan.plan_node_id);
4822
0
  WRITE_NODE_FIELD(plan.targetlist);
4823
0
  WRITE_NODE_FIELD(plan.qual);
4824
0
  WRITE_NODE_FIELD(plan.lefttree);
4825
0
  WRITE_NODE_FIELD(plan.righttree);
4826
0
  WRITE_NODE_FIELD(plan.initPlan);
4827
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
4828
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
4829
0
}
4830
4831
static void
4832
_outModifyTable(StringInfo str, const ModifyTable *node)
4833
0
{
4834
0
  WRITE_NODE_TYPE("MODIFYTABLE");
4835
4836
0
  WRITE_INT_FIELD(plan.disabled_nodes);
4837
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
4838
0
  WRITE_FLOAT_FIELD(plan.total_cost);
4839
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
4840
0
  WRITE_INT_FIELD(plan.plan_width);
4841
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
4842
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
4843
0
  WRITE_BOOL_FIELD(plan.async_capable);
4844
0
  WRITE_INT_FIELD(plan.plan_node_id);
4845
0
  WRITE_NODE_FIELD(plan.targetlist);
4846
0
  WRITE_NODE_FIELD(plan.qual);
4847
0
  WRITE_NODE_FIELD(plan.lefttree);
4848
0
  WRITE_NODE_FIELD(plan.righttree);
4849
0
  WRITE_NODE_FIELD(plan.initPlan);
4850
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
4851
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
4852
0
  WRITE_ENUM_FIELD(operation, CmdType);
4853
0
  WRITE_BOOL_FIELD(canSetTag);
4854
0
  WRITE_UINT_FIELD(nominalRelation);
4855
0
  WRITE_UINT_FIELD(rootRelation);
4856
0
  WRITE_BOOL_FIELD(partColsUpdated);
4857
0
  WRITE_NODE_FIELD(resultRelations);
4858
0
  WRITE_NODE_FIELD(updateColnosLists);
4859
0
  WRITE_NODE_FIELD(withCheckOptionLists);
4860
0
  WRITE_STRING_FIELD(returningOldAlias);
4861
0
  WRITE_STRING_FIELD(returningNewAlias);
4862
0
  WRITE_NODE_FIELD(returningLists);
4863
0
  WRITE_NODE_FIELD(fdwPrivLists);
4864
0
  WRITE_BITMAPSET_FIELD(fdwDirectModifyPlans);
4865
0
  WRITE_NODE_FIELD(rowMarks);
4866
0
  WRITE_INT_FIELD(epqParam);
4867
0
  WRITE_ENUM_FIELD(onConflictAction, OnConflictAction);
4868
0
  WRITE_NODE_FIELD(arbiterIndexes);
4869
0
  WRITE_NODE_FIELD(onConflictSet);
4870
0
  WRITE_NODE_FIELD(onConflictCols);
4871
0
  WRITE_NODE_FIELD(onConflictWhere);
4872
0
  WRITE_UINT_FIELD(exclRelRTI);
4873
0
  WRITE_NODE_FIELD(exclRelTlist);
4874
0
  WRITE_NODE_FIELD(mergeActionLists);
4875
0
  WRITE_NODE_FIELD(mergeJoinConditions);
4876
0
}
4877
4878
static void
4879
_outAppend(StringInfo str, const Append *node)
4880
0
{
4881
0
  WRITE_NODE_TYPE("APPEND");
4882
4883
0
  WRITE_INT_FIELD(plan.disabled_nodes);
4884
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
4885
0
  WRITE_FLOAT_FIELD(plan.total_cost);
4886
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
4887
0
  WRITE_INT_FIELD(plan.plan_width);
4888
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
4889
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
4890
0
  WRITE_BOOL_FIELD(plan.async_capable);
4891
0
  WRITE_INT_FIELD(plan.plan_node_id);
4892
0
  WRITE_NODE_FIELD(plan.targetlist);
4893
0
  WRITE_NODE_FIELD(plan.qual);
4894
0
  WRITE_NODE_FIELD(plan.lefttree);
4895
0
  WRITE_NODE_FIELD(plan.righttree);
4896
0
  WRITE_NODE_FIELD(plan.initPlan);
4897
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
4898
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
4899
0
  WRITE_BITMAPSET_FIELD(apprelids);
4900
0
  WRITE_NODE_FIELD(appendplans);
4901
0
  WRITE_INT_FIELD(nasyncplans);
4902
0
  WRITE_INT_FIELD(first_partial_plan);
4903
0
  WRITE_INT_FIELD(part_prune_index);
4904
0
}
4905
4906
static void
4907
_outMergeAppend(StringInfo str, const MergeAppend *node)
4908
0
{
4909
0
  WRITE_NODE_TYPE("MERGEAPPEND");
4910
4911
0
  WRITE_INT_FIELD(plan.disabled_nodes);
4912
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
4913
0
  WRITE_FLOAT_FIELD(plan.total_cost);
4914
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
4915
0
  WRITE_INT_FIELD(plan.plan_width);
4916
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
4917
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
4918
0
  WRITE_BOOL_FIELD(plan.async_capable);
4919
0
  WRITE_INT_FIELD(plan.plan_node_id);
4920
0
  WRITE_NODE_FIELD(plan.targetlist);
4921
0
  WRITE_NODE_FIELD(plan.qual);
4922
0
  WRITE_NODE_FIELD(plan.lefttree);
4923
0
  WRITE_NODE_FIELD(plan.righttree);
4924
0
  WRITE_NODE_FIELD(plan.initPlan);
4925
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
4926
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
4927
0
  WRITE_BITMAPSET_FIELD(apprelids);
4928
0
  WRITE_NODE_FIELD(mergeplans);
4929
0
  WRITE_INT_FIELD(numCols);
4930
0
  WRITE_ATTRNUMBER_ARRAY(sortColIdx, node->numCols);
4931
0
  WRITE_OID_ARRAY(sortOperators, node->numCols);
4932
0
  WRITE_OID_ARRAY(collations, node->numCols);
4933
0
  WRITE_BOOL_ARRAY(nullsFirst, node->numCols);
4934
0
  WRITE_INT_FIELD(part_prune_index);
4935
0
}
4936
4937
static void
4938
_outRecursiveUnion(StringInfo str, const RecursiveUnion *node)
4939
0
{
4940
0
  WRITE_NODE_TYPE("RECURSIVEUNION");
4941
4942
0
  WRITE_INT_FIELD(plan.disabled_nodes);
4943
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
4944
0
  WRITE_FLOAT_FIELD(plan.total_cost);
4945
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
4946
0
  WRITE_INT_FIELD(plan.plan_width);
4947
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
4948
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
4949
0
  WRITE_BOOL_FIELD(plan.async_capable);
4950
0
  WRITE_INT_FIELD(plan.plan_node_id);
4951
0
  WRITE_NODE_FIELD(plan.targetlist);
4952
0
  WRITE_NODE_FIELD(plan.qual);
4953
0
  WRITE_NODE_FIELD(plan.lefttree);
4954
0
  WRITE_NODE_FIELD(plan.righttree);
4955
0
  WRITE_NODE_FIELD(plan.initPlan);
4956
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
4957
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
4958
0
  WRITE_INT_FIELD(wtParam);
4959
0
  WRITE_INT_FIELD(numCols);
4960
0
  WRITE_ATTRNUMBER_ARRAY(dupColIdx, node->numCols);
4961
0
  WRITE_OID_ARRAY(dupOperators, node->numCols);
4962
0
  WRITE_OID_ARRAY(dupCollations, node->numCols);
4963
0
  WRITE_LONG_FIELD(numGroups);
4964
0
}
4965
4966
static void
4967
_outBitmapAnd(StringInfo str, const BitmapAnd *node)
4968
0
{
4969
0
  WRITE_NODE_TYPE("BITMAPAND");
4970
4971
0
  WRITE_INT_FIELD(plan.disabled_nodes);
4972
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
4973
0
  WRITE_FLOAT_FIELD(plan.total_cost);
4974
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
4975
0
  WRITE_INT_FIELD(plan.plan_width);
4976
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
4977
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
4978
0
  WRITE_BOOL_FIELD(plan.async_capable);
4979
0
  WRITE_INT_FIELD(plan.plan_node_id);
4980
0
  WRITE_NODE_FIELD(plan.targetlist);
4981
0
  WRITE_NODE_FIELD(plan.qual);
4982
0
  WRITE_NODE_FIELD(plan.lefttree);
4983
0
  WRITE_NODE_FIELD(plan.righttree);
4984
0
  WRITE_NODE_FIELD(plan.initPlan);
4985
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
4986
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
4987
0
  WRITE_NODE_FIELD(bitmapplans);
4988
0
}
4989
4990
static void
4991
_outBitmapOr(StringInfo str, const BitmapOr *node)
4992
0
{
4993
0
  WRITE_NODE_TYPE("BITMAPOR");
4994
4995
0
  WRITE_INT_FIELD(plan.disabled_nodes);
4996
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
4997
0
  WRITE_FLOAT_FIELD(plan.total_cost);
4998
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
4999
0
  WRITE_INT_FIELD(plan.plan_width);
5000
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
5001
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
5002
0
  WRITE_BOOL_FIELD(plan.async_capable);
5003
0
  WRITE_INT_FIELD(plan.plan_node_id);
5004
0
  WRITE_NODE_FIELD(plan.targetlist);
5005
0
  WRITE_NODE_FIELD(plan.qual);
5006
0
  WRITE_NODE_FIELD(plan.lefttree);
5007
0
  WRITE_NODE_FIELD(plan.righttree);
5008
0
  WRITE_NODE_FIELD(plan.initPlan);
5009
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
5010
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
5011
0
  WRITE_BOOL_FIELD(isshared);
5012
0
  WRITE_NODE_FIELD(bitmapplans);
5013
0
}
5014
5015
static void
5016
_outSeqScan(StringInfo str, const SeqScan *node)
5017
0
{
5018
0
  WRITE_NODE_TYPE("SEQSCAN");
5019
5020
0
  WRITE_INT_FIELD(scan.plan.disabled_nodes);
5021
0
  WRITE_FLOAT_FIELD(scan.plan.startup_cost);
5022
0
  WRITE_FLOAT_FIELD(scan.plan.total_cost);
5023
0
  WRITE_FLOAT_FIELD(scan.plan.plan_rows);
5024
0
  WRITE_INT_FIELD(scan.plan.plan_width);
5025
0
  WRITE_BOOL_FIELD(scan.plan.parallel_aware);
5026
0
  WRITE_BOOL_FIELD(scan.plan.parallel_safe);
5027
0
  WRITE_BOOL_FIELD(scan.plan.async_capable);
5028
0
  WRITE_INT_FIELD(scan.plan.plan_node_id);
5029
0
  WRITE_NODE_FIELD(scan.plan.targetlist);
5030
0
  WRITE_NODE_FIELD(scan.plan.qual);
5031
0
  WRITE_NODE_FIELD(scan.plan.lefttree);
5032
0
  WRITE_NODE_FIELD(scan.plan.righttree);
5033
0
  WRITE_NODE_FIELD(scan.plan.initPlan);
5034
0
  WRITE_BITMAPSET_FIELD(scan.plan.extParam);
5035
0
  WRITE_BITMAPSET_FIELD(scan.plan.allParam);
5036
0
  WRITE_UINT_FIELD(scan.scanrelid);
5037
0
}
5038
5039
static void
5040
_outSampleScan(StringInfo str, const SampleScan *node)
5041
0
{
5042
0
  WRITE_NODE_TYPE("SAMPLESCAN");
5043
5044
0
  WRITE_INT_FIELD(scan.plan.disabled_nodes);
5045
0
  WRITE_FLOAT_FIELD(scan.plan.startup_cost);
5046
0
  WRITE_FLOAT_FIELD(scan.plan.total_cost);
5047
0
  WRITE_FLOAT_FIELD(scan.plan.plan_rows);
5048
0
  WRITE_INT_FIELD(scan.plan.plan_width);
5049
0
  WRITE_BOOL_FIELD(scan.plan.parallel_aware);
5050
0
  WRITE_BOOL_FIELD(scan.plan.parallel_safe);
5051
0
  WRITE_BOOL_FIELD(scan.plan.async_capable);
5052
0
  WRITE_INT_FIELD(scan.plan.plan_node_id);
5053
0
  WRITE_NODE_FIELD(scan.plan.targetlist);
5054
0
  WRITE_NODE_FIELD(scan.plan.qual);
5055
0
  WRITE_NODE_FIELD(scan.plan.lefttree);
5056
0
  WRITE_NODE_FIELD(scan.plan.righttree);
5057
0
  WRITE_NODE_FIELD(scan.plan.initPlan);
5058
0
  WRITE_BITMAPSET_FIELD(scan.plan.extParam);
5059
0
  WRITE_BITMAPSET_FIELD(scan.plan.allParam);
5060
0
  WRITE_UINT_FIELD(scan.scanrelid);
5061
0
  WRITE_NODE_FIELD(tablesample);
5062
0
}
5063
5064
static void
5065
_outIndexScan(StringInfo str, const IndexScan *node)
5066
0
{
5067
0
  WRITE_NODE_TYPE("INDEXSCAN");
5068
5069
0
  WRITE_INT_FIELD(scan.plan.disabled_nodes);
5070
0
  WRITE_FLOAT_FIELD(scan.plan.startup_cost);
5071
0
  WRITE_FLOAT_FIELD(scan.plan.total_cost);
5072
0
  WRITE_FLOAT_FIELD(scan.plan.plan_rows);
5073
0
  WRITE_INT_FIELD(scan.plan.plan_width);
5074
0
  WRITE_BOOL_FIELD(scan.plan.parallel_aware);
5075
0
  WRITE_BOOL_FIELD(scan.plan.parallel_safe);
5076
0
  WRITE_BOOL_FIELD(scan.plan.async_capable);
5077
0
  WRITE_INT_FIELD(scan.plan.plan_node_id);
5078
0
  WRITE_NODE_FIELD(scan.plan.targetlist);
5079
0
  WRITE_NODE_FIELD(scan.plan.qual);
5080
0
  WRITE_NODE_FIELD(scan.plan.lefttree);
5081
0
  WRITE_NODE_FIELD(scan.plan.righttree);
5082
0
  WRITE_NODE_FIELD(scan.plan.initPlan);
5083
0
  WRITE_BITMAPSET_FIELD(scan.plan.extParam);
5084
0
  WRITE_BITMAPSET_FIELD(scan.plan.allParam);
5085
0
  WRITE_UINT_FIELD(scan.scanrelid);
5086
0
  WRITE_OID_FIELD(indexid);
5087
0
  WRITE_NODE_FIELD(indexqual);
5088
0
  WRITE_NODE_FIELD(indexqualorig);
5089
0
  WRITE_NODE_FIELD(indexorderby);
5090
0
  WRITE_NODE_FIELD(indexorderbyorig);
5091
0
  WRITE_NODE_FIELD(indexorderbyops);
5092
0
  WRITE_ENUM_FIELD(indexorderdir, ScanDirection);
5093
0
}
5094
5095
static void
5096
_outIndexOnlyScan(StringInfo str, const IndexOnlyScan *node)
5097
0
{
5098
0
  WRITE_NODE_TYPE("INDEXONLYSCAN");
5099
5100
0
  WRITE_INT_FIELD(scan.plan.disabled_nodes);
5101
0
  WRITE_FLOAT_FIELD(scan.plan.startup_cost);
5102
0
  WRITE_FLOAT_FIELD(scan.plan.total_cost);
5103
0
  WRITE_FLOAT_FIELD(scan.plan.plan_rows);
5104
0
  WRITE_INT_FIELD(scan.plan.plan_width);
5105
0
  WRITE_BOOL_FIELD(scan.plan.parallel_aware);
5106
0
  WRITE_BOOL_FIELD(scan.plan.parallel_safe);
5107
0
  WRITE_BOOL_FIELD(scan.plan.async_capable);
5108
0
  WRITE_INT_FIELD(scan.plan.plan_node_id);
5109
0
  WRITE_NODE_FIELD(scan.plan.targetlist);
5110
0
  WRITE_NODE_FIELD(scan.plan.qual);
5111
0
  WRITE_NODE_FIELD(scan.plan.lefttree);
5112
0
  WRITE_NODE_FIELD(scan.plan.righttree);
5113
0
  WRITE_NODE_FIELD(scan.plan.initPlan);
5114
0
  WRITE_BITMAPSET_FIELD(scan.plan.extParam);
5115
0
  WRITE_BITMAPSET_FIELD(scan.plan.allParam);
5116
0
  WRITE_UINT_FIELD(scan.scanrelid);
5117
0
  WRITE_OID_FIELD(indexid);
5118
0
  WRITE_NODE_FIELD(indexqual);
5119
0
  WRITE_NODE_FIELD(recheckqual);
5120
0
  WRITE_NODE_FIELD(indexorderby);
5121
0
  WRITE_NODE_FIELD(indextlist);
5122
0
  WRITE_ENUM_FIELD(indexorderdir, ScanDirection);
5123
0
}
5124
5125
static void
5126
_outBitmapIndexScan(StringInfo str, const BitmapIndexScan *node)
5127
0
{
5128
0
  WRITE_NODE_TYPE("BITMAPINDEXSCAN");
5129
5130
0
  WRITE_INT_FIELD(scan.plan.disabled_nodes);
5131
0
  WRITE_FLOAT_FIELD(scan.plan.startup_cost);
5132
0
  WRITE_FLOAT_FIELD(scan.plan.total_cost);
5133
0
  WRITE_FLOAT_FIELD(scan.plan.plan_rows);
5134
0
  WRITE_INT_FIELD(scan.plan.plan_width);
5135
0
  WRITE_BOOL_FIELD(scan.plan.parallel_aware);
5136
0
  WRITE_BOOL_FIELD(scan.plan.parallel_safe);
5137
0
  WRITE_BOOL_FIELD(scan.plan.async_capable);
5138
0
  WRITE_INT_FIELD(scan.plan.plan_node_id);
5139
0
  WRITE_NODE_FIELD(scan.plan.targetlist);
5140
0
  WRITE_NODE_FIELD(scan.plan.qual);
5141
0
  WRITE_NODE_FIELD(scan.plan.lefttree);
5142
0
  WRITE_NODE_FIELD(scan.plan.righttree);
5143
0
  WRITE_NODE_FIELD(scan.plan.initPlan);
5144
0
  WRITE_BITMAPSET_FIELD(scan.plan.extParam);
5145
0
  WRITE_BITMAPSET_FIELD(scan.plan.allParam);
5146
0
  WRITE_UINT_FIELD(scan.scanrelid);
5147
0
  WRITE_OID_FIELD(indexid);
5148
0
  WRITE_BOOL_FIELD(isshared);
5149
0
  WRITE_NODE_FIELD(indexqual);
5150
0
  WRITE_NODE_FIELD(indexqualorig);
5151
0
}
5152
5153
static void
5154
_outBitmapHeapScan(StringInfo str, const BitmapHeapScan *node)
5155
0
{
5156
0
  WRITE_NODE_TYPE("BITMAPHEAPSCAN");
5157
5158
0
  WRITE_INT_FIELD(scan.plan.disabled_nodes);
5159
0
  WRITE_FLOAT_FIELD(scan.plan.startup_cost);
5160
0
  WRITE_FLOAT_FIELD(scan.plan.total_cost);
5161
0
  WRITE_FLOAT_FIELD(scan.plan.plan_rows);
5162
0
  WRITE_INT_FIELD(scan.plan.plan_width);
5163
0
  WRITE_BOOL_FIELD(scan.plan.parallel_aware);
5164
0
  WRITE_BOOL_FIELD(scan.plan.parallel_safe);
5165
0
  WRITE_BOOL_FIELD(scan.plan.async_capable);
5166
0
  WRITE_INT_FIELD(scan.plan.plan_node_id);
5167
0
  WRITE_NODE_FIELD(scan.plan.targetlist);
5168
0
  WRITE_NODE_FIELD(scan.plan.qual);
5169
0
  WRITE_NODE_FIELD(scan.plan.lefttree);
5170
0
  WRITE_NODE_FIELD(scan.plan.righttree);
5171
0
  WRITE_NODE_FIELD(scan.plan.initPlan);
5172
0
  WRITE_BITMAPSET_FIELD(scan.plan.extParam);
5173
0
  WRITE_BITMAPSET_FIELD(scan.plan.allParam);
5174
0
  WRITE_UINT_FIELD(scan.scanrelid);
5175
0
  WRITE_NODE_FIELD(bitmapqualorig);
5176
0
}
5177
5178
static void
5179
_outTidScan(StringInfo str, const TidScan *node)
5180
0
{
5181
0
  WRITE_NODE_TYPE("TIDSCAN");
5182
5183
0
  WRITE_INT_FIELD(scan.plan.disabled_nodes);
5184
0
  WRITE_FLOAT_FIELD(scan.plan.startup_cost);
5185
0
  WRITE_FLOAT_FIELD(scan.plan.total_cost);
5186
0
  WRITE_FLOAT_FIELD(scan.plan.plan_rows);
5187
0
  WRITE_INT_FIELD(scan.plan.plan_width);
5188
0
  WRITE_BOOL_FIELD(scan.plan.parallel_aware);
5189
0
  WRITE_BOOL_FIELD(scan.plan.parallel_safe);
5190
0
  WRITE_BOOL_FIELD(scan.plan.async_capable);
5191
0
  WRITE_INT_FIELD(scan.plan.plan_node_id);
5192
0
  WRITE_NODE_FIELD(scan.plan.targetlist);
5193
0
  WRITE_NODE_FIELD(scan.plan.qual);
5194
0
  WRITE_NODE_FIELD(scan.plan.lefttree);
5195
0
  WRITE_NODE_FIELD(scan.plan.righttree);
5196
0
  WRITE_NODE_FIELD(scan.plan.initPlan);
5197
0
  WRITE_BITMAPSET_FIELD(scan.plan.extParam);
5198
0
  WRITE_BITMAPSET_FIELD(scan.plan.allParam);
5199
0
  WRITE_UINT_FIELD(scan.scanrelid);
5200
0
  WRITE_NODE_FIELD(tidquals);
5201
0
}
5202
5203
static void
5204
_outTidRangeScan(StringInfo str, const TidRangeScan *node)
5205
0
{
5206
0
  WRITE_NODE_TYPE("TIDRANGESCAN");
5207
5208
0
  WRITE_INT_FIELD(scan.plan.disabled_nodes);
5209
0
  WRITE_FLOAT_FIELD(scan.plan.startup_cost);
5210
0
  WRITE_FLOAT_FIELD(scan.plan.total_cost);
5211
0
  WRITE_FLOAT_FIELD(scan.plan.plan_rows);
5212
0
  WRITE_INT_FIELD(scan.plan.plan_width);
5213
0
  WRITE_BOOL_FIELD(scan.plan.parallel_aware);
5214
0
  WRITE_BOOL_FIELD(scan.plan.parallel_safe);
5215
0
  WRITE_BOOL_FIELD(scan.plan.async_capable);
5216
0
  WRITE_INT_FIELD(scan.plan.plan_node_id);
5217
0
  WRITE_NODE_FIELD(scan.plan.targetlist);
5218
0
  WRITE_NODE_FIELD(scan.plan.qual);
5219
0
  WRITE_NODE_FIELD(scan.plan.lefttree);
5220
0
  WRITE_NODE_FIELD(scan.plan.righttree);
5221
0
  WRITE_NODE_FIELD(scan.plan.initPlan);
5222
0
  WRITE_BITMAPSET_FIELD(scan.plan.extParam);
5223
0
  WRITE_BITMAPSET_FIELD(scan.plan.allParam);
5224
0
  WRITE_UINT_FIELD(scan.scanrelid);
5225
0
  WRITE_NODE_FIELD(tidrangequals);
5226
0
}
5227
5228
static void
5229
_outSubqueryScan(StringInfo str, const SubqueryScan *node)
5230
0
{
5231
0
  WRITE_NODE_TYPE("SUBQUERYSCAN");
5232
5233
0
  WRITE_INT_FIELD(scan.plan.disabled_nodes);
5234
0
  WRITE_FLOAT_FIELD(scan.plan.startup_cost);
5235
0
  WRITE_FLOAT_FIELD(scan.plan.total_cost);
5236
0
  WRITE_FLOAT_FIELD(scan.plan.plan_rows);
5237
0
  WRITE_INT_FIELD(scan.plan.plan_width);
5238
0
  WRITE_BOOL_FIELD(scan.plan.parallel_aware);
5239
0
  WRITE_BOOL_FIELD(scan.plan.parallel_safe);
5240
0
  WRITE_BOOL_FIELD(scan.plan.async_capable);
5241
0
  WRITE_INT_FIELD(scan.plan.plan_node_id);
5242
0
  WRITE_NODE_FIELD(scan.plan.targetlist);
5243
0
  WRITE_NODE_FIELD(scan.plan.qual);
5244
0
  WRITE_NODE_FIELD(scan.plan.lefttree);
5245
0
  WRITE_NODE_FIELD(scan.plan.righttree);
5246
0
  WRITE_NODE_FIELD(scan.plan.initPlan);
5247
0
  WRITE_BITMAPSET_FIELD(scan.plan.extParam);
5248
0
  WRITE_BITMAPSET_FIELD(scan.plan.allParam);
5249
0
  WRITE_UINT_FIELD(scan.scanrelid);
5250
0
  WRITE_NODE_FIELD(subplan);
5251
0
  WRITE_ENUM_FIELD(scanstatus, SubqueryScanStatus);
5252
0
}
5253
5254
static void
5255
_outFunctionScan(StringInfo str, const FunctionScan *node)
5256
0
{
5257
0
  WRITE_NODE_TYPE("FUNCTIONSCAN");
5258
5259
0
  WRITE_INT_FIELD(scan.plan.disabled_nodes);
5260
0
  WRITE_FLOAT_FIELD(scan.plan.startup_cost);
5261
0
  WRITE_FLOAT_FIELD(scan.plan.total_cost);
5262
0
  WRITE_FLOAT_FIELD(scan.plan.plan_rows);
5263
0
  WRITE_INT_FIELD(scan.plan.plan_width);
5264
0
  WRITE_BOOL_FIELD(scan.plan.parallel_aware);
5265
0
  WRITE_BOOL_FIELD(scan.plan.parallel_safe);
5266
0
  WRITE_BOOL_FIELD(scan.plan.async_capable);
5267
0
  WRITE_INT_FIELD(scan.plan.plan_node_id);
5268
0
  WRITE_NODE_FIELD(scan.plan.targetlist);
5269
0
  WRITE_NODE_FIELD(scan.plan.qual);
5270
0
  WRITE_NODE_FIELD(scan.plan.lefttree);
5271
0
  WRITE_NODE_FIELD(scan.plan.righttree);
5272
0
  WRITE_NODE_FIELD(scan.plan.initPlan);
5273
0
  WRITE_BITMAPSET_FIELD(scan.plan.extParam);
5274
0
  WRITE_BITMAPSET_FIELD(scan.plan.allParam);
5275
0
  WRITE_UINT_FIELD(scan.scanrelid);
5276
0
  WRITE_NODE_FIELD(functions);
5277
0
  WRITE_BOOL_FIELD(funcordinality);
5278
0
}
5279
5280
static void
5281
_outValuesScan(StringInfo str, const ValuesScan *node)
5282
0
{
5283
0
  WRITE_NODE_TYPE("VALUESSCAN");
5284
5285
0
  WRITE_INT_FIELD(scan.plan.disabled_nodes);
5286
0
  WRITE_FLOAT_FIELD(scan.plan.startup_cost);
5287
0
  WRITE_FLOAT_FIELD(scan.plan.total_cost);
5288
0
  WRITE_FLOAT_FIELD(scan.plan.plan_rows);
5289
0
  WRITE_INT_FIELD(scan.plan.plan_width);
5290
0
  WRITE_BOOL_FIELD(scan.plan.parallel_aware);
5291
0
  WRITE_BOOL_FIELD(scan.plan.parallel_safe);
5292
0
  WRITE_BOOL_FIELD(scan.plan.async_capable);
5293
0
  WRITE_INT_FIELD(scan.plan.plan_node_id);
5294
0
  WRITE_NODE_FIELD(scan.plan.targetlist);
5295
0
  WRITE_NODE_FIELD(scan.plan.qual);
5296
0
  WRITE_NODE_FIELD(scan.plan.lefttree);
5297
0
  WRITE_NODE_FIELD(scan.plan.righttree);
5298
0
  WRITE_NODE_FIELD(scan.plan.initPlan);
5299
0
  WRITE_BITMAPSET_FIELD(scan.plan.extParam);
5300
0
  WRITE_BITMAPSET_FIELD(scan.plan.allParam);
5301
0
  WRITE_UINT_FIELD(scan.scanrelid);
5302
0
  WRITE_NODE_FIELD(values_lists);
5303
0
}
5304
5305
static void
5306
_outTableFuncScan(StringInfo str, const TableFuncScan *node)
5307
0
{
5308
0
  WRITE_NODE_TYPE("TABLEFUNCSCAN");
5309
5310
0
  WRITE_INT_FIELD(scan.plan.disabled_nodes);
5311
0
  WRITE_FLOAT_FIELD(scan.plan.startup_cost);
5312
0
  WRITE_FLOAT_FIELD(scan.plan.total_cost);
5313
0
  WRITE_FLOAT_FIELD(scan.plan.plan_rows);
5314
0
  WRITE_INT_FIELD(scan.plan.plan_width);
5315
0
  WRITE_BOOL_FIELD(scan.plan.parallel_aware);
5316
0
  WRITE_BOOL_FIELD(scan.plan.parallel_safe);
5317
0
  WRITE_BOOL_FIELD(scan.plan.async_capable);
5318
0
  WRITE_INT_FIELD(scan.plan.plan_node_id);
5319
0
  WRITE_NODE_FIELD(scan.plan.targetlist);
5320
0
  WRITE_NODE_FIELD(scan.plan.qual);
5321
0
  WRITE_NODE_FIELD(scan.plan.lefttree);
5322
0
  WRITE_NODE_FIELD(scan.plan.righttree);
5323
0
  WRITE_NODE_FIELD(scan.plan.initPlan);
5324
0
  WRITE_BITMAPSET_FIELD(scan.plan.extParam);
5325
0
  WRITE_BITMAPSET_FIELD(scan.plan.allParam);
5326
0
  WRITE_UINT_FIELD(scan.scanrelid);
5327
0
  WRITE_NODE_FIELD(tablefunc);
5328
0
}
5329
5330
static void
5331
_outCteScan(StringInfo str, const CteScan *node)
5332
0
{
5333
0
  WRITE_NODE_TYPE("CTESCAN");
5334
5335
0
  WRITE_INT_FIELD(scan.plan.disabled_nodes);
5336
0
  WRITE_FLOAT_FIELD(scan.plan.startup_cost);
5337
0
  WRITE_FLOAT_FIELD(scan.plan.total_cost);
5338
0
  WRITE_FLOAT_FIELD(scan.plan.plan_rows);
5339
0
  WRITE_INT_FIELD(scan.plan.plan_width);
5340
0
  WRITE_BOOL_FIELD(scan.plan.parallel_aware);
5341
0
  WRITE_BOOL_FIELD(scan.plan.parallel_safe);
5342
0
  WRITE_BOOL_FIELD(scan.plan.async_capable);
5343
0
  WRITE_INT_FIELD(scan.plan.plan_node_id);
5344
0
  WRITE_NODE_FIELD(scan.plan.targetlist);
5345
0
  WRITE_NODE_FIELD(scan.plan.qual);
5346
0
  WRITE_NODE_FIELD(scan.plan.lefttree);
5347
0
  WRITE_NODE_FIELD(scan.plan.righttree);
5348
0
  WRITE_NODE_FIELD(scan.plan.initPlan);
5349
0
  WRITE_BITMAPSET_FIELD(scan.plan.extParam);
5350
0
  WRITE_BITMAPSET_FIELD(scan.plan.allParam);
5351
0
  WRITE_UINT_FIELD(scan.scanrelid);
5352
0
  WRITE_INT_FIELD(ctePlanId);
5353
0
  WRITE_INT_FIELD(cteParam);
5354
0
}
5355
5356
static void
5357
_outNamedTuplestoreScan(StringInfo str, const NamedTuplestoreScan *node)
5358
0
{
5359
0
  WRITE_NODE_TYPE("NAMEDTUPLESTORESCAN");
5360
5361
0
  WRITE_INT_FIELD(scan.plan.disabled_nodes);
5362
0
  WRITE_FLOAT_FIELD(scan.plan.startup_cost);
5363
0
  WRITE_FLOAT_FIELD(scan.plan.total_cost);
5364
0
  WRITE_FLOAT_FIELD(scan.plan.plan_rows);
5365
0
  WRITE_INT_FIELD(scan.plan.plan_width);
5366
0
  WRITE_BOOL_FIELD(scan.plan.parallel_aware);
5367
0
  WRITE_BOOL_FIELD(scan.plan.parallel_safe);
5368
0
  WRITE_BOOL_FIELD(scan.plan.async_capable);
5369
0
  WRITE_INT_FIELD(scan.plan.plan_node_id);
5370
0
  WRITE_NODE_FIELD(scan.plan.targetlist);
5371
0
  WRITE_NODE_FIELD(scan.plan.qual);
5372
0
  WRITE_NODE_FIELD(scan.plan.lefttree);
5373
0
  WRITE_NODE_FIELD(scan.plan.righttree);
5374
0
  WRITE_NODE_FIELD(scan.plan.initPlan);
5375
0
  WRITE_BITMAPSET_FIELD(scan.plan.extParam);
5376
0
  WRITE_BITMAPSET_FIELD(scan.plan.allParam);
5377
0
  WRITE_UINT_FIELD(scan.scanrelid);
5378
0
  WRITE_STRING_FIELD(enrname);
5379
0
}
5380
5381
static void
5382
_outWorkTableScan(StringInfo str, const WorkTableScan *node)
5383
0
{
5384
0
  WRITE_NODE_TYPE("WORKTABLESCAN");
5385
5386
0
  WRITE_INT_FIELD(scan.plan.disabled_nodes);
5387
0
  WRITE_FLOAT_FIELD(scan.plan.startup_cost);
5388
0
  WRITE_FLOAT_FIELD(scan.plan.total_cost);
5389
0
  WRITE_FLOAT_FIELD(scan.plan.plan_rows);
5390
0
  WRITE_INT_FIELD(scan.plan.plan_width);
5391
0
  WRITE_BOOL_FIELD(scan.plan.parallel_aware);
5392
0
  WRITE_BOOL_FIELD(scan.plan.parallel_safe);
5393
0
  WRITE_BOOL_FIELD(scan.plan.async_capable);
5394
0
  WRITE_INT_FIELD(scan.plan.plan_node_id);
5395
0
  WRITE_NODE_FIELD(scan.plan.targetlist);
5396
0
  WRITE_NODE_FIELD(scan.plan.qual);
5397
0
  WRITE_NODE_FIELD(scan.plan.lefttree);
5398
0
  WRITE_NODE_FIELD(scan.plan.righttree);
5399
0
  WRITE_NODE_FIELD(scan.plan.initPlan);
5400
0
  WRITE_BITMAPSET_FIELD(scan.plan.extParam);
5401
0
  WRITE_BITMAPSET_FIELD(scan.plan.allParam);
5402
0
  WRITE_UINT_FIELD(scan.scanrelid);
5403
0
  WRITE_INT_FIELD(wtParam);
5404
0
}
5405
5406
static void
5407
_outForeignScan(StringInfo str, const ForeignScan *node)
5408
0
{
5409
0
  WRITE_NODE_TYPE("FOREIGNSCAN");
5410
5411
0
  WRITE_INT_FIELD(scan.plan.disabled_nodes);
5412
0
  WRITE_FLOAT_FIELD(scan.plan.startup_cost);
5413
0
  WRITE_FLOAT_FIELD(scan.plan.total_cost);
5414
0
  WRITE_FLOAT_FIELD(scan.plan.plan_rows);
5415
0
  WRITE_INT_FIELD(scan.plan.plan_width);
5416
0
  WRITE_BOOL_FIELD(scan.plan.parallel_aware);
5417
0
  WRITE_BOOL_FIELD(scan.plan.parallel_safe);
5418
0
  WRITE_BOOL_FIELD(scan.plan.async_capable);
5419
0
  WRITE_INT_FIELD(scan.plan.plan_node_id);
5420
0
  WRITE_NODE_FIELD(scan.plan.targetlist);
5421
0
  WRITE_NODE_FIELD(scan.plan.qual);
5422
0
  WRITE_NODE_FIELD(scan.plan.lefttree);
5423
0
  WRITE_NODE_FIELD(scan.plan.righttree);
5424
0
  WRITE_NODE_FIELD(scan.plan.initPlan);
5425
0
  WRITE_BITMAPSET_FIELD(scan.plan.extParam);
5426
0
  WRITE_BITMAPSET_FIELD(scan.plan.allParam);
5427
0
  WRITE_UINT_FIELD(scan.scanrelid);
5428
0
  WRITE_ENUM_FIELD(operation, CmdType);
5429
0
  WRITE_UINT_FIELD(resultRelation);
5430
0
  WRITE_OID_FIELD(checkAsUser);
5431
0
  WRITE_OID_FIELD(fs_server);
5432
0
  WRITE_NODE_FIELD(fdw_exprs);
5433
0
  WRITE_NODE_FIELD(fdw_private);
5434
0
  WRITE_NODE_FIELD(fdw_scan_tlist);
5435
0
  WRITE_NODE_FIELD(fdw_recheck_quals);
5436
0
  WRITE_BITMAPSET_FIELD(fs_relids);
5437
0
  WRITE_BITMAPSET_FIELD(fs_base_relids);
5438
0
  WRITE_BOOL_FIELD(fsSystemCol);
5439
0
}
5440
5441
static void
5442
_outCustomScan(StringInfo str, const CustomScan *node)
5443
0
{
5444
0
  WRITE_NODE_TYPE("CUSTOMSCAN");
5445
5446
0
  WRITE_INT_FIELD(scan.plan.disabled_nodes);
5447
0
  WRITE_FLOAT_FIELD(scan.plan.startup_cost);
5448
0
  WRITE_FLOAT_FIELD(scan.plan.total_cost);
5449
0
  WRITE_FLOAT_FIELD(scan.plan.plan_rows);
5450
0
  WRITE_INT_FIELD(scan.plan.plan_width);
5451
0
  WRITE_BOOL_FIELD(scan.plan.parallel_aware);
5452
0
  WRITE_BOOL_FIELD(scan.plan.parallel_safe);
5453
0
  WRITE_BOOL_FIELD(scan.plan.async_capable);
5454
0
  WRITE_INT_FIELD(scan.plan.plan_node_id);
5455
0
  WRITE_NODE_FIELD(scan.plan.targetlist);
5456
0
  WRITE_NODE_FIELD(scan.plan.qual);
5457
0
  WRITE_NODE_FIELD(scan.plan.lefttree);
5458
0
  WRITE_NODE_FIELD(scan.plan.righttree);
5459
0
  WRITE_NODE_FIELD(scan.plan.initPlan);
5460
0
  WRITE_BITMAPSET_FIELD(scan.plan.extParam);
5461
0
  WRITE_BITMAPSET_FIELD(scan.plan.allParam);
5462
0
  WRITE_UINT_FIELD(scan.scanrelid);
5463
0
  WRITE_UINT_FIELD(flags);
5464
0
  WRITE_NODE_FIELD(custom_plans);
5465
0
  WRITE_NODE_FIELD(custom_exprs);
5466
0
  WRITE_NODE_FIELD(custom_private);
5467
0
  WRITE_NODE_FIELD(custom_scan_tlist);
5468
0
  WRITE_BITMAPSET_FIELD(custom_relids);
5469
5470
  /* CustomName is a key to lookup CustomScanMethods */
5471
0
  appendStringInfoString(str, " :methods ");
5472
0
  outToken(str, node->methods->CustomName);
5473
0
}
5474
5475
static void
5476
_outNestLoop(StringInfo str, const NestLoop *node)
5477
0
{
5478
0
  WRITE_NODE_TYPE("NESTLOOP");
5479
5480
0
  WRITE_INT_FIELD(join.plan.disabled_nodes);
5481
0
  WRITE_FLOAT_FIELD(join.plan.startup_cost);
5482
0
  WRITE_FLOAT_FIELD(join.plan.total_cost);
5483
0
  WRITE_FLOAT_FIELD(join.plan.plan_rows);
5484
0
  WRITE_INT_FIELD(join.plan.plan_width);
5485
0
  WRITE_BOOL_FIELD(join.plan.parallel_aware);
5486
0
  WRITE_BOOL_FIELD(join.plan.parallel_safe);
5487
0
  WRITE_BOOL_FIELD(join.plan.async_capable);
5488
0
  WRITE_INT_FIELD(join.plan.plan_node_id);
5489
0
  WRITE_NODE_FIELD(join.plan.targetlist);
5490
0
  WRITE_NODE_FIELD(join.plan.qual);
5491
0
  WRITE_NODE_FIELD(join.plan.lefttree);
5492
0
  WRITE_NODE_FIELD(join.plan.righttree);
5493
0
  WRITE_NODE_FIELD(join.plan.initPlan);
5494
0
  WRITE_BITMAPSET_FIELD(join.plan.extParam);
5495
0
  WRITE_BITMAPSET_FIELD(join.plan.allParam);
5496
0
  WRITE_ENUM_FIELD(join.jointype, JoinType);
5497
0
  WRITE_BOOL_FIELD(join.inner_unique);
5498
0
  WRITE_NODE_FIELD(join.joinqual);
5499
0
  WRITE_NODE_FIELD(nestParams);
5500
0
}
5501
5502
static void
5503
_outNestLoopParam(StringInfo str, const NestLoopParam *node)
5504
0
{
5505
0
  WRITE_NODE_TYPE("NESTLOOPPARAM");
5506
5507
0
  WRITE_INT_FIELD(paramno);
5508
0
  WRITE_NODE_FIELD(paramval);
5509
0
}
5510
5511
static void
5512
_outMergeJoin(StringInfo str, const MergeJoin *node)
5513
0
{
5514
0
  WRITE_NODE_TYPE("MERGEJOIN");
5515
5516
0
  WRITE_INT_FIELD(join.plan.disabled_nodes);
5517
0
  WRITE_FLOAT_FIELD(join.plan.startup_cost);
5518
0
  WRITE_FLOAT_FIELD(join.plan.total_cost);
5519
0
  WRITE_FLOAT_FIELD(join.plan.plan_rows);
5520
0
  WRITE_INT_FIELD(join.plan.plan_width);
5521
0
  WRITE_BOOL_FIELD(join.plan.parallel_aware);
5522
0
  WRITE_BOOL_FIELD(join.plan.parallel_safe);
5523
0
  WRITE_BOOL_FIELD(join.plan.async_capable);
5524
0
  WRITE_INT_FIELD(join.plan.plan_node_id);
5525
0
  WRITE_NODE_FIELD(join.plan.targetlist);
5526
0
  WRITE_NODE_FIELD(join.plan.qual);
5527
0
  WRITE_NODE_FIELD(join.plan.lefttree);
5528
0
  WRITE_NODE_FIELD(join.plan.righttree);
5529
0
  WRITE_NODE_FIELD(join.plan.initPlan);
5530
0
  WRITE_BITMAPSET_FIELD(join.plan.extParam);
5531
0
  WRITE_BITMAPSET_FIELD(join.plan.allParam);
5532
0
  WRITE_ENUM_FIELD(join.jointype, JoinType);
5533
0
  WRITE_BOOL_FIELD(join.inner_unique);
5534
0
  WRITE_NODE_FIELD(join.joinqual);
5535
0
  WRITE_BOOL_FIELD(skip_mark_restore);
5536
0
  WRITE_NODE_FIELD(mergeclauses);
5537
0
  WRITE_OID_ARRAY(mergeFamilies, list_length(node->mergeclauses));
5538
0
  WRITE_OID_ARRAY(mergeCollations, list_length(node->mergeclauses));
5539
0
  WRITE_BOOL_ARRAY(mergeReversals, list_length(node->mergeclauses));
5540
0
  WRITE_BOOL_ARRAY(mergeNullsFirst, list_length(node->mergeclauses));
5541
0
}
5542
5543
static void
5544
_outHashJoin(StringInfo str, const HashJoin *node)
5545
0
{
5546
0
  WRITE_NODE_TYPE("HASHJOIN");
5547
5548
0
  WRITE_INT_FIELD(join.plan.disabled_nodes);
5549
0
  WRITE_FLOAT_FIELD(join.plan.startup_cost);
5550
0
  WRITE_FLOAT_FIELD(join.plan.total_cost);
5551
0
  WRITE_FLOAT_FIELD(join.plan.plan_rows);
5552
0
  WRITE_INT_FIELD(join.plan.plan_width);
5553
0
  WRITE_BOOL_FIELD(join.plan.parallel_aware);
5554
0
  WRITE_BOOL_FIELD(join.plan.parallel_safe);
5555
0
  WRITE_BOOL_FIELD(join.plan.async_capable);
5556
0
  WRITE_INT_FIELD(join.plan.plan_node_id);
5557
0
  WRITE_NODE_FIELD(join.plan.targetlist);
5558
0
  WRITE_NODE_FIELD(join.plan.qual);
5559
0
  WRITE_NODE_FIELD(join.plan.lefttree);
5560
0
  WRITE_NODE_FIELD(join.plan.righttree);
5561
0
  WRITE_NODE_FIELD(join.plan.initPlan);
5562
0
  WRITE_BITMAPSET_FIELD(join.plan.extParam);
5563
0
  WRITE_BITMAPSET_FIELD(join.plan.allParam);
5564
0
  WRITE_ENUM_FIELD(join.jointype, JoinType);
5565
0
  WRITE_BOOL_FIELD(join.inner_unique);
5566
0
  WRITE_NODE_FIELD(join.joinqual);
5567
0
  WRITE_NODE_FIELD(hashclauses);
5568
0
  WRITE_NODE_FIELD(hashoperators);
5569
0
  WRITE_NODE_FIELD(hashcollations);
5570
0
  WRITE_NODE_FIELD(hashkeys);
5571
0
}
5572
5573
static void
5574
_outMaterial(StringInfo str, const Material *node)
5575
0
{
5576
0
  WRITE_NODE_TYPE("MATERIAL");
5577
5578
0
  WRITE_INT_FIELD(plan.disabled_nodes);
5579
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
5580
0
  WRITE_FLOAT_FIELD(plan.total_cost);
5581
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
5582
0
  WRITE_INT_FIELD(plan.plan_width);
5583
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
5584
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
5585
0
  WRITE_BOOL_FIELD(plan.async_capable);
5586
0
  WRITE_INT_FIELD(plan.plan_node_id);
5587
0
  WRITE_NODE_FIELD(plan.targetlist);
5588
0
  WRITE_NODE_FIELD(plan.qual);
5589
0
  WRITE_NODE_FIELD(plan.lefttree);
5590
0
  WRITE_NODE_FIELD(plan.righttree);
5591
0
  WRITE_NODE_FIELD(plan.initPlan);
5592
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
5593
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
5594
0
}
5595
5596
static void
5597
_outMemoize(StringInfo str, const Memoize *node)
5598
0
{
5599
0
  WRITE_NODE_TYPE("MEMOIZE");
5600
5601
0
  WRITE_INT_FIELD(plan.disabled_nodes);
5602
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
5603
0
  WRITE_FLOAT_FIELD(plan.total_cost);
5604
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
5605
0
  WRITE_INT_FIELD(plan.plan_width);
5606
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
5607
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
5608
0
  WRITE_BOOL_FIELD(plan.async_capable);
5609
0
  WRITE_INT_FIELD(plan.plan_node_id);
5610
0
  WRITE_NODE_FIELD(plan.targetlist);
5611
0
  WRITE_NODE_FIELD(plan.qual);
5612
0
  WRITE_NODE_FIELD(plan.lefttree);
5613
0
  WRITE_NODE_FIELD(plan.righttree);
5614
0
  WRITE_NODE_FIELD(plan.initPlan);
5615
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
5616
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
5617
0
  WRITE_INT_FIELD(numKeys);
5618
0
  WRITE_OID_ARRAY(hashOperators, node->numKeys);
5619
0
  WRITE_OID_ARRAY(collations, node->numKeys);
5620
0
  WRITE_NODE_FIELD(param_exprs);
5621
0
  WRITE_BOOL_FIELD(singlerow);
5622
0
  WRITE_BOOL_FIELD(binary_mode);
5623
0
  WRITE_UINT_FIELD(est_entries);
5624
0
  WRITE_BITMAPSET_FIELD(keyparamids);
5625
0
  WRITE_FLOAT_FIELD(est_calls);
5626
0
  WRITE_FLOAT_FIELD(est_unique_keys);
5627
0
  WRITE_FLOAT_FIELD(est_hit_ratio);
5628
0
}
5629
5630
static void
5631
_outSort(StringInfo str, const Sort *node)
5632
0
{
5633
0
  WRITE_NODE_TYPE("SORT");
5634
5635
0
  WRITE_INT_FIELD(plan.disabled_nodes);
5636
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
5637
0
  WRITE_FLOAT_FIELD(plan.total_cost);
5638
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
5639
0
  WRITE_INT_FIELD(plan.plan_width);
5640
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
5641
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
5642
0
  WRITE_BOOL_FIELD(plan.async_capable);
5643
0
  WRITE_INT_FIELD(plan.plan_node_id);
5644
0
  WRITE_NODE_FIELD(plan.targetlist);
5645
0
  WRITE_NODE_FIELD(plan.qual);
5646
0
  WRITE_NODE_FIELD(plan.lefttree);
5647
0
  WRITE_NODE_FIELD(plan.righttree);
5648
0
  WRITE_NODE_FIELD(plan.initPlan);
5649
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
5650
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
5651
0
  WRITE_INT_FIELD(numCols);
5652
0
  WRITE_ATTRNUMBER_ARRAY(sortColIdx, node->numCols);
5653
0
  WRITE_OID_ARRAY(sortOperators, node->numCols);
5654
0
  WRITE_OID_ARRAY(collations, node->numCols);
5655
0
  WRITE_BOOL_ARRAY(nullsFirst, node->numCols);
5656
0
}
5657
5658
static void
5659
_outIncrementalSort(StringInfo str, const IncrementalSort *node)
5660
0
{
5661
0
  WRITE_NODE_TYPE("INCREMENTALSORT");
5662
5663
0
  WRITE_INT_FIELD(sort.plan.disabled_nodes);
5664
0
  WRITE_FLOAT_FIELD(sort.plan.startup_cost);
5665
0
  WRITE_FLOAT_FIELD(sort.plan.total_cost);
5666
0
  WRITE_FLOAT_FIELD(sort.plan.plan_rows);
5667
0
  WRITE_INT_FIELD(sort.plan.plan_width);
5668
0
  WRITE_BOOL_FIELD(sort.plan.parallel_aware);
5669
0
  WRITE_BOOL_FIELD(sort.plan.parallel_safe);
5670
0
  WRITE_BOOL_FIELD(sort.plan.async_capable);
5671
0
  WRITE_INT_FIELD(sort.plan.plan_node_id);
5672
0
  WRITE_NODE_FIELD(sort.plan.targetlist);
5673
0
  WRITE_NODE_FIELD(sort.plan.qual);
5674
0
  WRITE_NODE_FIELD(sort.plan.lefttree);
5675
0
  WRITE_NODE_FIELD(sort.plan.righttree);
5676
0
  WRITE_NODE_FIELD(sort.plan.initPlan);
5677
0
  WRITE_BITMAPSET_FIELD(sort.plan.extParam);
5678
0
  WRITE_BITMAPSET_FIELD(sort.plan.allParam);
5679
0
  WRITE_INT_FIELD(sort.numCols);
5680
0
  WRITE_ATTRNUMBER_ARRAY(sort.sortColIdx, node->sort.numCols);
5681
0
  WRITE_OID_ARRAY(sort.sortOperators, node->sort.numCols);
5682
0
  WRITE_OID_ARRAY(sort.collations, node->sort.numCols);
5683
0
  WRITE_BOOL_ARRAY(sort.nullsFirst, node->sort.numCols);
5684
0
  WRITE_INT_FIELD(nPresortedCols);
5685
0
}
5686
5687
static void
5688
_outGroup(StringInfo str, const Group *node)
5689
0
{
5690
0
  WRITE_NODE_TYPE("GROUP");
5691
5692
0
  WRITE_INT_FIELD(plan.disabled_nodes);
5693
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
5694
0
  WRITE_FLOAT_FIELD(plan.total_cost);
5695
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
5696
0
  WRITE_INT_FIELD(plan.plan_width);
5697
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
5698
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
5699
0
  WRITE_BOOL_FIELD(plan.async_capable);
5700
0
  WRITE_INT_FIELD(plan.plan_node_id);
5701
0
  WRITE_NODE_FIELD(plan.targetlist);
5702
0
  WRITE_NODE_FIELD(plan.qual);
5703
0
  WRITE_NODE_FIELD(plan.lefttree);
5704
0
  WRITE_NODE_FIELD(plan.righttree);
5705
0
  WRITE_NODE_FIELD(plan.initPlan);
5706
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
5707
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
5708
0
  WRITE_INT_FIELD(numCols);
5709
0
  WRITE_ATTRNUMBER_ARRAY(grpColIdx, node->numCols);
5710
0
  WRITE_OID_ARRAY(grpOperators, node->numCols);
5711
0
  WRITE_OID_ARRAY(grpCollations, node->numCols);
5712
0
}
5713
5714
static void
5715
_outAgg(StringInfo str, const Agg *node)
5716
0
{
5717
0
  WRITE_NODE_TYPE("AGG");
5718
5719
0
  WRITE_INT_FIELD(plan.disabled_nodes);
5720
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
5721
0
  WRITE_FLOAT_FIELD(plan.total_cost);
5722
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
5723
0
  WRITE_INT_FIELD(plan.plan_width);
5724
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
5725
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
5726
0
  WRITE_BOOL_FIELD(plan.async_capable);
5727
0
  WRITE_INT_FIELD(plan.plan_node_id);
5728
0
  WRITE_NODE_FIELD(plan.targetlist);
5729
0
  WRITE_NODE_FIELD(plan.qual);
5730
0
  WRITE_NODE_FIELD(plan.lefttree);
5731
0
  WRITE_NODE_FIELD(plan.righttree);
5732
0
  WRITE_NODE_FIELD(plan.initPlan);
5733
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
5734
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
5735
0
  WRITE_ENUM_FIELD(aggstrategy, AggStrategy);
5736
0
  WRITE_ENUM_FIELD(aggsplit, AggSplit);
5737
0
  WRITE_INT_FIELD(numCols);
5738
0
  WRITE_ATTRNUMBER_ARRAY(grpColIdx, node->numCols);
5739
0
  WRITE_OID_ARRAY(grpOperators, node->numCols);
5740
0
  WRITE_OID_ARRAY(grpCollations, node->numCols);
5741
0
  WRITE_LONG_FIELD(numGroups);
5742
0
  WRITE_UINT64_FIELD(transitionSpace);
5743
0
  WRITE_BITMAPSET_FIELD(aggParams);
5744
0
  WRITE_NODE_FIELD(groupingSets);
5745
0
  WRITE_NODE_FIELD(chain);
5746
0
}
5747
5748
static void
5749
_outWindowAgg(StringInfo str, const WindowAgg *node)
5750
0
{
5751
0
  WRITE_NODE_TYPE("WINDOWAGG");
5752
5753
0
  WRITE_INT_FIELD(plan.disabled_nodes);
5754
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
5755
0
  WRITE_FLOAT_FIELD(plan.total_cost);
5756
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
5757
0
  WRITE_INT_FIELD(plan.plan_width);
5758
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
5759
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
5760
0
  WRITE_BOOL_FIELD(plan.async_capable);
5761
0
  WRITE_INT_FIELD(plan.plan_node_id);
5762
0
  WRITE_NODE_FIELD(plan.targetlist);
5763
0
  WRITE_NODE_FIELD(plan.qual);
5764
0
  WRITE_NODE_FIELD(plan.lefttree);
5765
0
  WRITE_NODE_FIELD(plan.righttree);
5766
0
  WRITE_NODE_FIELD(plan.initPlan);
5767
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
5768
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
5769
0
  WRITE_STRING_FIELD(winname);
5770
0
  WRITE_UINT_FIELD(winref);
5771
0
  WRITE_INT_FIELD(partNumCols);
5772
0
  WRITE_ATTRNUMBER_ARRAY(partColIdx, node->partNumCols);
5773
0
  WRITE_OID_ARRAY(partOperators, node->partNumCols);
5774
0
  WRITE_OID_ARRAY(partCollations, node->partNumCols);
5775
0
  WRITE_INT_FIELD(ordNumCols);
5776
0
  WRITE_ATTRNUMBER_ARRAY(ordColIdx, node->ordNumCols);
5777
0
  WRITE_OID_ARRAY(ordOperators, node->ordNumCols);
5778
0
  WRITE_OID_ARRAY(ordCollations, node->ordNumCols);
5779
0
  WRITE_INT_FIELD(frameOptions);
5780
0
  WRITE_NODE_FIELD(startOffset);
5781
0
  WRITE_NODE_FIELD(endOffset);
5782
0
  WRITE_NODE_FIELD(runCondition);
5783
0
  WRITE_NODE_FIELD(runConditionOrig);
5784
0
  WRITE_OID_FIELD(startInRangeFunc);
5785
0
  WRITE_OID_FIELD(endInRangeFunc);
5786
0
  WRITE_OID_FIELD(inRangeColl);
5787
0
  WRITE_BOOL_FIELD(inRangeAsc);
5788
0
  WRITE_BOOL_FIELD(inRangeNullsFirst);
5789
0
  WRITE_BOOL_FIELD(topWindow);
5790
0
}
5791
5792
static void
5793
_outUnique(StringInfo str, const Unique *node)
5794
0
{
5795
0
  WRITE_NODE_TYPE("UNIQUE");
5796
5797
0
  WRITE_INT_FIELD(plan.disabled_nodes);
5798
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
5799
0
  WRITE_FLOAT_FIELD(plan.total_cost);
5800
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
5801
0
  WRITE_INT_FIELD(plan.plan_width);
5802
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
5803
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
5804
0
  WRITE_BOOL_FIELD(plan.async_capable);
5805
0
  WRITE_INT_FIELD(plan.plan_node_id);
5806
0
  WRITE_NODE_FIELD(plan.targetlist);
5807
0
  WRITE_NODE_FIELD(plan.qual);
5808
0
  WRITE_NODE_FIELD(plan.lefttree);
5809
0
  WRITE_NODE_FIELD(plan.righttree);
5810
0
  WRITE_NODE_FIELD(plan.initPlan);
5811
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
5812
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
5813
0
  WRITE_INT_FIELD(numCols);
5814
0
  WRITE_ATTRNUMBER_ARRAY(uniqColIdx, node->numCols);
5815
0
  WRITE_OID_ARRAY(uniqOperators, node->numCols);
5816
0
  WRITE_OID_ARRAY(uniqCollations, node->numCols);
5817
0
}
5818
5819
static void
5820
_outGather(StringInfo str, const Gather *node)
5821
0
{
5822
0
  WRITE_NODE_TYPE("GATHER");
5823
5824
0
  WRITE_INT_FIELD(plan.disabled_nodes);
5825
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
5826
0
  WRITE_FLOAT_FIELD(plan.total_cost);
5827
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
5828
0
  WRITE_INT_FIELD(plan.plan_width);
5829
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
5830
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
5831
0
  WRITE_BOOL_FIELD(plan.async_capable);
5832
0
  WRITE_INT_FIELD(plan.plan_node_id);
5833
0
  WRITE_NODE_FIELD(plan.targetlist);
5834
0
  WRITE_NODE_FIELD(plan.qual);
5835
0
  WRITE_NODE_FIELD(plan.lefttree);
5836
0
  WRITE_NODE_FIELD(plan.righttree);
5837
0
  WRITE_NODE_FIELD(plan.initPlan);
5838
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
5839
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
5840
0
  WRITE_INT_FIELD(num_workers);
5841
0
  WRITE_INT_FIELD(rescan_param);
5842
0
  WRITE_BOOL_FIELD(single_copy);
5843
0
  WRITE_BOOL_FIELD(invisible);
5844
0
  WRITE_BITMAPSET_FIELD(initParam);
5845
0
}
5846
5847
static void
5848
_outGatherMerge(StringInfo str, const GatherMerge *node)
5849
0
{
5850
0
  WRITE_NODE_TYPE("GATHERMERGE");
5851
5852
0
  WRITE_INT_FIELD(plan.disabled_nodes);
5853
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
5854
0
  WRITE_FLOAT_FIELD(plan.total_cost);
5855
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
5856
0
  WRITE_INT_FIELD(plan.plan_width);
5857
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
5858
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
5859
0
  WRITE_BOOL_FIELD(plan.async_capable);
5860
0
  WRITE_INT_FIELD(plan.plan_node_id);
5861
0
  WRITE_NODE_FIELD(plan.targetlist);
5862
0
  WRITE_NODE_FIELD(plan.qual);
5863
0
  WRITE_NODE_FIELD(plan.lefttree);
5864
0
  WRITE_NODE_FIELD(plan.righttree);
5865
0
  WRITE_NODE_FIELD(plan.initPlan);
5866
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
5867
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
5868
0
  WRITE_INT_FIELD(num_workers);
5869
0
  WRITE_INT_FIELD(rescan_param);
5870
0
  WRITE_INT_FIELD(numCols);
5871
0
  WRITE_ATTRNUMBER_ARRAY(sortColIdx, node->numCols);
5872
0
  WRITE_OID_ARRAY(sortOperators, node->numCols);
5873
0
  WRITE_OID_ARRAY(collations, node->numCols);
5874
0
  WRITE_BOOL_ARRAY(nullsFirst, node->numCols);
5875
0
  WRITE_BITMAPSET_FIELD(initParam);
5876
0
}
5877
5878
static void
5879
_outHash(StringInfo str, const Hash *node)
5880
0
{
5881
0
  WRITE_NODE_TYPE("HASH");
5882
5883
0
  WRITE_INT_FIELD(plan.disabled_nodes);
5884
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
5885
0
  WRITE_FLOAT_FIELD(plan.total_cost);
5886
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
5887
0
  WRITE_INT_FIELD(plan.plan_width);
5888
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
5889
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
5890
0
  WRITE_BOOL_FIELD(plan.async_capable);
5891
0
  WRITE_INT_FIELD(plan.plan_node_id);
5892
0
  WRITE_NODE_FIELD(plan.targetlist);
5893
0
  WRITE_NODE_FIELD(plan.qual);
5894
0
  WRITE_NODE_FIELD(plan.lefttree);
5895
0
  WRITE_NODE_FIELD(plan.righttree);
5896
0
  WRITE_NODE_FIELD(plan.initPlan);
5897
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
5898
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
5899
0
  WRITE_NODE_FIELD(hashkeys);
5900
0
  WRITE_OID_FIELD(skewTable);
5901
0
  WRITE_INT_FIELD(skewColumn);
5902
0
  WRITE_BOOL_FIELD(skewInherit);
5903
0
  WRITE_FLOAT_FIELD(rows_total);
5904
0
}
5905
5906
static void
5907
_outSetOp(StringInfo str, const SetOp *node)
5908
0
{
5909
0
  WRITE_NODE_TYPE("SETOP");
5910
5911
0
  WRITE_INT_FIELD(plan.disabled_nodes);
5912
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
5913
0
  WRITE_FLOAT_FIELD(plan.total_cost);
5914
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
5915
0
  WRITE_INT_FIELD(plan.plan_width);
5916
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
5917
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
5918
0
  WRITE_BOOL_FIELD(plan.async_capable);
5919
0
  WRITE_INT_FIELD(plan.plan_node_id);
5920
0
  WRITE_NODE_FIELD(plan.targetlist);
5921
0
  WRITE_NODE_FIELD(plan.qual);
5922
0
  WRITE_NODE_FIELD(plan.lefttree);
5923
0
  WRITE_NODE_FIELD(plan.righttree);
5924
0
  WRITE_NODE_FIELD(plan.initPlan);
5925
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
5926
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
5927
0
  WRITE_ENUM_FIELD(cmd, SetOpCmd);
5928
0
  WRITE_ENUM_FIELD(strategy, SetOpStrategy);
5929
0
  WRITE_INT_FIELD(numCols);
5930
0
  WRITE_ATTRNUMBER_ARRAY(cmpColIdx, node->numCols);
5931
0
  WRITE_OID_ARRAY(cmpOperators, node->numCols);
5932
0
  WRITE_OID_ARRAY(cmpCollations, node->numCols);
5933
0
  WRITE_BOOL_ARRAY(cmpNullsFirst, node->numCols);
5934
0
  WRITE_LONG_FIELD(numGroups);
5935
0
}
5936
5937
static void
5938
_outLockRows(StringInfo str, const LockRows *node)
5939
0
{
5940
0
  WRITE_NODE_TYPE("LOCKROWS");
5941
5942
0
  WRITE_INT_FIELD(plan.disabled_nodes);
5943
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
5944
0
  WRITE_FLOAT_FIELD(plan.total_cost);
5945
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
5946
0
  WRITE_INT_FIELD(plan.plan_width);
5947
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
5948
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
5949
0
  WRITE_BOOL_FIELD(plan.async_capable);
5950
0
  WRITE_INT_FIELD(plan.plan_node_id);
5951
0
  WRITE_NODE_FIELD(plan.targetlist);
5952
0
  WRITE_NODE_FIELD(plan.qual);
5953
0
  WRITE_NODE_FIELD(plan.lefttree);
5954
0
  WRITE_NODE_FIELD(plan.righttree);
5955
0
  WRITE_NODE_FIELD(plan.initPlan);
5956
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
5957
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
5958
0
  WRITE_NODE_FIELD(rowMarks);
5959
0
  WRITE_INT_FIELD(epqParam);
5960
0
}
5961
5962
static void
5963
_outLimit(StringInfo str, const Limit *node)
5964
0
{
5965
0
  WRITE_NODE_TYPE("LIMIT");
5966
5967
0
  WRITE_INT_FIELD(plan.disabled_nodes);
5968
0
  WRITE_FLOAT_FIELD(plan.startup_cost);
5969
0
  WRITE_FLOAT_FIELD(plan.total_cost);
5970
0
  WRITE_FLOAT_FIELD(plan.plan_rows);
5971
0
  WRITE_INT_FIELD(plan.plan_width);
5972
0
  WRITE_BOOL_FIELD(plan.parallel_aware);
5973
0
  WRITE_BOOL_FIELD(plan.parallel_safe);
5974
0
  WRITE_BOOL_FIELD(plan.async_capable);
5975
0
  WRITE_INT_FIELD(plan.plan_node_id);
5976
0
  WRITE_NODE_FIELD(plan.targetlist);
5977
0
  WRITE_NODE_FIELD(plan.qual);
5978
0
  WRITE_NODE_FIELD(plan.lefttree);
5979
0
  WRITE_NODE_FIELD(plan.righttree);
5980
0
  WRITE_NODE_FIELD(plan.initPlan);
5981
0
  WRITE_BITMAPSET_FIELD(plan.extParam);
5982
0
  WRITE_BITMAPSET_FIELD(plan.allParam);
5983
0
  WRITE_NODE_FIELD(limitOffset);
5984
0
  WRITE_NODE_FIELD(limitCount);
5985
0
  WRITE_ENUM_FIELD(limitOption, LimitOption);
5986
0
  WRITE_INT_FIELD(uniqNumCols);
5987
0
  WRITE_ATTRNUMBER_ARRAY(uniqColIdx, node->uniqNumCols);
5988
0
  WRITE_OID_ARRAY(uniqOperators, node->uniqNumCols);
5989
0
  WRITE_OID_ARRAY(uniqCollations, node->uniqNumCols);
5990
0
}
5991
5992
static void
5993
_outPlanRowMark(StringInfo str, const PlanRowMark *node)
5994
0
{
5995
0
  WRITE_NODE_TYPE("PLANROWMARK");
5996
5997
0
  WRITE_UINT_FIELD(rti);
5998
0
  WRITE_UINT_FIELD(prti);
5999
0
  WRITE_UINT_FIELD(rowmarkId);
6000
0
  WRITE_ENUM_FIELD(markType, RowMarkType);
6001
0
  WRITE_INT_FIELD(allMarkTypes);
6002
0
  WRITE_ENUM_FIELD(strength, LockClauseStrength);
6003
0
  WRITE_ENUM_FIELD(waitPolicy, LockWaitPolicy);
6004
0
  WRITE_BOOL_FIELD(isParent);
6005
0
}
6006
6007
static void
6008
_outPartitionPruneInfo(StringInfo str, const PartitionPruneInfo *node)
6009
0
{
6010
0
  WRITE_NODE_TYPE("PARTITIONPRUNEINFO");
6011
6012
0
  WRITE_BITMAPSET_FIELD(relids);
6013
0
  WRITE_NODE_FIELD(prune_infos);
6014
0
  WRITE_BITMAPSET_FIELD(other_subplans);
6015
0
}
6016
6017
static void
6018
_outPartitionedRelPruneInfo(StringInfo str, const PartitionedRelPruneInfo *node)
6019
0
{
6020
0
  WRITE_NODE_TYPE("PARTITIONEDRELPRUNEINFO");
6021
6022
0
  WRITE_UINT_FIELD(rtindex);
6023
0
  WRITE_BITMAPSET_FIELD(present_parts);
6024
0
  WRITE_INT_FIELD(nparts);
6025
0
  WRITE_INT_ARRAY(subplan_map, node->nparts);
6026
0
  WRITE_INT_ARRAY(subpart_map, node->nparts);
6027
0
  WRITE_INT_ARRAY(leafpart_rti_map, node->nparts);
6028
0
  WRITE_OID_ARRAY(relid_map, node->nparts);
6029
0
  WRITE_NODE_FIELD(initial_pruning_steps);
6030
0
  WRITE_NODE_FIELD(exec_pruning_steps);
6031
0
  WRITE_BITMAPSET_FIELD(execparamids);
6032
0
}
6033
6034
static void
6035
_outPartitionPruneStepOp(StringInfo str, const PartitionPruneStepOp *node)
6036
0
{
6037
0
  WRITE_NODE_TYPE("PARTITIONPRUNESTEPOP");
6038
6039
0
  WRITE_INT_FIELD(step.step_id);
6040
0
  WRITE_INT_FIELD(opstrategy);
6041
0
  WRITE_NODE_FIELD(exprs);
6042
0
  WRITE_NODE_FIELD(cmpfns);
6043
0
  WRITE_BITMAPSET_FIELD(nullkeys);
6044
0
}
6045
6046
static void
6047
_outPartitionPruneStepCombine(StringInfo str, const PartitionPruneStepCombine *node)
6048
0
{
6049
0
  WRITE_NODE_TYPE("PARTITIONPRUNESTEPCOMBINE");
6050
6051
0
  WRITE_INT_FIELD(step.step_id);
6052
0
  WRITE_ENUM_FIELD(combineOp, PartitionPruneCombineOp);
6053
0
  WRITE_NODE_FIELD(source_stepids);
6054
0
}
6055
6056
static void
6057
_outPlanInvalItem(StringInfo str, const PlanInvalItem *node)
6058
0
{
6059
0
  WRITE_NODE_TYPE("PLANINVALITEM");
6060
6061
0
  WRITE_INT_FIELD(cacheId);
6062
0
  WRITE_UINT_FIELD(hashValue);
6063
0
}
6064
6065
static void
6066
_outForeignKeyCacheInfo(StringInfo str, const ForeignKeyCacheInfo *node)
6067
0
{
6068
0
  WRITE_NODE_TYPE("FOREIGNKEYCACHEINFO");
6069
6070
0
  WRITE_OID_FIELD(conoid);
6071
0
  WRITE_OID_FIELD(conrelid);
6072
0
  WRITE_OID_FIELD(confrelid);
6073
0
  WRITE_INT_FIELD(nkeys);
6074
0
  WRITE_BOOL_FIELD(conenforced);
6075
0
  WRITE_ATTRNUMBER_ARRAY(conkey, node->nkeys);
6076
0
  WRITE_ATTRNUMBER_ARRAY(confkey, node->nkeys);
6077
0
  WRITE_OID_ARRAY(conpfeqop, node->nkeys);
6078
0
}