]> granicus.if.org Git - postgresql/blobdiff - src/backend/nodes/outfuncs.c
Change representation of statement lists, and add statement location info.
[postgresql] / src / backend / nodes / outfuncs.c
index 0d858f592067a2ea471149ed21e05b1b262d5075..cf0a6059e91f280499946bfe51872423d09d5245 100644 (file)
@@ -3,7 +3,7 @@
  * outfuncs.c
  *       Output functions for Postgres tree nodes.
  *
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
@@ -252,13 +252,15 @@ _outPlannedStmt(StringInfo str, const PlannedStmt *node)
        WRITE_NODE_FIELD(planTree);
        WRITE_NODE_FIELD(rtable);
        WRITE_NODE_FIELD(resultRelations);
-       WRITE_NODE_FIELD(utilityStmt);
        WRITE_NODE_FIELD(subplans);
        WRITE_BITMAPSET_FIELD(rewindPlanIDs);
        WRITE_NODE_FIELD(rowMarks);
        WRITE_NODE_FIELD(relationOids);
        WRITE_NODE_FIELD(invalItems);
        WRITE_INT_FIELD(nParamExec);
+       WRITE_NODE_FIELD(utilityStmt);
+       WRITE_LOCATION_FIELD(stmt_location);
+       WRITE_LOCATION_FIELD(stmt_len);
 }
 
 /*
@@ -939,7 +941,7 @@ _outRangeVar(StringInfo str, const RangeVar *node)
         */
        WRITE_STRING_FIELD(schemaname);
        WRITE_STRING_FIELD(relname);
-       WRITE_ENUM_FIELD(inhOpt, InhOption);
+       WRITE_BOOL_FIELD(inh);
        WRITE_CHAR_FIELD(relpersistence);
        WRITE_NODE_FIELD(alias);
        WRITE_LOCATION_FIELD(location);
@@ -2705,6 +2707,9 @@ _outQuery(StringInfo str, const Query *node)
        WRITE_NODE_FIELD(rowMarks);
        WRITE_NODE_FIELD(setOperations);
        WRITE_NODE_FIELD(constraintDeps);
+       /* withCheckOptions intentionally omitted, see comment in parsenodes.h */
+       WRITE_LOCATION_FIELD(stmt_location);
+       WRITE_LOCATION_FIELD(stmt_len);
 }
 
 static void
@@ -2841,15 +2846,17 @@ _outRangeTblEntry(StringInfo str, const RangeTblEntry *node)
                        break;
                case RTE_VALUES:
                        WRITE_NODE_FIELD(values_lists);
-                       WRITE_NODE_FIELD(values_collations);
+                       WRITE_NODE_FIELD(coltypes);
+                       WRITE_NODE_FIELD(coltypmods);
+                       WRITE_NODE_FIELD(colcollations);
                        break;
                case RTE_CTE:
                        WRITE_STRING_FIELD(ctename);
                        WRITE_UINT_FIELD(ctelevelsup);
                        WRITE_BOOL_FIELD(self_reference);
-                       WRITE_NODE_FIELD(ctecoltypes);
-                       WRITE_NODE_FIELD(ctecoltypmods);
-                       WRITE_NODE_FIELD(ctecolcollations);
+                       WRITE_NODE_FIELD(coltypes);
+                       WRITE_NODE_FIELD(coltypmods);
+                       WRITE_NODE_FIELD(colcollations);
                        break;
                default:
                        elog(ERROR, "unrecognized RTE kind: %d", (int) node->rtekind);