On 7/5/26 9:27 PM, Dongpo Liu wrote:
Hi hackers,

While reading the ANALYZE code, I noticed that
src/backend/commands/analyze.c still includes storage/procarray.h,
but nothing in the file uses it anymore.

Commit 284925508ae removed the call to
GetOldestNonRemovableTransactionId() from acquire_sample_rows(), which
was the last reference to anything declared in that header. The #include
was left behind.

The attached patch removes it. The file compiles cleanly without it,
and I verified that no other symbol from procarray.h is referenced there.

Agree.

Furthermore, I also discovered that there are other files that contain this unnecessary references. Please take a look at the new patch in the attachment.

--
Quan Zongliang
diff --git a/contrib/amcheck/verify_heapam.c b/contrib/amcheck/verify_heapam.c
index 20ff58aa782..e0bacf02035 100644
--- a/contrib/amcheck/verify_heapam.c
+++ b/contrib/amcheck/verify_heapam.c
@@ -25,7 +25,6 @@
 #include "miscadmin.h"
 #include "storage/bufmgr.h"
 #include "storage/lwlock.h"
-#include "storage/procarray.h"
 #include "storage/read_stream.h"
 #include "utils/builtins.h"
 #include "utils/fmgroids.h"
diff --git a/contrib/pg_visibility/pg_visibility.c 
b/contrib/pg_visibility/pg_visibility.c
index dfab0b64cf5..042d0913b8d 100644
--- a/contrib/pg_visibility/pg_visibility.c
+++ b/contrib/pg_visibility/pg_visibility.c
@@ -20,7 +20,6 @@
 #include "miscadmin.h"
 #include "storage/bufmgr.h"
 #include "storage/proc.h"
-#include "storage/procarray.h"
 #include "storage/read_stream.h"
 #include "storage/smgr.h"
 #include "utils/rel.h"
diff --git a/contrib/pgrowlocks/pgrowlocks.c b/contrib/pgrowlocks/pgrowlocks.c
index d164c4c03ad..acdc2be41f1 100644
--- a/contrib/pgrowlocks/pgrowlocks.c
+++ b/contrib/pgrowlocks/pgrowlocks.c
@@ -35,7 +35,6 @@
 #include "funcapi.h"
 #include "miscadmin.h"
 #include "storage/bufmgr.h"
-#include "storage/procarray.h"
 #include "utils/acl.h"
 #include "utils/fmgrprotos.h"
 #include "utils/rel.h"
diff --git a/contrib/pgstattuple/pgstatapprox.c 
b/contrib/pgstattuple/pgstatapprox.c
index 21e0b50fb4b..d59a12470e5 100644
--- a/contrib/pgstattuple/pgstatapprox.c
+++ b/contrib/pgstattuple/pgstatapprox.c
@@ -22,7 +22,6 @@
 #include "miscadmin.h"
 #include "storage/bufmgr.h"
 #include "storage/freespace.h"
-#include "storage/procarray.h"
 #include "storage/read_stream.h"
 
 PG_FUNCTION_INFO_V1(pgstattuple_approx);
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c
index f66e80b757c..e3e30839923 100644
--- a/src/backend/commands/analyze.c
+++ b/src/backend/commands/analyze.c
@@ -44,7 +44,6 @@
 #include "statistics/extended_stats_internal.h"
 #include "statistics/statistics.h"
 #include "storage/bufmgr.h"
-#include "storage/procarray.h"
 #include "utils/attoptcache.h"
 #include "utils/datum.h"
 #include "utils/guc.h"
diff --git a/src/backend/replication/logical/logicalctl.c 
b/src/backend/replication/logical/logicalctl.c
index 624965ef95d..64167512a46 100644
--- a/src/backend/replication/logical/logicalctl.c
+++ b/src/backend/replication/logical/logicalctl.c
@@ -70,7 +70,6 @@
 #include "storage/ipc.h"
 #include "storage/lmgr.h"
 #include "storage/proc.h"
-#include "storage/procarray.h"
 #include "storage/procsignal.h"
 #include "storage/subsystems.h"
 #include "utils/injection_point.h"
diff --git a/src/test/modules/injection_points/regress_injection.c 
b/src/test/modules/injection_points/regress_injection.c
index 0c3113eac2f..f9cd7dac250 100644
--- a/src/test/modules/injection_points/regress_injection.c
+++ b/src/test/modules/injection_points/regress_injection.c
@@ -18,7 +18,6 @@
 #include "fmgr.h"
 #include "miscadmin.h"
 #include "postmaster/autovacuum.h"
-#include "storage/procarray.h"
 #include "utils/rel.h"
 #include "utils/xid8.h"
 

Reply via email to