From 91e64abae71ecc6676c6e9ef16a803f5ce0c4d9a Mon Sep 17 00:00:00 2001
From: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Date: Thu, 26 Feb 2026 10:20:09 +0530
Subject: [PATCH v20260226 3/4] Move GraphTableParseState to parsenodes.h ...
 and add comments describing it.

---
 src/include/nodes/parsenodes.h  |  7 -------
 src/include/parser/parse_node.h | 15 +++++++++++++++
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 70aebd42435..6c1c7516dc1 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -4562,11 +4562,4 @@ typedef struct WaitStmt
 	List	   *options;		/* List of DefElem nodes */
 } WaitStmt;
 
-
-typedef struct GraphTableParseState
-{
-	Oid			graphid;
-	List	   *variables;
-} GraphTableParseState;
-
 #endif							/* PARSENODES_H */
diff --git a/src/include/parser/parse_node.h b/src/include/parser/parse_node.h
index b3ce4ebd15e..fc2cbeb2083 100644
--- a/src/include/parser/parse_node.h
+++ b/src/include/parser/parse_node.h
@@ -96,6 +96,21 @@ typedef Node *(*CoerceParamHook) (ParseState *pstate, Param *param,
 								  Oid targetTypeId, int32 targetTypeMod,
 								  int location);
 
+/*
+ * Namespace for the GRAPH_TABLE reference being transformed.
+ *
+ * Labels, properties and variables used in the GRAPH_TABLE form the namespace.
+ * The names of the labels and properties used in GRAPH_TABLE are looked up using
+ * the OID of the property graph. Variables are collected in a list as graph
+ * patterns are transformed. This namespace is used to resolve label and property
+ * references in the GRAPH_TABLE.
+ */
+typedef struct GraphTableParseState
+{
+	Oid			graphid;		/* OID of the graph being referenced */
+	List	   *variables;		/* list of element pattern variables in
+								 * GRAPH_TABLE */
+} GraphTableParseState;
 
 /*
  * State information used during parse analysis
-- 
2.34.1

