Don't include execnodes.h in replication/conflict.h
authorÁlvaro Herrera <alvherre@kurilemu.de>
Thu, 25 Sep 2025 12:45:08 +0000 (14:45 +0200)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Thu, 25 Sep 2025 12:52:41 +0000 (14:52 +0200)
... which silently propagates a lot of headers into many places
via pgstat.h, as evidenced by the variety of headers that this patch
needs to add to seemingly random places.  Add a minimum of typedefs to
conflict.h to be able to remove execnodes.h, and fix the fallout.

Backpatch to 18, where conflict.h first appeared.

Discussion: https://postgr.es/m/202509191927.uj2ijwmho7nv@alvherre.pgsql

src/backend/access/transam/multixact.c
src/backend/access/transam/xlogrecovery.c
src/backend/storage/ipc/waiteventset.c
src/backend/utils/activity/pgstat_backend.c
src/include/pgstat.h
src/include/replication/conflict.h

index 8bf59d369f84849299f7bb09d908f6d9cd4f7acd..9d5f130af7efeeb057a3990d6ecd728e4e233124 100644 (file)
@@ -79,6 +79,7 @@
 #include "pg_trace.h"
 #include "pgstat.h"
 #include "postmaster/autovacuum.h"
+#include "storage/condition_variable.h"
 #include "storage/pmsignal.h"
 #include "storage/proc.h"
 #include "storage/procarray.h"
index 346319338a0ee253f9e411ef3170133e2c38c46e..52ff4d119e6f9369cf1cca1eed80af2c2b4bedc2 100644 (file)
@@ -45,6 +45,7 @@
 #include "commands/tablespace.h"
 #include "common/file_utils.h"
 #include "miscadmin.h"
+#include "nodes/miscnodes.h"
 #include "pgstat.h"
 #include "postmaster/bgwriter.h"
 #include "postmaster/startup.h"
index 7c0e66900f98d9b7606a06a7b6d5fe0d11fd5a78..b0746521ae4251b459f85429661bb80e8227de4d 100644 (file)
@@ -67,6 +67,7 @@
 #include "libpq/pqsignal.h"
 #include "miscadmin.h"
 #include "pgstat.h"
+#include "port/atomics.h"
 #include "portability/instr_time.h"
 #include "postmaster/postmaster.h"
 #include "storage/fd.h"
index 07a1116671b1887a797b291c1d6ec7c1a3e5f4d8..a864ae8e6a6087112f104dd591b103289a70ef69 100644 (file)
@@ -25,6 +25,7 @@
 #include "postgres.h"
 
 #include "access/xlog.h"
+#include "executor/instrument.h"
 #include "storage/bufmgr.h"
 #include "storage/proc.h"
 #include "storage/procarray.h"
index f402b17295c89fd13d984c1cb068049da52e8676..e4a59a30b8c632a5621bd5221a4c9dd73dc7fc19 100644 (file)
@@ -11,6 +11,7 @@
 #ifndef PGSTAT_H
 #define PGSTAT_H
 
+#include "access/transam.h"        /* for FullTransactionId */
 #include "datatype/timestamp.h"
 #include "portability/instr_time.h"
 #include "postmaster/pgarch.h" /* for MAX_XFN_CHARS */
index e516caa5c73fc132317dd64c14302ec4325f6926..c8fbf9e51b8d9b45d1ca3b39f3f5c68af1bff0bb 100644 (file)
@@ -9,9 +9,16 @@
 #ifndef CONFLICT_H
 #define CONFLICT_H
 
-#include "nodes/execnodes.h"
+#include "access/xlogdefs.h"
+#include "nodes/pg_list.h"
 #include "utils/timestamp.h"
 
+/* Avoid including execnodes.h here */
+typedef struct EState EState;
+typedef struct ResultRelInfo ResultRelInfo;
+typedef struct TupleTableSlot TupleTableSlot;
+
+
 /*
  * Conflict types that could occur while applying remote changes.
  *