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