PostgreSQL Source Code  git master
readfuncs.c
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * readfuncs.c
4  * Reader functions for Postgres tree nodes.
5  *
6  * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  *
10  * IDENTIFICATION
11  * src/backend/nodes/readfuncs.c
12  *
13  * NOTES
14  * Path nodes do not have any readfuncs support, because we never
15  * have occasion to read them in. (There was once code here that
16  * claimed to read them, but it was broken as well as unused.) We
17  * never read executor state trees, either.
18  *
19  * Parse location fields are written out by outfuncs.c, but only for
20  * possible debugging use. When reading a location field, we discard
21  * the stored value and set the location field to -1 (ie, "unknown").
22  * This is because nodes coming from a stored rule should not be thought
23  * to have a known location in the current query's text.
24  *
25  *-------------------------------------------------------------------------
26  */
27 #include "postgres.h"
28 
29 #include <math.h>
30 
31 #include "fmgr.h"
32 #include "nodes/extensible.h"
33 #include "nodes/parsenodes.h"
34 #include "nodes/plannodes.h"
35 #include "nodes/readfuncs.h"
36 #include "utils/builtins.h"
37 
38 
39 /*
40  * Macros to simplify reading of different kinds of fields. Use these
41  * wherever possible to reduce the chance for silly typos. Note that these
42  * hard-wire conventions about the names of the local variables in a Read
43  * routine.
44  */
45 
46 /* Macros for declaring appropriate local variables */
47 
48 /* A few guys need only local_node */
49 #define READ_LOCALS_NO_FIELDS(nodeTypeName) \
50  nodeTypeName *local_node = makeNode(nodeTypeName)
51 
52 /* And a few guys need only the pg_strtok support fields */
53 #define READ_TEMP_LOCALS() \
54  char *token; \
55  int length
56 
57 /* ... but most need both */
58 #define READ_LOCALS(nodeTypeName) \
59  READ_LOCALS_NO_FIELDS(nodeTypeName); \
60  READ_TEMP_LOCALS()
61 
62 /* Read an integer field (anything written as ":fldname %d") */
63 #define READ_INT_FIELD(fldname) \
64  token = pg_strtok(&length); /* skip :fldname */ \
65  token = pg_strtok(&length); /* get field value */ \
66  local_node->fldname = atoi(token)
67 
68 /* Read an unsigned integer field (anything written as ":fldname %u") */
69 #define READ_UINT_FIELD(fldname) \
70  token = pg_strtok(&length); /* skip :fldname */ \
71  token = pg_strtok(&length); /* get field value */ \
72  local_node->fldname = atoui(token)
73 
74 /* Read an unsigned integer field (anything written using UINT64_FORMAT) */
75 #define READ_UINT64_FIELD(fldname) \
76  token = pg_strtok(&length); /* skip :fldname */ \
77  token = pg_strtok(&length); /* get field value */ \
78  local_node->fldname = pg_strtouint64(token, NULL, 10)
79 
80 /* Read a long integer field (anything written as ":fldname %ld") */
81 #define READ_LONG_FIELD(fldname) \
82  token = pg_strtok(&length); /* skip :fldname */ \
83  token = pg_strtok(&length); /* get field value */ \
84  local_node->fldname = atol(token)
85 
86 /* Read an OID field (don't hard-wire assumption that OID is same as uint) */
87 #define READ_OID_FIELD(fldname) \
88  token = pg_strtok(&length); /* skip :fldname */ \
89  token = pg_strtok(&length); /* get field value */ \
90  local_node->fldname = atooid(token)
91 
92 /* Read a char field (ie, one ascii character) */
93 #define READ_CHAR_FIELD(fldname) \
94  token = pg_strtok(&length); /* skip :fldname */ \
95  token = pg_strtok(&length); /* get field value */ \
96  /* avoid overhead of calling debackslash() for one char */ \
97  local_node->fldname = (length == 0) ? '\0' : (token[0] == '\\' ? token[1] : token[0])
98 
99 /* Read an enumerated-type field that was written as an integer code */
100 #define READ_ENUM_FIELD(fldname, enumtype) \
101  token = pg_strtok(&length); /* skip :fldname */ \
102  token = pg_strtok(&length); /* get field value */ \
103  local_node->fldname = (enumtype) atoi(token)
104 
105 /* Read a float field */
106 #define READ_FLOAT_FIELD(fldname) \
107  token = pg_strtok(&length); /* skip :fldname */ \
108  token = pg_strtok(&length); /* get field value */ \
109  local_node->fldname = atof(token)
110 
111 /* Read a boolean field */
112 #define READ_BOOL_FIELD(fldname) \
113  token = pg_strtok(&length); /* skip :fldname */ \
114  token = pg_strtok(&length); /* get field value */ \
115  local_node->fldname = strtobool(token)
116 
117 /* Read a character-string field */
118 #define READ_STRING_FIELD(fldname) \
119  token = pg_strtok(&length); /* skip :fldname */ \
120  token = pg_strtok(&length); /* get field value */ \
121  local_node->fldname = nullable_string(token, length)
122 
123 /* Read a parse location field (and throw away the value, per notes above) */
124 #define READ_LOCATION_FIELD(fldname) \
125  token = pg_strtok(&length); /* skip :fldname */ \
126  token = pg_strtok(&length); /* get field value */ \
127  (void) token; /* in case not used elsewhere */ \
128  local_node->fldname = -1 /* set field to "unknown" */
129 
130 /* Read a Node field */
131 #define READ_NODE_FIELD(fldname) \
132  token = pg_strtok(&length); /* skip :fldname */ \
133  (void) token; /* in case not used elsewhere */ \
134  local_node->fldname = nodeRead(NULL, 0)
135 
136 /* Read a bitmapset field */
137 #define READ_BITMAPSET_FIELD(fldname) \
138  token = pg_strtok(&length); /* skip :fldname */ \
139  (void) token; /* in case not used elsewhere */ \
140  local_node->fldname = _readBitmapset()
141 
142 /* Read an attribute number array */
143 #define READ_ATTRNUMBER_ARRAY(fldname, len) \
144  token = pg_strtok(&length); /* skip :fldname */ \
145  local_node->fldname = readAttrNumberCols(len);
146 
147 /* Read an oid array */
148 #define READ_OID_ARRAY(fldname, len) \
149  token = pg_strtok(&length); /* skip :fldname */ \
150  local_node->fldname = readOidCols(len);
151 
152 /* Read an int array */
153 #define READ_INT_ARRAY(fldname, len) \
154  token = pg_strtok(&length); /* skip :fldname */ \
155  local_node->fldname = readIntCols(len);
156 
157 /* Read a bool array */
158 #define READ_BOOL_ARRAY(fldname, len) \
159  token = pg_strtok(&length); /* skip :fldname */ \
160  local_node->fldname = readBoolCols(len);
161 
162 /* Routine exit */
163 #define READ_DONE() \
164  return local_node
165 
166 
167 /*
168  * NOTE: use atoi() to read values written with %d, or atoui() to read
169  * values written with %u in outfuncs.c. An exception is OID values,
170  * for which use atooid(). (As of 7.1, outfuncs.c writes OIDs as %u,
171  * but this will probably change in the future.)
172  */
173 #define atoui(x) ((unsigned int) strtoul((x), NULL, 10))
174 
175 #define strtobool(x) ((*(x) == 't') ? true : false)
176 
177 #define nullable_string(token,length) \
178  ((length) == 0 ? NULL : debackslash(token, length))
179 
180 
181 /*
182  * _readBitmapset
183  */
184 static Bitmapset *
186 {
187  Bitmapset *result = NULL;
188 
190 
191  token = pg_strtok(&length);
192  if (token == NULL)
193  elog(ERROR, "incomplete Bitmapset structure");
194  if (length != 1 || token[0] != '(')
195  elog(ERROR, "unrecognized token: \"%.*s\"", length, token);
196 
197  token = pg_strtok(&length);
198  if (token == NULL)
199  elog(ERROR, "incomplete Bitmapset structure");
200  if (length != 1 || token[0] != 'b')
201  elog(ERROR, "unrecognized token: \"%.*s\"", length, token);
202 
203  for (;;)
204  {
205  int val;
206  char *endptr;
207 
208  token = pg_strtok(&length);
209  if (token == NULL)
210  elog(ERROR, "unterminated Bitmapset structure");
211  if (length == 1 && token[0] == ')')
212  break;
213  val = (int) strtol(token, &endptr, 10);
214  if (endptr != token + length)
215  elog(ERROR, "unrecognized integer: \"%.*s\"", length, token);
216  result = bms_add_member(result, val);
217  }
218 
219  return result;
220 }
221 
222 /*
223  * for use by extensions which define extensible nodes
224  */
225 Bitmapset *
227 {
228  return _readBitmapset();
229 }
230 
231 /*
232  * _readQuery
233  */
234 static Query *
236 {
238 
239  READ_ENUM_FIELD(commandType, CmdType);
240  READ_ENUM_FIELD(querySource, QuerySource);
241  local_node->queryId = UINT64CONST(0); /* not saved in output format */
242  READ_BOOL_FIELD(canSetTag);
243  READ_NODE_FIELD(utilityStmt);
244  READ_INT_FIELD(resultRelation);
245  READ_BOOL_FIELD(hasAggs);
246  READ_BOOL_FIELD(hasWindowFuncs);
247  READ_BOOL_FIELD(hasTargetSRFs);
248  READ_BOOL_FIELD(hasSubLinks);
249  READ_BOOL_FIELD(hasDistinctOn);
250  READ_BOOL_FIELD(hasRecursive);
251  READ_BOOL_FIELD(hasModifyingCTE);
252  READ_BOOL_FIELD(hasForUpdate);
253  READ_BOOL_FIELD(hasRowSecurity);
254  READ_NODE_FIELD(cteList);
255  READ_NODE_FIELD(rtable);
256  READ_NODE_FIELD(jointree);
257  READ_NODE_FIELD(targetList);
258  READ_ENUM_FIELD(override, OverridingKind);
259  READ_NODE_FIELD(onConflict);
260  READ_NODE_FIELD(returningList);
261  READ_NODE_FIELD(groupClause);
262  READ_NODE_FIELD(groupingSets);
263  READ_NODE_FIELD(havingQual);
264  READ_NODE_FIELD(windowClause);
265  READ_NODE_FIELD(distinctClause);
266  READ_NODE_FIELD(sortClause);
267  READ_NODE_FIELD(limitOffset);
268  READ_NODE_FIELD(limitCount);
269  READ_NODE_FIELD(rowMarks);
270  READ_NODE_FIELD(setOperations);
271  READ_NODE_FIELD(constraintDeps);
272  /* withCheckOptions intentionally omitted, see comment in parsenodes.h */
273  READ_LOCATION_FIELD(stmt_location);
274  READ_LOCATION_FIELD(stmt_len);
275 
276  READ_DONE();
277 }
278 
279 /*
280  * _readNotifyStmt
281  */
282 static NotifyStmt *
284 {
286 
287  READ_STRING_FIELD(conditionname);
288  READ_STRING_FIELD(payload);
289 
290  READ_DONE();
291 }
292 
293 /*
294  * _readDeclareCursorStmt
295  */
296 static DeclareCursorStmt *
298 {
300 
301  READ_STRING_FIELD(portalname);
303  READ_NODE_FIELD(query);
304 
305  READ_DONE();
306 }
307 
308 /*
309  * _readWithCheckOption
310  */
311 static WithCheckOption *
313 {
315 
316  READ_ENUM_FIELD(kind, WCOKind);
317  READ_STRING_FIELD(relname);
318  READ_STRING_FIELD(polname);
319  READ_NODE_FIELD(qual);
320  READ_BOOL_FIELD(cascaded);
321 
322  READ_DONE();
323 }
324 
325 /*
326  * _readSortGroupClause
327  */
328 static SortGroupClause *
330 {
332 
333  READ_UINT_FIELD(tleSortGroupRef);
334  READ_OID_FIELD(eqop);
335  READ_OID_FIELD(sortop);
336  READ_BOOL_FIELD(nulls_first);
337  READ_BOOL_FIELD(hashable);
338 
339  READ_DONE();
340 }
341 
342 /*
343  * _readGroupingSet
344  */
345 static GroupingSet *
347 {
349 
351  READ_NODE_FIELD(content);
352  READ_LOCATION_FIELD(location);
353 
354  READ_DONE();
355 }
356 
357 /*
358  * _readWindowClause
359  */
360 static WindowClause *
362 {
364 
366  READ_STRING_FIELD(refname);
367  READ_NODE_FIELD(partitionClause);
368  READ_NODE_FIELD(orderClause);
369  READ_INT_FIELD(frameOptions);
370  READ_NODE_FIELD(startOffset);
371  READ_NODE_FIELD(endOffset);
372  READ_OID_FIELD(startInRangeFunc);
373  READ_OID_FIELD(endInRangeFunc);
374  READ_OID_FIELD(inRangeColl);
375  READ_BOOL_FIELD(inRangeAsc);
376  READ_BOOL_FIELD(inRangeNullsFirst);
377  READ_UINT_FIELD(winref);
378  READ_BOOL_FIELD(copiedOrder);
379 
380  READ_DONE();
381 }
382 
383 /*
384  * _readRowMarkClause
385  */
386 static RowMarkClause *
388 {
390 
391  READ_UINT_FIELD(rti);
393  READ_ENUM_FIELD(waitPolicy, LockWaitPolicy);
394  READ_BOOL_FIELD(pushedDown);
395 
396  READ_DONE();
397 }
398 
399 /*
400  * _readCommonTableExpr
401  */
402 static CommonTableExpr *
404 {
406 
407  READ_STRING_FIELD(ctename);
408  READ_NODE_FIELD(aliascolnames);
409  READ_NODE_FIELD(ctequery);
410  READ_LOCATION_FIELD(location);
411  READ_BOOL_FIELD(cterecursive);
412  READ_INT_FIELD(cterefcount);
413  READ_NODE_FIELD(ctecolnames);
414  READ_NODE_FIELD(ctecoltypes);
415  READ_NODE_FIELD(ctecoltypmods);
416  READ_NODE_FIELD(ctecolcollations);
417 
418  READ_DONE();
419 }
420 
421 /*
422  * _readSetOperationStmt
423  */
424 static SetOperationStmt *
426 {
428 
430  READ_BOOL_FIELD(all);
431  READ_NODE_FIELD(larg);
432  READ_NODE_FIELD(rarg);
433  READ_NODE_FIELD(colTypes);
434  READ_NODE_FIELD(colTypmods);
435  READ_NODE_FIELD(colCollations);
436  READ_NODE_FIELD(groupClauses);
437 
438  READ_DONE();
439 }
440 
441 
442 /*
443  * Stuff from primnodes.h.
444  */
445 
446 static Alias *
448 {
450 
451  READ_STRING_FIELD(aliasname);
452  READ_NODE_FIELD(colnames);
453 
454  READ_DONE();
455 }
456 
457 static RangeVar *
459 {
461 
462  local_node->catalogname = NULL; /* not currently saved in output format */
463 
464  READ_STRING_FIELD(schemaname);
465  READ_STRING_FIELD(relname);
466  READ_BOOL_FIELD(inh);
468  READ_NODE_FIELD(alias);
469  READ_LOCATION_FIELD(location);
470 
471  READ_DONE();
472 }
473 
474 /*
475  * _readTableFunc
476  */
477 static TableFunc *
479 {
481 
482  READ_NODE_FIELD(ns_uris);
483  READ_NODE_FIELD(ns_names);
484  READ_NODE_FIELD(docexpr);
485  READ_NODE_FIELD(rowexpr);
486  READ_NODE_FIELD(colnames);
487  READ_NODE_FIELD(coltypes);
488  READ_NODE_FIELD(coltypmods);
489  READ_NODE_FIELD(colcollations);
490  READ_NODE_FIELD(colexprs);
491  READ_NODE_FIELD(coldefexprs);
492  READ_BITMAPSET_FIELD(notnulls);
493  READ_INT_FIELD(ordinalitycol);
494  READ_LOCATION_FIELD(location);
495 
496  READ_DONE();
497 }
498 
499 static IntoClause *
501 {
503 
504  READ_NODE_FIELD(rel);
505  READ_NODE_FIELD(colNames);
507  READ_ENUM_FIELD(onCommit, OnCommitAction);
508  READ_STRING_FIELD(tableSpaceName);
509  READ_NODE_FIELD(viewQuery);
510  READ_BOOL_FIELD(skipData);
511 
512  READ_DONE();
513 }
514 
515 /*
516  * _readVar
517  */
518 static Var *
519 _readVar(void)
520 {
521  READ_LOCALS(Var);
522 
523  READ_UINT_FIELD(varno);
524  READ_INT_FIELD(varattno);
525  READ_OID_FIELD(vartype);
526  READ_INT_FIELD(vartypmod);
527  READ_OID_FIELD(varcollid);
528  READ_UINT_FIELD(varlevelsup);
529  READ_UINT_FIELD(varnoold);
530  READ_INT_FIELD(varoattno);
531  READ_LOCATION_FIELD(location);
532 
533  READ_DONE();
534 }
535 
536 /*
537  * _readConst
538  */
539 static Const *
541 {
543 
544  READ_OID_FIELD(consttype);
545  READ_INT_FIELD(consttypmod);
546  READ_OID_FIELD(constcollid);
547  READ_INT_FIELD(constlen);
548  READ_BOOL_FIELD(constbyval);
549  READ_BOOL_FIELD(constisnull);
550  READ_LOCATION_FIELD(location);
551 
552  token = pg_strtok(&length); /* skip :constvalue */
553  if (local_node->constisnull)
554  token = pg_strtok(&length); /* skip "<>" */
555  else
556  local_node->constvalue = readDatum(local_node->constbyval);
557 
558  READ_DONE();
559 }
560 
561 /*
562  * _readParam
563  */
564 static Param *
566 {
568 
569  READ_ENUM_FIELD(paramkind, ParamKind);
570  READ_INT_FIELD(paramid);
571  READ_OID_FIELD(paramtype);
572  READ_INT_FIELD(paramtypmod);
573  READ_OID_FIELD(paramcollid);
574  READ_LOCATION_FIELD(location);
575 
576  READ_DONE();
577 }
578 
579 /*
580  * _readAggref
581  */
582 static Aggref *
584 {
586 
587  READ_OID_FIELD(aggfnoid);
588  READ_OID_FIELD(aggtype);
589  READ_OID_FIELD(aggcollid);
590  READ_OID_FIELD(inputcollid);
591  READ_OID_FIELD(aggtranstype);
592  READ_NODE_FIELD(aggargtypes);
593  READ_NODE_FIELD(aggdirectargs);
595  READ_NODE_FIELD(aggorder);
596  READ_NODE_FIELD(aggdistinct);
597  READ_NODE_FIELD(aggfilter);
598  READ_BOOL_FIELD(aggstar);
599  READ_BOOL_FIELD(aggvariadic);
600  READ_CHAR_FIELD(aggkind);
601  READ_UINT_FIELD(agglevelsup);
602  READ_ENUM_FIELD(aggsplit, AggSplit);
603  READ_LOCATION_FIELD(location);
604 
605  READ_DONE();
606 }
607 
608 /*
609  * _readGroupingFunc
610  */
611 static GroupingFunc *
613 {
615 
617  READ_NODE_FIELD(refs);
618  READ_NODE_FIELD(cols);
619  READ_UINT_FIELD(agglevelsup);
620  READ_LOCATION_FIELD(location);
621 
622  READ_DONE();
623 }
624 
625 /*
626  * _readWindowFunc
627  */
628 static WindowFunc *
630 {
632 
633  READ_OID_FIELD(winfnoid);
634  READ_OID_FIELD(wintype);
635  READ_OID_FIELD(wincollid);
636  READ_OID_FIELD(inputcollid);
638  READ_NODE_FIELD(aggfilter);
639  READ_UINT_FIELD(winref);
640  READ_BOOL_FIELD(winstar);
641  READ_BOOL_FIELD(winagg);
642  READ_LOCATION_FIELD(location);
643 
644  READ_DONE();
645 }
646 
647 /*
648  * _readArrayRef
649  */
650 static ArrayRef *
652 {
654 
655  READ_OID_FIELD(refarraytype);
656  READ_OID_FIELD(refelemtype);
657  READ_INT_FIELD(reftypmod);
658  READ_OID_FIELD(refcollid);
659  READ_NODE_FIELD(refupperindexpr);
660  READ_NODE_FIELD(reflowerindexpr);
661  READ_NODE_FIELD(refexpr);
662  READ_NODE_FIELD(refassgnexpr);
663 
664  READ_DONE();
665 }
666 
667 /*
668  * _readFuncExpr
669  */
670 static FuncExpr *
672 {
674 
675  READ_OID_FIELD(funcid);
676  READ_OID_FIELD(funcresulttype);
677  READ_BOOL_FIELD(funcretset);
678  READ_BOOL_FIELD(funcvariadic);
679  READ_ENUM_FIELD(funcformat, CoercionForm);
680  READ_OID_FIELD(funccollid);
681  READ_OID_FIELD(inputcollid);
683  READ_LOCATION_FIELD(location);
684 
685  READ_DONE();
686 }
687 
688 /*
689  * _readNamedArgExpr
690  */
691 static NamedArgExpr *
693 {
695 
698  READ_INT_FIELD(argnumber);
699  READ_LOCATION_FIELD(location);
700 
701  READ_DONE();
702 }
703 
704 /*
705  * _readOpExpr
706  */
707 static OpExpr *
709 {
711 
712  READ_OID_FIELD(opno);
713  READ_OID_FIELD(opfuncid);
714  READ_OID_FIELD(opresulttype);
715  READ_BOOL_FIELD(opretset);
716  READ_OID_FIELD(opcollid);
717  READ_OID_FIELD(inputcollid);
719  READ_LOCATION_FIELD(location);
720 
721  READ_DONE();
722 }
723 
724 /*
725  * _readDistinctExpr
726  */
727 static DistinctExpr *
729 {
731 
732  READ_OID_FIELD(opno);
733  READ_OID_FIELD(opfuncid);
734  READ_OID_FIELD(opresulttype);
735  READ_BOOL_FIELD(opretset);
736  READ_OID_FIELD(opcollid);
737  READ_OID_FIELD(inputcollid);
739  READ_LOCATION_FIELD(location);
740 
741  READ_DONE();
742 }
743 
744 /*
745  * _readNullIfExpr
746  */
747 static NullIfExpr *
749 {
751 
752  READ_OID_FIELD(opno);
753  READ_OID_FIELD(opfuncid);
754  READ_OID_FIELD(opresulttype);
755  READ_BOOL_FIELD(opretset);
756  READ_OID_FIELD(opcollid);
757  READ_OID_FIELD(inputcollid);
759  READ_LOCATION_FIELD(location);
760 
761  READ_DONE();
762 }
763 
764 /*
765  * _readScalarArrayOpExpr
766  */
767 static ScalarArrayOpExpr *
769 {
771 
772  READ_OID_FIELD(opno);
773  READ_OID_FIELD(opfuncid);
774  READ_BOOL_FIELD(useOr);
775  READ_OID_FIELD(inputcollid);
777  READ_LOCATION_FIELD(location);
778 
779  READ_DONE();
780 }
781 
782 /*
783  * _readBoolExpr
784  */
785 static BoolExpr *
787 {
789 
790  /* do-it-yourself enum representation */
791  token = pg_strtok(&length); /* skip :boolop */
792  token = pg_strtok(&length); /* get field value */
793  if (strncmp(token, "and", 3) == 0)
794  local_node->boolop = AND_EXPR;
795  else if (strncmp(token, "or", 2) == 0)
796  local_node->boolop = OR_EXPR;
797  else if (strncmp(token, "not", 3) == 0)
798  local_node->boolop = NOT_EXPR;
799  else
800  elog(ERROR, "unrecognized boolop \"%.*s\"", length, token);
801 
803  READ_LOCATION_FIELD(location);
804 
805  READ_DONE();
806 }
807 
808 /*
809  * _readSubLink
810  */
811 static SubLink *
813 {
815 
816  READ_ENUM_FIELD(subLinkType, SubLinkType);
817  READ_INT_FIELD(subLinkId);
818  READ_NODE_FIELD(testexpr);
819  READ_NODE_FIELD(operName);
820  READ_NODE_FIELD(subselect);
821  READ_LOCATION_FIELD(location);
822 
823  READ_DONE();
824 }
825 
826 /*
827  * _readSubPlan is not needed since it doesn't appear in stored rules.
828  */
829 
830 /*
831  * _readFieldSelect
832  */
833 static FieldSelect *
835 {
837 
839  READ_INT_FIELD(fieldnum);
840  READ_OID_FIELD(resulttype);
841  READ_INT_FIELD(resulttypmod);
842  READ_OID_FIELD(resultcollid);
843 
844  READ_DONE();
845 }
846 
847 /*
848  * _readFieldStore
849  */
850 static FieldStore *
852 {
854 
856  READ_NODE_FIELD(newvals);
857  READ_NODE_FIELD(fieldnums);
858  READ_OID_FIELD(resulttype);
859 
860  READ_DONE();
861 }
862 
863 /*
864  * _readRelabelType
865  */
866 static RelabelType *
868 {
870 
872  READ_OID_FIELD(resulttype);
873  READ_INT_FIELD(resulttypmod);
874  READ_OID_FIELD(resultcollid);
875  READ_ENUM_FIELD(relabelformat, CoercionForm);
876  READ_LOCATION_FIELD(location);
877 
878  READ_DONE();
879 }
880 
881 /*
882  * _readCoerceViaIO
883  */
884 static CoerceViaIO *
886 {
888 
890  READ_OID_FIELD(resulttype);
891  READ_OID_FIELD(resultcollid);
892  READ_ENUM_FIELD(coerceformat, CoercionForm);
893  READ_LOCATION_FIELD(location);
894 
895  READ_DONE();
896 }
897 
898 /*
899  * _readArrayCoerceExpr
900  */
901 static ArrayCoerceExpr *
903 {
905 
907  READ_NODE_FIELD(elemexpr);
908  READ_OID_FIELD(resulttype);
909  READ_INT_FIELD(resulttypmod);
910  READ_OID_FIELD(resultcollid);
911  READ_ENUM_FIELD(coerceformat, CoercionForm);
912  READ_LOCATION_FIELD(location);
913 
914  READ_DONE();
915 }
916 
917 /*
918  * _readConvertRowtypeExpr
919  */
920 static ConvertRowtypeExpr *
922 {
924 
926  READ_OID_FIELD(resulttype);
927  READ_ENUM_FIELD(convertformat, CoercionForm);
928  READ_LOCATION_FIELD(location);
929 
930  READ_DONE();
931 }
932 
933 /*
934  * _readCollateExpr
935  */
936 static CollateExpr *
938 {
940 
942  READ_OID_FIELD(collOid);
943  READ_LOCATION_FIELD(location);
944 
945  READ_DONE();
946 }
947 
948 /*
949  * _readCaseExpr
950  */
951 static CaseExpr *
953 {
955 
956  READ_OID_FIELD(casetype);
957  READ_OID_FIELD(casecollid);
960  READ_NODE_FIELD(defresult);
961  READ_LOCATION_FIELD(location);
962 
963  READ_DONE();
964 }
965 
966 /*
967  * _readCaseWhen
968  */
969 static CaseWhen *
971 {
973 
974  READ_NODE_FIELD(expr);
975  READ_NODE_FIELD(result);
976  READ_LOCATION_FIELD(location);
977 
978  READ_DONE();
979 }
980 
981 /*
982  * _readCaseTestExpr
983  */
984 static CaseTestExpr *
986 {
988 
989  READ_OID_FIELD(typeId);
990  READ_INT_FIELD(typeMod);
991  READ_OID_FIELD(collation);
992 
993  READ_DONE();
994 }
995 
996 /*
997  * _readArrayExpr
998  */
999 static ArrayExpr *
1001 {
1003 
1004  READ_OID_FIELD(array_typeid);
1005  READ_OID_FIELD(array_collid);
1006  READ_OID_FIELD(element_typeid);
1007  READ_NODE_FIELD(elements);
1008  READ_BOOL_FIELD(multidims);
1009  READ_LOCATION_FIELD(location);
1010 
1011  READ_DONE();
1012 }
1013 
1014 /*
1015  * _readRowExpr
1016  */
1017 static RowExpr *
1019 {
1021 
1023  READ_OID_FIELD(row_typeid);
1024  READ_ENUM_FIELD(row_format, CoercionForm);
1025  READ_NODE_FIELD(colnames);
1026  READ_LOCATION_FIELD(location);
1027 
1028  READ_DONE();
1029 }
1030 
1031 /*
1032  * _readRowCompareExpr
1033  */
1034 static RowCompareExpr *
1036 {
1038 
1040  READ_NODE_FIELD(opnos);
1041  READ_NODE_FIELD(opfamilies);
1042  READ_NODE_FIELD(inputcollids);
1043  READ_NODE_FIELD(largs);
1044  READ_NODE_FIELD(rargs);
1045 
1046  READ_DONE();
1047 }
1048 
1049 /*
1050  * _readCoalesceExpr
1051  */
1052 static CoalesceExpr *
1054 {
1056 
1057  READ_OID_FIELD(coalescetype);
1058  READ_OID_FIELD(coalescecollid);
1060  READ_LOCATION_FIELD(location);
1061 
1062  READ_DONE();
1063 }
1064 
1065 /*
1066  * _readMinMaxExpr
1067  */
1068 static MinMaxExpr *
1070 {
1072 
1073  READ_OID_FIELD(minmaxtype);
1074  READ_OID_FIELD(minmaxcollid);
1075  READ_OID_FIELD(inputcollid);
1078  READ_LOCATION_FIELD(location);
1079 
1080  READ_DONE();
1081 }
1082 
1083 /*
1084  * _readSQLValueFunction
1085  */
1086 static SQLValueFunction *
1088 {
1090 
1093  READ_INT_FIELD(typmod);
1094  READ_LOCATION_FIELD(location);
1095 
1096  READ_DONE();
1097 }
1098 
1099 /*
1100  * _readXmlExpr
1101  */
1102 static XmlExpr *
1104 {
1106 
1109  READ_NODE_FIELD(named_args);
1110  READ_NODE_FIELD(arg_names);
1114  READ_INT_FIELD(typmod);
1115  READ_LOCATION_FIELD(location);
1116 
1117  READ_DONE();
1118 }
1119 
1120 /*
1121  * _readNullTest
1122  */
1123 static NullTest *
1125 {
1127 
1129  READ_ENUM_FIELD(nulltesttype, NullTestType);
1130  READ_BOOL_FIELD(argisrow);
1131  READ_LOCATION_FIELD(location);
1132 
1133  READ_DONE();
1134 }
1135 
1136 /*
1137  * _readBooleanTest
1138  */
1139 static BooleanTest *
1141 {
1143 
1145  READ_ENUM_FIELD(booltesttype, BoolTestType);
1146  READ_LOCATION_FIELD(location);
1147 
1148  READ_DONE();
1149 }
1150 
1151 /*
1152  * _readCoerceToDomain
1153  */
1154 static CoerceToDomain *
1156 {
1158 
1160  READ_OID_FIELD(resulttype);
1161  READ_INT_FIELD(resulttypmod);
1162  READ_OID_FIELD(resultcollid);
1163  READ_ENUM_FIELD(coercionformat, CoercionForm);
1164  READ_LOCATION_FIELD(location);
1165 
1166  READ_DONE();
1167 }
1168 
1169 /*
1170  * _readCoerceToDomainValue
1171  */
1172 static CoerceToDomainValue *
1174 {
1176 
1177  READ_OID_FIELD(typeId);
1178  READ_INT_FIELD(typeMod);
1179  READ_OID_FIELD(collation);
1180  READ_LOCATION_FIELD(location);
1181 
1182  READ_DONE();
1183 }
1184 
1185 /*
1186  * _readSetToDefault
1187  */
1188 static SetToDefault *
1190 {
1192 
1193  READ_OID_FIELD(typeId);
1194  READ_INT_FIELD(typeMod);
1195  READ_OID_FIELD(collation);
1196  READ_LOCATION_FIELD(location);
1197 
1198  READ_DONE();
1199 }
1200 
1201 /*
1202  * _readCurrentOfExpr
1203  */
1204 static CurrentOfExpr *
1206 {
1208 
1209  READ_UINT_FIELD(cvarno);
1210  READ_STRING_FIELD(cursor_name);
1211  READ_INT_FIELD(cursor_param);
1212 
1213  READ_DONE();
1214 }
1215 
1216 /*
1217  * _readNextValueExpr
1218  */
1219 static NextValueExpr *
1221 {
1223 
1224  READ_OID_FIELD(seqid);
1225  READ_OID_FIELD(typeId);
1226 
1227  READ_DONE();
1228 }
1229 
1230 /*
1231  * _readInferenceElem
1232  */
1233 static InferenceElem *
1235 {
1237 
1238  READ_NODE_FIELD(expr);
1239  READ_OID_FIELD(infercollid);
1240  READ_OID_FIELD(inferopclass);
1241 
1242  READ_DONE();
1243 }
1244 
1245 /*
1246  * _readTargetEntry
1247  */
1248 static TargetEntry *
1250 {
1252 
1253  READ_NODE_FIELD(expr);
1254  READ_INT_FIELD(resno);
1255  READ_STRING_FIELD(resname);
1256  READ_UINT_FIELD(ressortgroupref);
1257  READ_OID_FIELD(resorigtbl);
1258  READ_INT_FIELD(resorigcol);
1259  READ_BOOL_FIELD(resjunk);
1260 
1261  READ_DONE();
1262 }
1263 
1264 /*
1265  * _readRangeTblRef
1266  */
1267 static RangeTblRef *
1269 {
1271 
1272  READ_INT_FIELD(rtindex);
1273 
1274  READ_DONE();
1275 }
1276 
1277 /*
1278  * _readJoinExpr
1279  */
1280 static JoinExpr *
1282 {
1284 
1285  READ_ENUM_FIELD(jointype, JoinType);
1286  READ_BOOL_FIELD(isNatural);
1287  READ_NODE_FIELD(larg);
1288  READ_NODE_FIELD(rarg);
1289  READ_NODE_FIELD(usingClause);
1290  READ_NODE_FIELD(quals);
1291  READ_NODE_FIELD(alias);
1292  READ_INT_FIELD(rtindex);
1293 
1294  READ_DONE();
1295 }
1296 
1297 /*
1298  * _readFromExpr
1299  */
1300 static FromExpr *
1302 {
1304 
1305  READ_NODE_FIELD(fromlist);
1306  READ_NODE_FIELD(quals);
1307 
1308  READ_DONE();
1309 }
1310 
1311 /*
1312  * _readOnConflictExpr
1313  */
1314 static OnConflictExpr *
1316 {
1318 
1320  READ_NODE_FIELD(arbiterElems);
1321  READ_NODE_FIELD(arbiterWhere);
1322  READ_OID_FIELD(constraint);
1323  READ_NODE_FIELD(onConflictSet);
1324  READ_NODE_FIELD(onConflictWhere);
1325  READ_INT_FIELD(exclRelIndex);
1326  READ_NODE_FIELD(exclRelTlist);
1327 
1328  READ_DONE();
1329 }
1330 
1331 static PartitionPruneStepOp *
1333 {
1335 
1336  READ_INT_FIELD(step.step_id);
1337  READ_INT_FIELD(opstrategy);
1338  READ_NODE_FIELD(exprs);
1339  READ_NODE_FIELD(cmpfns);
1340  READ_BITMAPSET_FIELD(nullkeys);
1341 
1342  READ_DONE();
1343 }
1344 
1347 {
1349 
1350  READ_INT_FIELD(step.step_id);
1352  READ_NODE_FIELD(source_stepids);
1353 
1354  READ_DONE();
1355 }
1356 
1357 static PartitionPruneInfo *
1359 {
1361 
1362  READ_OID_FIELD(reloid);
1363  READ_NODE_FIELD(pruning_steps);
1364  READ_BITMAPSET_FIELD(present_parts);
1365  READ_INT_FIELD(nparts);
1366  READ_INT_ARRAY(subnode_map, local_node->nparts);
1367  READ_INT_ARRAY(subpart_map, local_node->nparts);
1368  READ_BITMAPSET_FIELD(extparams);
1369  READ_BITMAPSET_FIELD(execparams);
1370 
1371  READ_DONE();
1372 }
1373 
1374 /*
1375  * Stuff from parsenodes.h.
1376  */
1377 
1378 /*
1379  * _readRangeTblEntry
1380  */
1381 static RangeTblEntry *
1383 {
1385 
1386  /* put alias + eref first to make dump more legible */
1387  READ_NODE_FIELD(alias);
1388  READ_NODE_FIELD(eref);
1389  READ_ENUM_FIELD(rtekind, RTEKind);
1390 
1391  switch (local_node->rtekind)
1392  {
1393  case RTE_RELATION:
1394  READ_OID_FIELD(relid);
1396  READ_NODE_FIELD(tablesample);
1397  break;
1398  case RTE_SUBQUERY:
1399  READ_NODE_FIELD(subquery);
1400  READ_BOOL_FIELD(security_barrier);
1401  break;
1402  case RTE_JOIN:
1403  READ_ENUM_FIELD(jointype, JoinType);
1404  READ_NODE_FIELD(joinaliasvars);
1405  break;
1406  case RTE_FUNCTION:
1408  READ_BOOL_FIELD(funcordinality);
1409  break;
1410  case RTE_TABLEFUNC:
1411  READ_NODE_FIELD(tablefunc);
1412  break;
1413  case RTE_VALUES:
1414  READ_NODE_FIELD(values_lists);
1415  READ_NODE_FIELD(coltypes);
1416  READ_NODE_FIELD(coltypmods);
1417  READ_NODE_FIELD(colcollations);
1418  break;
1419  case RTE_CTE:
1420  READ_STRING_FIELD(ctename);
1421  READ_UINT_FIELD(ctelevelsup);
1422  READ_BOOL_FIELD(self_reference);
1423  READ_NODE_FIELD(coltypes);
1424  READ_NODE_FIELD(coltypmods);
1425  READ_NODE_FIELD(colcollations);
1426  break;
1427  case RTE_NAMEDTUPLESTORE:
1428  READ_STRING_FIELD(enrname);
1429  READ_FLOAT_FIELD(enrtuples);
1430  READ_OID_FIELD(relid);
1431  READ_NODE_FIELD(coltypes);
1432  READ_NODE_FIELD(coltypmods);
1433  READ_NODE_FIELD(colcollations);
1434  break;
1435  default:
1436  elog(ERROR, "unrecognized RTE kind: %d",
1437  (int) local_node->rtekind);
1438  break;
1439  }
1440 
1441  READ_BOOL_FIELD(lateral);
1442  READ_BOOL_FIELD(inh);
1443  READ_BOOL_FIELD(inFromCl);
1444  READ_UINT_FIELD(requiredPerms);
1445  READ_OID_FIELD(checkAsUser);
1446  READ_BITMAPSET_FIELD(selectedCols);
1447  READ_BITMAPSET_FIELD(insertedCols);
1448  READ_BITMAPSET_FIELD(updatedCols);
1449  READ_NODE_FIELD(securityQuals);
1450 
1451  READ_DONE();
1452 }
1453 
1454 /*
1455  * _readRangeTblFunction
1456  */
1457 static RangeTblFunction *
1459 {
1461 
1462  READ_NODE_FIELD(funcexpr);
1463  READ_INT_FIELD(funccolcount);
1464  READ_NODE_FIELD(funccolnames);
1465  READ_NODE_FIELD(funccoltypes);
1466  READ_NODE_FIELD(funccoltypmods);
1467  READ_NODE_FIELD(funccolcollations);
1468  READ_BITMAPSET_FIELD(funcparams);
1469 
1470  READ_DONE();
1471 }
1472 
1473 /*
1474  * _readTableSampleClause
1475  */
1476 static TableSampleClause *
1478 {
1480 
1481  READ_OID_FIELD(tsmhandler);
1483  READ_NODE_FIELD(repeatable);
1484 
1485  READ_DONE();
1486 }
1487 
1488 /*
1489  * _readDefElem
1490  */
1491 static DefElem *
1493 {
1495 
1496  READ_STRING_FIELD(defnamespace);
1497  READ_STRING_FIELD(defname);
1499  READ_ENUM_FIELD(defaction, DefElemAction);
1500  READ_LOCATION_FIELD(location);
1501 
1502  READ_DONE();
1503 }
1504 
1505 /*
1506  * _readPlannedStmt
1507  */
1508 static PlannedStmt *
1510 {
1512 
1513  READ_ENUM_FIELD(commandType, CmdType);
1514  READ_UINT64_FIELD(queryId);
1515  READ_BOOL_FIELD(hasReturning);
1516  READ_BOOL_FIELD(hasModifyingCTE);
1517  READ_BOOL_FIELD(canSetTag);
1518  READ_BOOL_FIELD(transientPlan);
1519  READ_BOOL_FIELD(dependsOnRole);
1520  READ_BOOL_FIELD(parallelModeNeeded);
1521  READ_INT_FIELD(jitFlags);
1522  READ_NODE_FIELD(planTree);
1523  READ_NODE_FIELD(rtable);
1524  READ_NODE_FIELD(resultRelations);
1525  READ_NODE_FIELD(nonleafResultRelations);
1526  READ_NODE_FIELD(rootResultRelations);
1527  READ_NODE_FIELD(subplans);
1528  READ_BITMAPSET_FIELD(rewindPlanIDs);
1529  READ_NODE_FIELD(rowMarks);
1530  READ_NODE_FIELD(relationOids);
1531  READ_NODE_FIELD(invalItems);
1532  READ_NODE_FIELD(paramExecTypes);
1533  READ_NODE_FIELD(utilityStmt);
1534  READ_LOCATION_FIELD(stmt_location);
1535  READ_LOCATION_FIELD(stmt_len);
1536 
1537  READ_DONE();
1538 }
1539 
1540 /*
1541  * ReadCommonPlan
1542  * Assign the basic stuff of all nodes that inherit from Plan
1543  */
1544 static void
1545 ReadCommonPlan(Plan *local_node)
1546 {
1547  READ_TEMP_LOCALS();
1548 
1549  READ_FLOAT_FIELD(startup_cost);
1550  READ_FLOAT_FIELD(total_cost);
1551  READ_FLOAT_FIELD(plan_rows);
1552  READ_INT_FIELD(plan_width);
1553  READ_BOOL_FIELD(parallel_aware);
1554  READ_BOOL_FIELD(parallel_safe);
1555  READ_INT_FIELD(plan_node_id);
1556  READ_NODE_FIELD(targetlist);
1557  READ_NODE_FIELD(qual);
1558  READ_NODE_FIELD(lefttree);
1559  READ_NODE_FIELD(righttree);
1560  READ_NODE_FIELD(initPlan);
1561  READ_BITMAPSET_FIELD(extParam);
1562  READ_BITMAPSET_FIELD(allParam);
1563 }
1564 
1565 /*
1566  * _readPlan
1567  */
1568 static Plan *
1570 {
1572 
1573  ReadCommonPlan(local_node);
1574 
1575  READ_DONE();
1576 }
1577 
1578 /*
1579  * _readResult
1580  */
1581 static Result *
1583 {
1585 
1586  ReadCommonPlan(&local_node->plan);
1587 
1588  READ_NODE_FIELD(resconstantqual);
1589 
1590  READ_DONE();
1591 }
1592 
1593 /*
1594  * _readProjectSet
1595  */
1596 static ProjectSet *
1598 {
1600 
1601  ReadCommonPlan(&local_node->plan);
1602 
1603  READ_DONE();
1604 }
1605 
1606 /*
1607  * _readModifyTable
1608  */
1609 static ModifyTable *
1611 {
1613 
1614  ReadCommonPlan(&local_node->plan);
1615 
1616  READ_ENUM_FIELD(operation, CmdType);
1617  READ_BOOL_FIELD(canSetTag);
1618  READ_UINT_FIELD(nominalRelation);
1619  READ_NODE_FIELD(partitioned_rels);
1620  READ_BOOL_FIELD(partColsUpdated);
1621  READ_NODE_FIELD(resultRelations);
1622  READ_INT_FIELD(resultRelIndex);
1623  READ_INT_FIELD(rootResultRelIndex);
1624  READ_NODE_FIELD(plans);
1625  READ_NODE_FIELD(withCheckOptionLists);
1626  READ_NODE_FIELD(returningLists);
1627  READ_NODE_FIELD(fdwPrivLists);
1628  READ_BITMAPSET_FIELD(fdwDirectModifyPlans);
1629  READ_NODE_FIELD(rowMarks);
1630  READ_INT_FIELD(epqParam);
1631  READ_ENUM_FIELD(onConflictAction, OnConflictAction);
1632  READ_NODE_FIELD(arbiterIndexes);
1633  READ_NODE_FIELD(onConflictSet);
1634  READ_NODE_FIELD(onConflictWhere);
1635  READ_UINT_FIELD(exclRelRTI);
1636  READ_NODE_FIELD(exclRelTlist);
1637 
1638  READ_DONE();
1639 }
1640 
1641 /*
1642  * _readAppend
1643  */
1644 static Append *
1646 {
1648 
1649  ReadCommonPlan(&local_node->plan);
1650 
1651  READ_NODE_FIELD(partitioned_rels);
1652  READ_NODE_FIELD(appendplans);
1653  READ_INT_FIELD(first_partial_plan);
1654  READ_NODE_FIELD(part_prune_infos);
1655 
1656  READ_DONE();
1657 }
1658 
1659 /*
1660  * _readMergeAppend
1661  */
1662 static MergeAppend *
1664 {
1666 
1667  ReadCommonPlan(&local_node->plan);
1668 
1669  READ_NODE_FIELD(partitioned_rels);
1670  READ_NODE_FIELD(mergeplans);
1671  READ_INT_FIELD(numCols);
1672  READ_ATTRNUMBER_ARRAY(sortColIdx, local_node->numCols);
1673  READ_OID_ARRAY(sortOperators, local_node->numCols);
1674  READ_OID_ARRAY(collations, local_node->numCols);
1675  READ_BOOL_ARRAY(nullsFirst, local_node->numCols);
1676 
1677  READ_DONE();
1678 }
1679 
1680 /*
1681  * _readRecursiveUnion
1682  */
1683 static RecursiveUnion *
1685 {
1687 
1688  ReadCommonPlan(&local_node->plan);
1689 
1690  READ_INT_FIELD(wtParam);
1691  READ_INT_FIELD(numCols);
1692  READ_ATTRNUMBER_ARRAY(dupColIdx, local_node->numCols);
1693  READ_OID_ARRAY(dupOperators, local_node->numCols);
1694  READ_LONG_FIELD(numGroups);
1695 
1696  READ_DONE();
1697 }
1698 
1699 /*
1700  * _readBitmapAnd
1701  */
1702 static BitmapAnd *
1704 {
1706 
1707  ReadCommonPlan(&local_node->plan);
1708 
1709  READ_NODE_FIELD(bitmapplans);
1710 
1711  READ_DONE();
1712 }
1713 
1714 /*
1715  * _readBitmapOr
1716  */
1717 static BitmapOr *
1719 {
1721 
1722  ReadCommonPlan(&local_node->plan);
1723 
1724  READ_BOOL_FIELD(isshared);
1725  READ_NODE_FIELD(bitmapplans);
1726 
1727  READ_DONE();
1728 }
1729 
1730 /*
1731  * ReadCommonScan
1732  * Assign the basic stuff of all nodes that inherit from Scan
1733  */
1734 static void
1735 ReadCommonScan(Scan *local_node)
1736 {
1737  READ_TEMP_LOCALS();
1738 
1739  ReadCommonPlan(&local_node->plan);
1740 
1741  READ_UINT_FIELD(scanrelid);
1742 }
1743 
1744 /*
1745  * _readScan
1746  */
1747 static Scan *
1749 {
1751 
1752  ReadCommonScan(local_node);
1753 
1754  READ_DONE();
1755 }
1756 
1757 /*
1758  * _readSeqScan
1759  */
1760 static SeqScan *
1762 {
1764 
1765  ReadCommonScan(local_node);
1766 
1767  READ_DONE();
1768 }
1769 
1770 /*
1771  * _readSampleScan
1772  */
1773 static SampleScan *
1775 {
1777 
1778  ReadCommonScan(&local_node->scan);
1779 
1780  READ_NODE_FIELD(tablesample);
1781 
1782  READ_DONE();
1783 }
1784 
1785 /*
1786  * _readIndexScan
1787  */
1788 static IndexScan *
1790 {
1792 
1793  ReadCommonScan(&local_node->scan);
1794 
1795  READ_OID_FIELD(indexid);
1796  READ_NODE_FIELD(indexqual);
1797  READ_NODE_FIELD(indexqualorig);
1798  READ_NODE_FIELD(indexorderby);
1799  READ_NODE_FIELD(indexorderbyorig);
1800  READ_NODE_FIELD(indexorderbyops);
1801  READ_ENUM_FIELD(indexorderdir, ScanDirection);
1802 
1803  READ_DONE();
1804 }
1805 
1806 /*
1807  * _readIndexOnlyScan
1808  */
1809 static IndexOnlyScan *
1811 {
1813 
1814  ReadCommonScan(&local_node->scan);
1815 
1816  READ_OID_FIELD(indexid);
1817  READ_NODE_FIELD(indexqual);
1818  READ_NODE_FIELD(indexorderby);
1819  READ_NODE_FIELD(indextlist);
1820  READ_ENUM_FIELD(indexorderdir, ScanDirection);
1821 
1822  READ_DONE();
1823 }
1824 
1825 /*
1826  * _readBitmapIndexScan
1827  */
1828 static BitmapIndexScan *
1830 {
1832 
1833  ReadCommonScan(&local_node->scan);
1834 
1835  READ_OID_FIELD(indexid);
1836  READ_BOOL_FIELD(isshared);
1837  READ_NODE_FIELD(indexqual);
1838  READ_NODE_FIELD(indexqualorig);
1839 
1840  READ_DONE();
1841 }
1842 
1843 /*
1844  * _readBitmapHeapScan
1845  */
1846 static BitmapHeapScan *
1848 {
1850 
1851  ReadCommonScan(&local_node->scan);
1852 
1853  READ_NODE_FIELD(bitmapqualorig);
1854 
1855  READ_DONE();
1856 }
1857 
1858 /*
1859  * _readTidScan
1860  */
1861 static TidScan *
1863 {
1865 
1866  ReadCommonScan(&local_node->scan);
1867 
1868  READ_NODE_FIELD(tidquals);
1869 
1870  READ_DONE();
1871 }
1872 
1873 /*
1874  * _readSubqueryScan
1875  */
1876 static SubqueryScan *
1878 {
1880 
1881  ReadCommonScan(&local_node->scan);
1882 
1883  READ_NODE_FIELD(subplan);
1884 
1885  READ_DONE();
1886 }
1887 
1888 /*
1889  * _readFunctionScan
1890  */
1891 static FunctionScan *
1893 {
1895 
1896  ReadCommonScan(&local_node->scan);
1897 
1899  READ_BOOL_FIELD(funcordinality);
1900 
1901  READ_DONE();
1902 }
1903 
1904 /*
1905  * _readValuesScan
1906  */
1907 static ValuesScan *
1909 {
1911 
1912  ReadCommonScan(&local_node->scan);
1913 
1914  READ_NODE_FIELD(values_lists);
1915 
1916  READ_DONE();
1917 }
1918 
1919 /*
1920  * _readTableFuncScan
1921  */
1922 static TableFuncScan *
1924 {
1926 
1927  ReadCommonScan(&local_node->scan);
1928 
1929  READ_NODE_FIELD(tablefunc);
1930 
1931  READ_DONE();
1932 }
1933 
1934 /*
1935  * _readCteScan
1936  */
1937 static CteScan *
1939 {
1941 
1942  ReadCommonScan(&local_node->scan);
1943 
1944  READ_INT_FIELD(ctePlanId);
1945  READ_INT_FIELD(cteParam);
1946 
1947  READ_DONE();
1948 }
1949 
1950 /*
1951  * _readWorkTableScan
1952  */
1953 static WorkTableScan *
1955 {
1957 
1958  ReadCommonScan(&local_node->scan);
1959 
1960  READ_INT_FIELD(wtParam);
1961 
1962  READ_DONE();
1963 }
1964 
1965 /*
1966  * _readForeignScan
1967  */
1968 static ForeignScan *
1970 {
1972 
1973  ReadCommonScan(&local_node->scan);
1974 
1975  READ_ENUM_FIELD(operation, CmdType);
1976  READ_OID_FIELD(fs_server);
1977  READ_NODE_FIELD(fdw_exprs);
1978  READ_NODE_FIELD(fdw_private);
1979  READ_NODE_FIELD(fdw_scan_tlist);
1980  READ_NODE_FIELD(fdw_recheck_quals);
1981  READ_BITMAPSET_FIELD(fs_relids);
1982  READ_BOOL_FIELD(fsSystemCol);
1983 
1984  READ_DONE();
1985 }
1986 
1987 /*
1988  * _readCustomScan
1989  */
1990 static CustomScan *
1992 {
1994  char *custom_name;
1995  const CustomScanMethods *methods;
1996 
1997  ReadCommonScan(&local_node->scan);
1998 
1999  READ_UINT_FIELD(flags);
2000  READ_NODE_FIELD(custom_plans);
2001  READ_NODE_FIELD(custom_exprs);
2002  READ_NODE_FIELD(custom_private);
2003  READ_NODE_FIELD(custom_scan_tlist);
2004  READ_BITMAPSET_FIELD(custom_relids);
2005 
2006  /* Lookup CustomScanMethods by CustomName */
2007  token = pg_strtok(&length); /* skip methods: */
2008  token = pg_strtok(&length); /* CustomName */
2009  custom_name = nullable_string(token, length);
2010  methods = GetCustomScanMethods(custom_name, false);
2011  local_node->methods = methods;
2012 
2013  READ_DONE();
2014 }
2015 
2016 /*
2017  * ReadCommonJoin
2018  * Assign the basic stuff of all nodes that inherit from Join
2019  */
2020 static void
2021 ReadCommonJoin(Join *local_node)
2022 {
2023  READ_TEMP_LOCALS();
2024 
2025  ReadCommonPlan(&local_node->plan);
2026 
2027  READ_ENUM_FIELD(jointype, JoinType);
2028  READ_BOOL_FIELD(inner_unique);
2029  READ_NODE_FIELD(joinqual);
2030 }
2031 
2032 /*
2033  * _readJoin
2034  */
2035 static Join *
2037 {
2039 
2040  ReadCommonJoin(local_node);
2041 
2042  READ_DONE();
2043 }
2044 
2045 /*
2046  * _readNestLoop
2047  */
2048 static NestLoop *
2050 {
2052 
2053  ReadCommonJoin(&local_node->join);
2054 
2055  READ_NODE_FIELD(nestParams);
2056 
2057  READ_DONE();
2058 }
2059 
2060 /*
2061  * _readMergeJoin
2062  */
2063 static MergeJoin *
2065 {
2066  int numCols;
2067 
2069 
2070  ReadCommonJoin(&local_node->join);
2071 
2072  READ_BOOL_FIELD(skip_mark_restore);
2073  READ_NODE_FIELD(mergeclauses);
2074 
2075  numCols = list_length(local_node->mergeclauses);
2076 
2077  READ_OID_ARRAY(mergeFamilies, numCols);
2078  READ_OID_ARRAY(mergeCollations, numCols);
2079  READ_INT_ARRAY(mergeStrategies, numCols);
2080  READ_BOOL_ARRAY(mergeNullsFirst, numCols);
2081 
2082  READ_DONE();
2083 }
2084 
2085 /*
2086  * _readHashJoin
2087  */
2088 static HashJoin *
2090 {
2092 
2093  ReadCommonJoin(&local_node->join);
2094 
2095  READ_NODE_FIELD(hashclauses);
2096 
2097  READ_DONE();
2098 }
2099 
2100 /*
2101  * _readMaterial
2102  */
2103 static Material *
2105 {
2107 
2108  ReadCommonPlan(&local_node->plan);
2109 
2110  READ_DONE();
2111 }
2112 
2113 /*
2114  * _readSort
2115  */
2116 static Sort *
2118 {
2119  READ_LOCALS(Sort);
2120 
2121  ReadCommonPlan(&local_node->plan);
2122 
2123  READ_INT_FIELD(numCols);
2124  READ_ATTRNUMBER_ARRAY(sortColIdx, local_node->numCols);
2125  READ_OID_ARRAY(sortOperators, local_node->numCols);
2126  READ_OID_ARRAY(collations, local_node->numCols);
2127  READ_BOOL_ARRAY(nullsFirst, local_node->numCols);
2128 
2129  READ_DONE();
2130 }
2131 
2132 /*
2133  * _readGroup
2134  */
2135 static Group *
2137 {
2138  READ_LOCALS(Group);
2139 
2140  ReadCommonPlan(&local_node->plan);
2141 
2142  READ_INT_FIELD(numCols);
2143  READ_ATTRNUMBER_ARRAY(grpColIdx, local_node->numCols);
2144  READ_OID_ARRAY(grpOperators, local_node->numCols);
2145 
2146  READ_DONE();
2147 }
2148 
2149 /*
2150  * _readAgg
2151  */
2152 static Agg *
2154 {
2155  READ_LOCALS(Agg);
2156 
2157  ReadCommonPlan(&local_node->plan);
2158 
2159  READ_ENUM_FIELD(aggstrategy, AggStrategy);
2160  READ_ENUM_FIELD(aggsplit, AggSplit);
2161  READ_INT_FIELD(numCols);
2162  READ_ATTRNUMBER_ARRAY(grpColIdx, local_node->numCols);
2163  READ_OID_ARRAY(grpOperators, local_node->numCols);
2164  READ_LONG_FIELD(numGroups);
2165  READ_BITMAPSET_FIELD(aggParams);
2166  READ_NODE_FIELD(groupingSets);
2167  READ_NODE_FIELD(chain);
2168 
2169  READ_DONE();
2170 }
2171 
2172 /*
2173  * _readWindowAgg
2174  */
2175 static WindowAgg *
2177 {
2179 
2180  ReadCommonPlan(&local_node->plan);
2181 
2182  READ_UINT_FIELD(winref);
2183  READ_INT_FIELD(partNumCols);
2184  READ_ATTRNUMBER_ARRAY(partColIdx, local_node->partNumCols);
2185  READ_OID_ARRAY(partOperators, local_node->partNumCols);
2186  READ_INT_FIELD(ordNumCols);
2187  READ_ATTRNUMBER_ARRAY(ordColIdx, local_node->ordNumCols);
2188  READ_OID_ARRAY(ordOperators, local_node->ordNumCols);
2189  READ_INT_FIELD(frameOptions);
2190  READ_NODE_FIELD(startOffset);
2191  READ_NODE_FIELD(endOffset);
2192  READ_OID_FIELD(startInRangeFunc);
2193  READ_OID_FIELD(endInRangeFunc);
2194  READ_OID_FIELD(inRangeColl);
2195  READ_BOOL_FIELD(inRangeAsc);
2196  READ_BOOL_FIELD(inRangeNullsFirst);
2197 
2198  READ_DONE();
2199 }
2200 
2201 /*
2202  * _readUnique
2203  */
2204 static Unique *
2206 {
2208 
2209  ReadCommonPlan(&local_node->plan);
2210 
2211  READ_INT_FIELD(numCols);
2212  READ_ATTRNUMBER_ARRAY(uniqColIdx, local_node->numCols);
2213  READ_OID_ARRAY(uniqOperators, local_node->numCols);
2214 
2215  READ_DONE();
2216 }
2217 
2218 /*
2219  * _readGather
2220  */
2221 static Gather *
2223 {
2225 
2226  ReadCommonPlan(&local_node->plan);
2227 
2228  READ_INT_FIELD(num_workers);
2229  READ_INT_FIELD(rescan_param);
2230  READ_BOOL_FIELD(single_copy);
2231  READ_BOOL_FIELD(invisible);
2232  READ_BITMAPSET_FIELD(initParam);
2233 
2234  READ_DONE();
2235 }
2236 
2237 /*
2238  * _readGatherMerge
2239  */
2240 static GatherMerge *
2242 {
2244 
2245  ReadCommonPlan(&local_node->plan);
2246 
2247  READ_INT_FIELD(num_workers);
2248  READ_INT_FIELD(rescan_param);
2249  READ_INT_FIELD(numCols);
2250  READ_ATTRNUMBER_ARRAY(sortColIdx, local_node->numCols);
2251  READ_OID_ARRAY(sortOperators, local_node->numCols);
2252  READ_OID_ARRAY(collations, local_node->numCols);
2253  READ_BOOL_ARRAY(nullsFirst, local_node->numCols);
2254  READ_BITMAPSET_FIELD(initParam);
2255 
2256  READ_DONE();
2257 }
2258 
2259 /*
2260  * _readHash
2261  */
2262 static Hash *
2264 {
2265  READ_LOCALS(Hash);
2266 
2267  ReadCommonPlan(&local_node->plan);
2268 
2269  READ_OID_FIELD(skewTable);
2270  READ_INT_FIELD(skewColumn);
2271  READ_BOOL_FIELD(skewInherit);
2272  READ_FLOAT_FIELD(rows_total);
2273 
2274  READ_DONE();
2275 }
2276 
2277 /*
2278  * _readSetOp
2279  */
2280 static SetOp *
2282 {
2283  READ_LOCALS(SetOp);
2284 
2285  ReadCommonPlan(&local_node->plan);
2286 
2287  READ_ENUM_FIELD(cmd, SetOpCmd);
2288  READ_ENUM_FIELD(strategy, SetOpStrategy);
2289  READ_INT_FIELD(numCols);
2290  READ_ATTRNUMBER_ARRAY(dupColIdx, local_node->numCols);
2291  READ_OID_ARRAY(dupOperators, local_node->numCols);
2292  READ_INT_FIELD(flagColIdx);
2293  READ_INT_FIELD(firstFlag);
2294  READ_LONG_FIELD(numGroups);
2295 
2296  READ_DONE();
2297 }
2298 
2299 /*
2300  * _readLockRows
2301  */
2302 static LockRows *
2304 {
2306 
2307  ReadCommonPlan(&local_node->plan);
2308 
2309  READ_NODE_FIELD(rowMarks);
2310  READ_INT_FIELD(epqParam);
2311 
2312  READ_DONE();
2313 }
2314 
2315 /*
2316  * _readLimit
2317  */
2318 static Limit *
2320 {
2321  READ_LOCALS(Limit);
2322 
2323  ReadCommonPlan(&local_node->plan);
2324 
2325  READ_NODE_FIELD(limitOffset);
2326  READ_NODE_FIELD(limitCount);
2327 
2328  READ_DONE();
2329 }
2330 
2331 /*
2332  * _readNestLoopParam
2333  */
2334 static NestLoopParam *
2336 {
2338 
2339  READ_INT_FIELD(paramno);
2340  READ_NODE_FIELD(paramval);
2341 
2342  READ_DONE();
2343 }
2344 
2345 /*
2346  * _readPlanRowMark
2347  */
2348 static PlanRowMark *
2350 {
2352 
2353  READ_UINT_FIELD(rti);
2354  READ_UINT_FIELD(prti);
2355  READ_UINT_FIELD(rowmarkId);
2356  READ_ENUM_FIELD(markType, RowMarkType);
2357  READ_INT_FIELD(allMarkTypes);
2359  READ_ENUM_FIELD(waitPolicy, LockWaitPolicy);
2360  READ_BOOL_FIELD(isParent);
2361 
2362  READ_DONE();
2363 }
2364 
2365 /*
2366  * _readPlanInvalItem
2367  */
2368 static PlanInvalItem *
2370 {
2372 
2373  READ_INT_FIELD(cacheId);
2374  READ_UINT_FIELD(hashValue);
2375 
2376  READ_DONE();
2377 }
2378 
2379 /*
2380  * _readSubPlan
2381  */
2382 static SubPlan *
2384 {
2386 
2387  READ_ENUM_FIELD(subLinkType, SubLinkType);
2388  READ_NODE_FIELD(testexpr);
2389  READ_NODE_FIELD(paramIds);
2390  READ_INT_FIELD(plan_id);
2391  READ_STRING_FIELD(plan_name);
2392  READ_OID_FIELD(firstColType);
2393  READ_INT_FIELD(firstColTypmod);
2394  READ_OID_FIELD(firstColCollation);
2395  READ_BOOL_FIELD(useHashTable);
2396  READ_BOOL_FIELD(unknownEqFalse);
2397  READ_BOOL_FIELD(parallel_safe);
2398  READ_NODE_FIELD(setParam);
2399  READ_NODE_FIELD(parParam);
2401  READ_FLOAT_FIELD(startup_cost);
2402  READ_FLOAT_FIELD(per_call_cost);
2403 
2404  READ_DONE();
2405 }
2406 
2407 /*
2408  * _readAlternativeSubPlan
2409  */
2410 static AlternativeSubPlan *
2412 {
2414 
2415  READ_NODE_FIELD(subplans);
2416 
2417  READ_DONE();
2418 }
2419 
2420 /*
2421  * _readExtensibleNode
2422  */
2423 static ExtensibleNode *
2425 {
2426  const ExtensibleNodeMethods *methods;
2427  ExtensibleNode *local_node;
2428  const char *extnodename;
2429 
2430  READ_TEMP_LOCALS();
2431 
2432  token = pg_strtok(&length); /* skip :extnodename */
2433  token = pg_strtok(&length); /* get extnodename */
2434 
2435  extnodename = nullable_string(token, length);
2436  if (!extnodename)
2437  elog(ERROR, "extnodename has to be supplied");
2438  methods = GetExtensibleNodeMethods(extnodename, false);
2439 
2440  local_node = (ExtensibleNode *) newNode(methods->node_size,
2442  local_node->extnodename = extnodename;
2443 
2444  /* deserialize the private fields */
2445  methods->nodeRead(local_node);
2446 
2447  READ_DONE();
2448 }
2449 
2450 /*
2451  * _readPartitionBoundSpec
2452  */
2453 static PartitionBoundSpec *
2455 {
2457 
2458  READ_CHAR_FIELD(strategy);
2459  READ_BOOL_FIELD(is_default);
2460  READ_INT_FIELD(modulus);
2461  READ_INT_FIELD(remainder);
2462  READ_NODE_FIELD(listdatums);
2463  READ_NODE_FIELD(lowerdatums);
2464  READ_NODE_FIELD(upperdatums);
2465  READ_LOCATION_FIELD(location);
2466 
2467  READ_DONE();
2468 }
2469 
2470 /*
2471  * _readPartitionRangeDatum
2472  */
2473 static PartitionRangeDatum *
2475 {
2477 
2480  READ_LOCATION_FIELD(location);
2481 
2482  READ_DONE();
2483 }
2484 
2485 /*
2486  * parseNodeString
2487  *
2488  * Given a character string representing a node tree, parseNodeString creates
2489  * the internal node structure.
2490  *
2491  * The string to be read must already have been loaded into pg_strtok().
2492  */
2493 Node *
2495 {
2496  void *return_value;
2497 
2498  READ_TEMP_LOCALS();
2499 
2500  token = pg_strtok(&length);
2501 
2502 #define MATCH(tokname, namelen) \
2503  (length == namelen && memcmp(token, tokname, namelen) == 0)
2504 
2505  if (MATCH("QUERY", 5))
2506  return_value = _readQuery();
2507  else if (MATCH("WITHCHECKOPTION", 15))
2508  return_value = _readWithCheckOption();
2509  else if (MATCH("SORTGROUPCLAUSE", 15))
2510  return_value = _readSortGroupClause();
2511  else if (MATCH("GROUPINGSET", 11))
2512  return_value = _readGroupingSet();
2513  else if (MATCH("WINDOWCLAUSE", 12))
2514  return_value = _readWindowClause();
2515  else if (MATCH("ROWMARKCLAUSE", 13))
2516  return_value = _readRowMarkClause();
2517  else if (MATCH("COMMONTABLEEXPR", 15))
2518  return_value = _readCommonTableExpr();
2519  else if (MATCH("SETOPERATIONSTMT", 16))
2520  return_value = _readSetOperationStmt();
2521  else if (MATCH("ALIAS", 5))
2522  return_value = _readAlias();
2523  else if (MATCH("RANGEVAR", 8))
2524  return_value = _readRangeVar();
2525  else if (MATCH("INTOCLAUSE", 10))
2526  return_value = _readIntoClause();
2527  else if (MATCH("TABLEFUNC", 9))
2528  return_value = _readTableFunc();
2529  else if (MATCH("VAR", 3))
2530  return_value = _readVar();
2531  else if (MATCH("CONST", 5))
2532  return_value = _readConst();
2533  else if (MATCH("PARAM", 5))
2534  return_value = _readParam();
2535  else if (MATCH("AGGREF", 6))
2536  return_value = _readAggref();
2537  else if (MATCH("GROUPINGFUNC", 12))
2538  return_value = _readGroupingFunc();
2539  else if (MATCH("WINDOWFUNC", 10))
2540  return_value = _readWindowFunc();
2541  else if (MATCH("ARRAYREF", 8))
2542  return_value = _readArrayRef();
2543  else if (MATCH("FUNCEXPR", 8))
2544  return_value = _readFuncExpr();
2545  else if (MATCH("NAMEDARGEXPR", 12))
2546  return_value = _readNamedArgExpr();
2547  else if (MATCH("OPEXPR", 6))
2548  return_value = _readOpExpr();
2549  else if (MATCH("DISTINCTEXPR", 12))
2550  return_value = _readDistinctExpr();
2551  else if (MATCH("NULLIFEXPR", 10))
2552  return_value = _readNullIfExpr();
2553  else if (MATCH("SCALARARRAYOPEXPR", 17))
2554  return_value = _readScalarArrayOpExpr();
2555  else if (MATCH("BOOLEXPR", 8))
2556  return_value = _readBoolExpr();
2557  else if (MATCH("SUBLINK", 7))
2558  return_value = _readSubLink();
2559  else if (MATCH("FIELDSELECT", 11))
2560  return_value = _readFieldSelect();
2561  else if (MATCH("FIELDSTORE", 10))
2562  return_value = _readFieldStore();
2563  else if (MATCH("RELABELTYPE", 11))
2564  return_value = _readRelabelType();
2565  else if (MATCH("COERCEVIAIO", 11))
2566  return_value = _readCoerceViaIO();
2567  else if (MATCH("ARRAYCOERCEEXPR", 15))
2568  return_value = _readArrayCoerceExpr();
2569  else if (MATCH("CONVERTROWTYPEEXPR", 18))
2570  return_value = _readConvertRowtypeExpr();
2571  else if (MATCH("COLLATE", 7))
2572  return_value = _readCollateExpr();
2573  else if (MATCH("CASE", 4))
2574  return_value = _readCaseExpr();
2575  else if (MATCH("WHEN", 4))
2576  return_value = _readCaseWhen();
2577  else if (MATCH("CASETESTEXPR", 12))
2578  return_value = _readCaseTestExpr();
2579  else if (MATCH("ARRAY", 5))
2580  return_value = _readArrayExpr();
2581  else if (MATCH("ROW", 3))
2582  return_value = _readRowExpr();
2583  else if (MATCH("ROWCOMPARE", 10))
2584  return_value = _readRowCompareExpr();
2585  else if (MATCH("COALESCE", 8))
2586  return_value = _readCoalesceExpr();
2587  else if (MATCH("MINMAX", 6))
2588  return_value = _readMinMaxExpr();
2589  else if (MATCH("SQLVALUEFUNCTION", 16))
2590  return_value = _readSQLValueFunction();
2591  else if (MATCH("XMLEXPR", 7))
2592  return_value = _readXmlExpr();
2593  else if (MATCH("NULLTEST", 8))
2594  return_value = _readNullTest();
2595  else if (MATCH("BOOLEANTEST", 11))
2596  return_value = _readBooleanTest();
2597  else if (MATCH("COERCETODOMAIN", 14))
2598  return_value = _readCoerceToDomain();
2599  else if (MATCH("COERCETODOMAINVALUE", 19))
2600  return_value = _readCoerceToDomainValue();
2601  else if (MATCH("SETTODEFAULT", 12))
2602  return_value = _readSetToDefault();
2603  else if (MATCH("CURRENTOFEXPR", 13))
2604  return_value = _readCurrentOfExpr();
2605  else if (MATCH("NEXTVALUEEXPR", 13))
2606  return_value = _readNextValueExpr();
2607  else if (MATCH("INFERENCEELEM", 13))
2608  return_value = _readInferenceElem();
2609  else if (MATCH("TARGETENTRY", 11))
2610  return_value = _readTargetEntry();
2611  else if (MATCH("RANGETBLREF", 11))
2612  return_value = _readRangeTblRef();
2613  else if (MATCH("JOINEXPR", 8))
2614  return_value = _readJoinExpr();
2615  else if (MATCH("FROMEXPR", 8))
2616  return_value = _readFromExpr();
2617  else if (MATCH("ONCONFLICTEXPR", 14))
2618  return_value = _readOnConflictExpr();
2619  else if (MATCH("PARTITIONPRUNESTEPOP", 20))
2620  return_value = _readPartitionPruneStepOp();
2621  else if (MATCH("PARTITIONPRUNESTEPCOMBINE", 25))
2622  return_value = _readPartitionPruneStepCombine();
2623  else if (MATCH("PARTITIONPRUNEINFO", 18))
2624  return_value = _readPartitionPruneInfo();
2625  else if (MATCH("RTE", 3))
2626  return_value = _readRangeTblEntry();
2627  else if (MATCH("RANGETBLFUNCTION", 16))
2628  return_value = _readRangeTblFunction();
2629  else if (MATCH("TABLESAMPLECLAUSE", 17))
2630  return_value = _readTableSampleClause();
2631  else if (MATCH("NOTIFY", 6))
2632  return_value = _readNotifyStmt();
2633  else if (MATCH("DEFELEM", 7))
2634  return_value = _readDefElem();
2635  else if (MATCH("DECLARECURSOR", 13))
2636  return_value = _readDeclareCursorStmt();
2637  else if (MATCH("PLANNEDSTMT", 11))
2638  return_value = _readPlannedStmt();
2639  else if (MATCH("PLAN", 4))
2640  return_value = _readPlan();
2641  else if (MATCH("RESULT", 6))
2642  return_value = _readResult();
2643  else if (MATCH("PROJECTSET", 10))
2644  return_value = _readProjectSet();
2645  else if (MATCH("MODIFYTABLE", 11))
2646  return_value = _readModifyTable();
2647  else if (MATCH("APPEND", 6))
2648  return_value = _readAppend();
2649  else if (MATCH("MERGEAPPEND", 11))
2650  return_value = _readMergeAppend();
2651  else if (MATCH("RECURSIVEUNION", 14))
2652  return_value = _readRecursiveUnion();
2653  else if (MATCH("BITMAPAND", 9))
2654  return_value = _readBitmapAnd();
2655  else if (MATCH("BITMAPOR", 8))
2656  return_value = _readBitmapOr();
2657  else if (MATCH("SCAN", 4))
2658  return_value = _readScan();
2659  else if (MATCH("SEQSCAN", 7))
2660  return_value = _readSeqScan();
2661  else if (MATCH("SAMPLESCAN", 10))
2662  return_value = _readSampleScan();
2663  else if (MATCH("INDEXSCAN", 9))
2664  return_value = _readIndexScan();
2665  else if (MATCH("INDEXONLYSCAN", 13))
2666  return_value = _readIndexOnlyScan();
2667  else if (MATCH("BITMAPINDEXSCAN", 15))
2668  return_value = _readBitmapIndexScan();
2669  else if (MATCH("BITMAPHEAPSCAN", 14))
2670  return_value = _readBitmapHeapScan();
2671  else if (MATCH("TIDSCAN", 7))
2672  return_value = _readTidScan();
2673  else if (MATCH("SUBQUERYSCAN", 12))
2674  return_value = _readSubqueryScan();
2675  else if (MATCH("FUNCTIONSCAN", 12))
2676  return_value = _readFunctionScan();
2677  else if (MATCH("VALUESSCAN", 10))
2678  return_value = _readValuesScan();
2679  else if (MATCH("TABLEFUNCSCAN", 13))
2680  return_value = _readTableFuncScan();
2681  else if (MATCH("CTESCAN", 7))
2682  return_value = _readCteScan();
2683  else if (MATCH("WORKTABLESCAN", 13))
2684  return_value = _readWorkTableScan();
2685  else if (MATCH("FOREIGNSCAN", 11))
2686  return_value = _readForeignScan();
2687  else if (MATCH("CUSTOMSCAN", 10))
2688  return_value = _readCustomScan();
2689  else if (MATCH("JOIN", 4))
2690  return_value = _readJoin();
2691  else if (MATCH("NESTLOOP", 8))
2692  return_value = _readNestLoop();
2693  else if (MATCH("MERGEJOIN", 9))
2694  return_value = _readMergeJoin();
2695  else if (MATCH("HASHJOIN", 8))
2696  return_value = _readHashJoin();
2697  else if (MATCH("MATERIAL", 8))
2698  return_value = _readMaterial();
2699  else if (MATCH("SORT", 4))
2700  return_value = _readSort();
2701  else if (MATCH("GROUP", 5))
2702  return_value = _readGroup();
2703  else if (MATCH("AGG", 3))
2704  return_value = _readAgg();
2705  else if (MATCH("WINDOWAGG", 9))
2706  return_value = _readWindowAgg();
2707  else if (MATCH("UNIQUE", 6))
2708  return_value = _readUnique();
2709  else if (MATCH("GATHER", 6))
2710  return_value = _readGather();
2711  else if (MATCH("GATHERMERGE", 11))
2712  return_value = _readGatherMerge();
2713  else if (MATCH("HASH", 4))
2714  return_value = _readHash();
2715  else if (MATCH("SETOP", 5))
2716  return_value = _readSetOp();
2717  else if (MATCH("LOCKROWS", 8))
2718  return_value = _readLockRows();
2719  else if (MATCH("LIMIT", 5))
2720  return_value = _readLimit();
2721  else if (MATCH("NESTLOOPPARAM", 13))
2722  return_value = _readNestLoopParam();
2723  else if (MATCH("PLANROWMARK", 11))
2724  return_value = _readPlanRowMark();
2725  else if (MATCH("PLANINVALITEM", 13))
2726  return_value = _readPlanInvalItem();
2727  else if (MATCH("SUBPLAN", 7))
2728  return_value = _readSubPlan();
2729  else if (MATCH("ALTERNATIVESUBPLAN", 18))
2730  return_value = _readAlternativeSubPlan();
2731  else if (MATCH("EXTENSIBLENODE", 14))
2732  return_value = _readExtensibleNode();
2733  else if (MATCH("PARTITIONBOUNDSPEC", 18))
2734  return_value = _readPartitionBoundSpec();
2735  else if (MATCH("PARTITIONRANGEDATUM", 19))
2736  return_value = _readPartitionRangeDatum();
2737  else
2738  {
2739  elog(ERROR, "badly formatted node string \"%.32s\"...", token);
2740  return_value = NULL; /* keep compiler quiet */
2741  }
2742 
2743  return (Node *) return_value;
2744 }
2745 
2746 
2747 /*
2748  * readDatum
2749  *
2750  * Given a string representation of a constant, recreate the appropriate
2751  * Datum. The string representation embeds length info, but not byValue,
2752  * so we must be told that.
2753  */
2754 Datum
2756 {
2757  Size length,
2758  i;
2759  int tokenLength;
2760  char *token;
2761  Datum res;
2762  char *s;
2763 
2764  /*
2765  * read the actual length of the value
2766  */
2767  token = pg_strtok(&tokenLength);
2768  length = atoui(token);
2769 
2770  token = pg_strtok(&tokenLength); /* read the '[' */
2771  if (token == NULL || token[0] != '[')
2772  elog(ERROR, "expected \"[\" to start datum, but got \"%s\"; length = %zu",
2773  token ? (const char *) token : "[NULL]", length);
2774 
2775  if (typbyval)
2776  {
2777  if (length > (Size) sizeof(Datum))
2778  elog(ERROR, "byval datum but length = %zu", length);
2779  res = (Datum) 0;
2780  s = (char *) (&res);
2781  for (i = 0; i < (Size) sizeof(Datum); i++)
2782  {
2783  token = pg_strtok(&tokenLength);
2784  s[i] = (char) atoi(token);
2785  }
2786  }
2787  else if (length <= 0)
2788  res = (Datum) NULL;
2789  else
2790  {
2791  s = (char *) palloc(length);
2792  for (i = 0; i < length; i++)
2793  {
2794  token = pg_strtok(&tokenLength);
2795  s[i] = (char) atoi(token);
2796  }
2797  res = PointerGetDatum(s);
2798  }
2799 
2800  token = pg_strtok(&tokenLength); /* read the ']' */
2801  if (token == NULL || token[0] != ']')
2802  elog(ERROR, "expected \"]\" to end datum, but got \"%s\"; length = %zu",
2803  token ? (const char *) token : "[NULL]", length);
2804 
2805  return res;
2806 }
2807 
2808 /*
2809  * readAttrNumberCols
2810  */
2811 AttrNumber *
2813 {
2814  int tokenLength,
2815  i;
2816  char *token;
2817  AttrNumber *attr_vals;
2818 
2819  if (numCols <= 0)
2820  return NULL;
2821 
2822  attr_vals = (AttrNumber *) palloc(numCols * sizeof(AttrNumber));
2823  for (i = 0; i < numCols; i++)
2824  {
2825  token = pg_strtok(&tokenLength);
2826  attr_vals[i] = atoi(token);
2827  }
2828 
2829  return attr_vals;
2830 }
2831 
2832 /*
2833  * readOidCols
2834  */
2835 Oid *
2836 readOidCols(int numCols)
2837 {
2838  int tokenLength,
2839  i;
2840  char *token;
2841  Oid *oid_vals;
2842 
2843  if (numCols <= 0)
2844  return NULL;
2845 
2846  oid_vals = (Oid *) palloc(numCols * sizeof(Oid));
2847  for (i = 0; i < numCols; i++)
2848  {
2849  token = pg_strtok(&tokenLength);
2850  oid_vals[i] = atooid(token);
2851  }
2852 
2853  return oid_vals;
2854 }
2855 
2856 /*
2857  * readIntCols
2858  */
2859 int *
2860 readIntCols(int numCols)
2861 {
2862  int tokenLength,
2863  i;
2864  char *token;
2865  int *int_vals;
2866 
2867  if (numCols <= 0)
2868  return NULL;
2869 
2870  int_vals = (int *) palloc(numCols * sizeof(int));
2871  for (i = 0; i < numCols; i++)
2872  {
2873  token = pg_strtok(&tokenLength);
2874  int_vals[i] = atoi(token);
2875  }
2876 
2877  return int_vals;
2878 }
2879 
2880 /*
2881  * readBoolCols
2882  */
2883 bool *
2884 readBoolCols(int numCols)
2885 {
2886  int tokenLength,
2887  i;
2888  char *token;
2889  bool *bool_vals;
2890 
2891  if (numCols <= 0)
2892  return NULL;
2893 
2894  bool_vals = (bool *) palloc(numCols * sizeof(bool));
2895  for (i = 0; i < numCols; i++)
2896  {
2897  token = pg_strtok(&tokenLength);
2898  bool_vals[i] = strtobool(token);
2899  }
2900 
2901  return bool_vals;
2902 }
static NullTest * _readNullTest(void)
Definition: readfuncs.c:1124
static JoinExpr * _readJoinExpr(void)
Definition: readfuncs.c:1281
static RangeVar * _readRangeVar(void)
Definition: readfuncs.c:458
#define atoui(x)
Definition: readfuncs.c:173
static RangeTblEntry * _readRangeTblEntry(void)
Definition: readfuncs.c:1382
static DefElem * _readDefElem(void)
Definition: readfuncs.c:1492
static RowExpr * _readRowExpr(void)
Definition: readfuncs.c:1018
int length(const List *list)
Definition: list.c:1333
static MergeJoin * _readMergeJoin(void)
Definition: readfuncs.c:2064
static MinMaxExpr * _readMinMaxExpr(void)
Definition: readfuncs.c:1069
PartitionPruneCombineOp
Definition: primnodes.h:1570
static RowMarkClause * _readRowMarkClause(void)
Definition: readfuncs.c:387
static FuncExpr * _readFuncExpr(void)
Definition: readfuncs.c:671
Plan plan
Definition: plannodes.h:342
#define READ_BOOL_ARRAY(fldname, len)
Definition: readfuncs.c:158
static Hash * _readHash(void)
Definition: readfuncs.c:2263
char * pg_strtok(int *length)
Definition: read.c:108
static Result * _readResult(void)
Definition: readfuncs.c:1582
static Query * _readQuery(void)
Definition: readfuncs.c:235
static RowCompareExpr * _readRowCompareExpr(void)
Definition: readfuncs.c:1035
static Param * _readParam(void)
Definition: readfuncs.c:565
static PlanInvalItem * _readPlanInvalItem(void)
Definition: readfuncs.c:2369
static PartitionPruneInfo * _readPartitionPruneInfo(void)
Definition: readfuncs.c:1358
ParamKind
Definition: primnodes.h:234
static WindowAgg * _readWindowAgg(void)
Definition: readfuncs.c:2176
static IndexScan * _readIndexScan(void)
Definition: readfuncs.c:1789
static NotifyStmt * _readNotifyStmt(void)
Definition: readfuncs.c:283
static Scan * _readScan(void)
Definition: readfuncs.c:1748
static NamedArgExpr * _readNamedArgExpr(void)
Definition: readfuncs.c:692
static LockRows * _readLockRows(void)
Definition: readfuncs.c:2303
static CurrentOfExpr * _readCurrentOfExpr(void)
Definition: readfuncs.c:1205
PartitionRangeDatumKind
Definition: parsenodes.h:834
#define READ_LONG_FIELD(fldname)
Definition: readfuncs.c:81
#define PointerGetDatum(X)
Definition: postgres.h:541
static CollateExpr * _readCollateExpr(void)
Definition: readfuncs.c:937
static SubqueryScan * _readSubqueryScan(void)
Definition: readfuncs.c:1877
BoolTestType
Definition: primnodes.h:1203
#define strtobool(x)
Definition: readfuncs.c:175
static BitmapIndexScan * _readBitmapIndexScan(void)
Definition: readfuncs.c:1829
static CaseExpr * _readCaseExpr(void)
Definition: readfuncs.c:952
static FunctionScan * _readFunctionScan(void)
Definition: readfuncs.c:1892
static PartitionBoundSpec * _readPartitionBoundSpec(void)
Definition: readfuncs.c:2454
#define READ_BOOL_FIELD(fldname)
Definition: readfuncs.c:112
XmlExprOp
Definition: primnodes.h:1129
QuerySource
Definition: parsenodes.h:40
static Unique * _readUnique(void)
Definition: readfuncs.c:2205
static MergeAppend * _readMergeAppend(void)
Definition: readfuncs.c:1663
Definition: nodes.h:517
#define READ_LOCALS_NO_FIELDS(nodeTypeName)
Definition: readfuncs.c:49
static WindowFunc * _readWindowFunc(void)
Definition: readfuncs.c:629
static WindowClause * _readWindowClause(void)
Definition: readfuncs.c:361
static OpExpr * _readOpExpr(void)
Definition: readfuncs.c:708
static IndexOnlyScan * _readIndexOnlyScan(void)
Definition: readfuncs.c:1810
static BitmapAnd * _readBitmapAnd(void)
Definition: readfuncs.c:1703
NullTestType
Definition: primnodes.h:1180
unsigned int Oid
Definition: postgres_ext.h:31
Definition: primnodes.h:164
static FromExpr * _readFromExpr(void)
Definition: readfuncs.c:1301
static Aggref * _readAggref(void)
Definition: readfuncs.c:583
SetOpStrategy
Definition: nodes.h:795
static NestLoop * _readNestLoop(void)
Definition: readfuncs.c:2049
OnCommitAction
Definition: primnodes.h:48
static ModifyTable * _readModifyTable(void)
Definition: readfuncs.c:1610
char relkind
Definition: pg_class.h:51
static NextValueExpr * _readNextValueExpr(void)
Definition: readfuncs.c:1220
JoinType
Definition: nodes.h:681
static DistinctExpr * _readDistinctExpr(void)
Definition: readfuncs.c:728
Oid * readOidCols(int numCols)
Definition: readfuncs.c:2836
static ArrayCoerceExpr * _readArrayCoerceExpr(void)
Definition: readfuncs.c:902
static TargetEntry * _readTargetEntry(void)
Definition: readfuncs.c:1249
#define newNode(size, tag)
Definition: nodes.h:555
static void ReadCommonPlan(Plan *local_node)
Definition: readfuncs.c:1545
static Agg * _readAgg(void)
Definition: readfuncs.c:2153
static SeqScan * _readSeqScan(void)
Definition: readfuncs.c:1761
MinMaxOp
Definition: primnodes.h:1062
SetOperation
Definition: parsenodes.h:1521
bool * readBoolCols(int numCols)
Definition: readfuncs.c:2884
static AlternativeSubPlan * _readAlternativeSubPlan(void)
Definition: readfuncs.c:2411
static CteScan * _readCteScan(void)
Definition: readfuncs.c:1938
static GroupingFunc * _readGroupingFunc(void)
Definition: readfuncs.c:612
#define ERROR
Definition: elog.h:43
static CoerceToDomain * _readCoerceToDomain(void)
Definition: readfuncs.c:1155
static SubLink * _readSubLink(void)
Definition: readfuncs.c:812
char relpersistence
Definition: pg_class.h:50
static HashJoin * _readHashJoin(void)
Definition: readfuncs.c:2089
#define READ_FLOAT_FIELD(fldname)
Definition: readfuncs.c:106
static PartitionPruneStepCombine * _readPartitionPruneStepCombine(void)
Definition: readfuncs.c:1346
static ValuesScan * _readValuesScan(void)
Definition: readfuncs.c:1908
static ConvertRowtypeExpr * _readConvertRowtypeExpr(void)
Definition: readfuncs.c:921
#define READ_OID_ARRAY(fldname, len)
Definition: readfuncs.c:148
static OnConflictExpr * _readOnConflictExpr(void)
Definition: readfuncs.c:1315
RTEKind
Definition: parsenodes.h:946
static NullIfExpr * _readNullIfExpr(void)
Definition: readfuncs.c:748
static Append * _readAppend(void)
Definition: readfuncs.c:1645
static ExtensibleNode * _readExtensibleNode(void)
Definition: readfuncs.c:2424
static PlanRowMark * _readPlanRowMark(void)
Definition: readfuncs.c:2349
static FieldSelect * _readFieldSelect(void)
Definition: readfuncs.c:834
int * readIntCols(int numCols)
Definition: readfuncs.c:2860
static ArrayRef * _readArrayRef(void)
Definition: readfuncs.c:651
ScanDirection
Definition: sdir.h:22
static CaseWhen * _readCaseWhen(void)
Definition: readfuncs.c:970
static SQLValueFunction * _readSQLValueFunction(void)
Definition: readfuncs.c:1087
#define READ_CHAR_FIELD(fldname)
Definition: readfuncs.c:93
AttrNumber * readAttrNumberCols(int numCols)
Definition: readfuncs.c:2812
#define MATCH(tokname, namelen)
#define atooid(x)
Definition: postgres_ext.h:42
static ForeignScan * _readForeignScan(void)
Definition: readfuncs.c:1969
static RelabelType * _readRelabelType(void)
Definition: readfuncs.c:867
WCOKind
Definition: parsenodes.h:1128
static SetOp * _readSetOp(void)
Definition: readfuncs.c:2281
#define READ_UINT_FIELD(fldname)
Definition: readfuncs.c:69
#define READ_ENUM_FIELD(fldname, enumtype)
Definition: readfuncs.c:100
Datum readDatum(bool typbyval)
Definition: readfuncs.c:2755
SQLValueFunctionOp
Definition: primnodes.h:1090
static SortGroupClause * _readSortGroupClause(void)
Definition: readfuncs.c:329
#define READ_NODE_FIELD(fldname)
Definition: readfuncs.c:131
SubLinkType
Definition: primnodes.h:619
Bitmapset * readBitmapset(void)
Definition: readfuncs.c:226
static Limit * _readLimit(void)
Definition: readfuncs.c:2319
static PartitionRangeDatum * _readPartitionRangeDatum(void)
Definition: readfuncs.c:2474
LockClauseStrength
Definition: lockoptions.h:21
static void ReadCommonScan(Scan *local_node)
Definition: readfuncs.c:1735
uintptr_t Datum
Definition: postgres.h:367
static void ReadCommonJoin(Join *local_node)
Definition: readfuncs.c:2021
static GatherMerge * _readGatherMerge(void)
Definition: readfuncs.c:2241
static DeclareCursorStmt * _readDeclareCursorStmt(void)
Definition: readfuncs.c:297
static Gather * _readGather(void)
Definition: readfuncs.c:2222
#define READ_TEMP_LOCALS()
Definition: readfuncs.c:53
static struct @131 value
#define READ_UINT64_FIELD(fldname)
Definition: readfuncs.c:75
const char * extnodename
Definition: extensible.h:35
static Var * _readVar(void)
Definition: readfuncs.c:519
#define READ_LOCATION_FIELD(fldname)
Definition: readfuncs.c:124
RowCompareType
Definition: primnodes.h:1025
static SampleScan * _readSampleScan(void)
Definition: readfuncs.c:1774
static SubPlan * _readSubPlan(void)
Definition: readfuncs.c:2383
#define READ_LOCALS(nodeTypeName)
Definition: readfuncs.c:58
static TidScan * _readTidScan(void)
Definition: readfuncs.c:1862
static CoerceToDomainValue * _readCoerceToDomainValue(void)
Definition: readfuncs.c:1173
static TableFuncScan * _readTableFuncScan(void)
Definition: readfuncs.c:1923
static IntoClause * _readIntoClause(void)
Definition: readfuncs.c:500
static Const * _readConst(void)
Definition: readfuncs.c:540
static SetOperationStmt * _readSetOperationStmt(void)
Definition: readfuncs.c:425
static PlannedStmt * _readPlannedStmt(void)
Definition: readfuncs.c:1509
XmlOptionType
Definition: primnodes.h:1141
void(* nodeRead)(struct ExtensibleNode *node)
Definition: extensible.h:70
size_t Size
Definition: c.h:433
static Material * _readMaterial(void)
Definition: readfuncs.c:2104
AggSplit
Definition: nodes.h:765
#define READ_OID_FIELD(fldname)
Definition: readfuncs.c:87
static int list_length(const List *l)
Definition: pg_list.h:89
static CaseTestExpr * _readCaseTestExpr(void)
Definition: readfuncs.c:985
RowMarkType
Definition: plannodes.h:984
static Alias * _readAlias(void)
Definition: readfuncs.c:447
static BitmapOr * _readBitmapOr(void)
Definition: readfuncs.c:1718
static const struct fns functions
Definition: regcomp.c:299
static RangeTblRef * _readRangeTblRef(void)
Definition: readfuncs.c:1268
static RecursiveUnion * _readRecursiveUnion(void)
Definition: readfuncs.c:1684
Bitmapset * bms_add_member(Bitmapset *a, int x)
Definition: bitmapset.c:764
static FieldStore * _readFieldStore(void)
Definition: readfuncs.c:851
static CoalesceExpr * _readCoalesceExpr(void)
Definition: readfuncs.c:1053
const char * name
Definition: encode.c:521
#define READ_BITMAPSET_FIELD(fldname)
Definition: readfuncs.c:137
Node * parseNodeString(void)
Definition: readfuncs.c:2494
static SetToDefault * _readSetToDefault(void)
Definition: readfuncs.c:1189
static WithCheckOption * _readWithCheckOption(void)
Definition: readfuncs.c:312
static PartitionPruneStepOp * _readPartitionPruneStepOp(void)
Definition: readfuncs.c:1332
static InferenceElem * _readInferenceElem(void)
Definition: readfuncs.c:1234
AggStrategy
Definition: nodes.h:743
static ScalarArrayOpExpr * _readScalarArrayOpExpr(void)
Definition: readfuncs.c:768
void * palloc(Size size)
Definition: mcxt.c:924
int xmloption
Definition: xml.c:97
SetOpCmd
Definition: nodes.h:787
int i
static BoolExpr * _readBoolExpr(void)
Definition: readfuncs.c:786
static CustomScan * _readCustomScan(void)
Definition: readfuncs.c:1991
DefElemAction
Definition: parsenodes.h:718
void * arg
static CommonTableExpr * _readCommonTableExpr(void)
Definition: readfuncs.c:403
static ArrayExpr * _readArrayExpr(void)
Definition: readfuncs.c:1000
GroupingSetKind
Definition: parsenodes.h:1264
#define READ_STRING_FIELD(fldname)
Definition: readfuncs.c:118
#define READ_DONE()
Definition: readfuncs.c:163
#define READ_INT_FIELD(fldname)
Definition: readfuncs.c:63
Definition: plannodes.h:794
#define elog
Definition: elog.h:219
static RangeTblFunction * _readRangeTblFunction(void)
Definition: readfuncs.c:1458
static BooleanTest * _readBooleanTest(void)
Definition: readfuncs.c:1140
static Plan * _readPlan(void)
Definition: readfuncs.c:1569
static XmlExpr * _readXmlExpr(void)
Definition: readfuncs.c:1103
#define READ_ATTRNUMBER_ARRAY(fldname, len)
Definition: readfuncs.c:143
CoercionForm
Definition: primnodes.h:437
static TableFunc * _readTableFunc(void)
Definition: readfuncs.c:478
#define READ_INT_ARRAY(fldname, len)
Definition: readfuncs.c:153
const CustomScanMethods * GetCustomScanMethods(const char *CustomName, bool missing_ok)
Definition: extensible.c:137
static TableSampleClause * _readTableSampleClause(void)
Definition: readfuncs.c:1477
static NestLoopParam * _readNestLoopParam(void)
Definition: readfuncs.c:2335
static ProjectSet * _readProjectSet(void)
Definition: readfuncs.c:1597
OnConflictAction
Definition: nodes.h:807
static BitmapHeapScan * _readBitmapHeapScan(void)
Definition: readfuncs.c:1847
int16 AttrNumber
Definition: attnum.h:21
LockWaitPolicy
Definition: lockoptions.h:36
long val
Definition: informix.c:689
static Bitmapset * _readBitmapset(void)
Definition: readfuncs.c:185
CmdType
Definition: nodes.h:657
static Join * _readJoin(void)
Definition: readfuncs.c:2036
static Sort * _readSort(void)
Definition: readfuncs.c:2117
static CoerceViaIO * _readCoerceViaIO(void)
Definition: readfuncs.c:885
static Group * _readGroup(void)
Definition: readfuncs.c:2136
static GroupingSet * _readGroupingSet(void)
Definition: readfuncs.c:346
static WorkTableScan * _readWorkTableScan(void)
Definition: readfuncs.c:1954
const ExtensibleNodeMethods * GetExtensibleNodeMethods(const char *extnodename, bool missing_ok)
Definition: extensible.c:125
#define nullable_string(token, length)
Definition: readfuncs.c:177
Plan plan
Definition: plannodes.h:680
OverridingKind
Definition: parsenodes.h:32
bool typbyval
Definition: pg_type.h:65