* have an output function defined here (as well as an input function
* in readfuncs.c). In addition, plan nodes should have input and
* output functions so that they can be sent to parallel workers.
+ *
* For use in debugging, we also provide output functions for nodes
- * that appear in raw parsetrees and path. These nodes however need
- * not have input functions.
+ * that appear in raw parsetrees and planner Paths. These node types
+ * need not have input functions. Output support for raw parsetrees
+ * is somewhat incomplete, too; in particular, utility statements are
+ * almost entirely unsupported. We try to support everything that can
+ * appear in a raw SELECT, though.
*
*-------------------------------------------------------------------------
*/
WRITE_LOCATION_FIELD(location);
}
+/*
+ * Node types found in raw parse trees (supported for debug purposes)
+ */
+
+static void
+_outRawStmt(StringInfo str, const RawStmt *node)
+{
+ WRITE_NODE_TYPE("RAWSTMT");
+
+ WRITE_NODE_FIELD(stmt);
+ WRITE_LOCATION_FIELD(stmt_location);
+ WRITE_INT_FIELD(stmt_len);
+}
+
static void
_outAConst(StringInfo str, const A_Const *node)
{
case T_ParamRef:
_outParamRef(str, obj);
break;
+ case T_RawStmt:
+ _outRawStmt(str, obj);
+ break;
case T_A_Const:
_outAConst(str, obj);
break;