diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index e62fe81882111cb50d2dab7a006d8558d835fcf2..3b30d4f81c02b5c882ffd6facb5b693b50a95364 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -1352,12 +1352,15 @@ _outFromExpr(StringInfo str, FromExpr *node)
 /*
  * print the basic stuff of all nodes that inherit from Path
  *
- * Note we do NOT print the parent, else we'd be in infinite recursion
+ * Note we do NOT print the parent, else we'd be in infinite recursion.
+ * We can print the parent's relids for identification purposes, though.
  */
 static void
 _outPathInfo(StringInfo str, Path *node)
 {
 	WRITE_ENUM_FIELD(pathtype, NodeTag);
+	appendStringInfo(str, " :parent_relids ");
+	_outBitmapset(str, node->parent->relids);
 	WRITE_FLOAT_FIELD(startup_cost, "%.2f");
 	WRITE_FLOAT_FIELD(total_cost, "%.2f");
 	WRITE_NODE_FIELD(pathkeys);