nocfbot-0002-drop-unused-includes.txt

text/plain

Filename: nocfbot-0002-drop-unused-includes.txt
Type: text/plain
Part: 1
Message: Re: Row pattern recognition
From 4a572e7fbe0207ddd26fbbde02e1f8d9bfd68ddc Mon Sep 17 00:00:00 2001
From: Henson Choi <assam258@gmail.com>
Date: Wed, 17 Jun 2026 08:16:57 +0900
Subject: [PATCH nocfbot 2/4] Remove unnecessary includes from the row pattern
 recognition patch

Drop includes that are unused or covered by existing forward typedefs:
condition_variable.h, hsearch.h, queryenvironment.h from execnodes.h;
<limits.h> from rpr.c; windowapi.h from execRPR.h.  Switch rpr.h from
parsenodes.h to primnodes.h, where RPRNavExpr is actually defined.
---
 src/backend/optimizer/plan/rpr.c | 2 --
 src/include/executor/execRPR.h   | 1 -
 src/include/nodes/execnodes.h    | 3 ---
 src/include/optimizer/rpr.h      | 7 ++++---
 4 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/backend/optimizer/plan/rpr.c b/src/backend/optimizer/plan/rpr.c
index 175777a8ffc..50bca59451f 100644
--- a/src/backend/optimizer/plan/rpr.c
+++ b/src/backend/optimizer/plan/rpr.c
@@ -37,8 +37,6 @@
 
 #include "postgres.h"
 
-#include <limits.h>
-
 #include "catalog/pg_proc.h"
 #include "mb/pg_wchar.h"
 #include "miscadmin.h"
diff --git a/src/include/executor/execRPR.h b/src/include/executor/execRPR.h
index 7b2b0febb76..fb7dc63a4c6 100644
--- a/src/include/executor/execRPR.h
+++ b/src/include/executor/execRPR.h
@@ -15,7 +15,6 @@
 #define EXECRPR_H
 
 #include "nodes/execnodes.h"
-#include "windowapi.h"
 
 /* NFA context management */
 extern RPRNFAContext *ExecRPRStartContext(WindowAggState *winstate,
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 010fc262b25..b587c3dc15b 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -38,9 +38,6 @@
 #include "nodes/plannodes.h"
 #include "partitioning/partdefs.h"
 #include "storage/buf.h"
-#include "storage/condition_variable.h"
-#include "utils/hsearch.h"
-#include "utils/queryenvironment.h"
 #include "utils/reltrigger.h"
 #include "utils/typcache.h"
 
diff --git a/src/include/optimizer/rpr.h b/src/include/optimizer/rpr.h
index 802d2f1dd69..b4f87d8caa4 100644
--- a/src/include/optimizer/rpr.h
+++ b/src/include/optimizer/rpr.h
@@ -10,11 +10,12 @@
  *
  *-------------------------------------------------------------------------
  */
-#ifndef OPTIMIZER_RPR_H
-#define OPTIMIZER_RPR_H
+#ifndef RPR_H
+#define RPR_H
 
 #include "nodes/parsenodes.h"
 #include "nodes/plannodes.h"
+#include "nodes/primnodes.h"
 
 /* Limits and special values */
 /*
@@ -96,4 +97,4 @@ typedef struct NavTraversal
 
 extern bool nav_traversal_walker(Node *node, void *ctx);
 
-#endif							/* OPTIMIZER_RPR_H */
+#endif							/* RPR_H */
-- 
2.50.1 (Apple Git-155)