]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
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:19 +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 3c06ac45532f8ca60449bad6e677553773319840..f94445bdd07d088edbd169a8e9dc87169c34094e 100644 (file)
@@ -84,6 +84,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 6ce979f2d8bc4b2ed260a9b482a993893a8d1e55..efbe77a5747791cc88cc3deb124d191415f3b695 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 378f2f2c2ba242e321fc81abf2895d9ae8e51817..3a302c2cab0225c712b8a542ca17a684a0bf7bb4 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 f6448ce4ada752ccabdc92734c340639ea9d8c4b..4d4e817b0f2cd7a1371fe42687b55a020f7442f6 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 */
+struct EState;
+struct ResultRelInfo;
+struct TupleTableSlot;
+
+
 /*
  * Conflict types that could occur while applying remote changes.
  *
@@ -58,8 +65,8 @@ typedef enum
  */
 typedef struct ConflictTupleInfo
 {
-       TupleTableSlot *slot;           /* tuple slot holding the conflicting local
-                                                                * tuple */
+       struct TupleTableSlot *slot;    /* tuple slot holding the conflicting
+                                                                        * local tuple */
        Oid                     indexoid;               /* OID of the index where the conflict
                                                                 * occurred */
        TransactionId xmin;                     /* transaction ID of the modification causing
@@ -69,14 +76,15 @@ typedef struct ConflictTupleInfo
                                                                 * conflicting local row occurred */
 } ConflictTupleInfo;
 
-extern bool GetTupleTransactionInfo(TupleTableSlot *localslot,
+extern bool GetTupleTransactionInfo(struct TupleTableSlot *localslot,
                                                                        TransactionId *xmin,
                                                                        RepOriginId *localorigin,
                                                                        TimestampTz *localts);
-extern void ReportApplyConflict(EState *estate, ResultRelInfo *relinfo,
+extern void ReportApplyConflict(struct EState *estate, struct ResultRelInfo *relinfo,
                                                                int elevel, ConflictType type,
-                                                               TupleTableSlot *searchslot,
-                                                               TupleTableSlot *remoteslot,
+                                                               struct TupleTableSlot *searchslot,
+                                                               struct TupleTableSlot *remoteslot,
                                                                List *conflicttuples);
-extern void InitConflictIndexes(ResultRelInfo *relInfo);
+extern void InitConflictIndexes(struct ResultRelInfo *relInfo);
+
 #endif