Do a tiny bit of header file maintenance
authorÁlvaro Herrera <[email protected]>
Tue, 30 Sep 2025 10:28:29 +0000 (12:28 +0200)
committerÁlvaro Herrera <[email protected]>
Tue, 30 Sep 2025 10:28:29 +0000 (12:28 +0200)
Stop including utils/relcache.h in access/genam.h, and stop including
htup_details.h in nodes/tidbitmap.h.  Both these files (genam.h and
tidbitmap.h) are widely used in other header files, so it's in our best
interest that they remain as lean as reasonable.

Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/202509291356[email protected]

contrib/btree_gist/btree_bit.c
src/backend/nodes/tidbitmap.c
src/backend/utils/adt/network_spgist.c
src/include/access/amapi.h
src/include/access/genam.h
src/include/access/nbtree.h
src/include/nodes/tidbitmap.h

index 0df2ae20d8b21a584bf63ce21f94d5fdd50deaf0..9199f8860975d8320d6b819c4acbd4e03cecfac4 100644 (file)
@@ -8,6 +8,7 @@
 #include "utils/fmgrprotos.h"
 #include "utils/sortsupport.h"
 #include "utils/varbit.h"
+#include "varatt.h"
 
 /* GiST support functions */
 PG_FUNCTION_INFO_V1(gbt_bit_compress);
index 41031aa8f2fa85dd34989ee4299a996b4eb8cb8a..fac2ba5d0caaeb7c2aebaccd90b2ae859dd1fa48 100644 (file)
@@ -40,6 +40,7 @@
 
 #include <limits.h>
 
+#include "access/htup_details.h"
 #include "common/hashfn.h"
 #include "common/int.h"
 #include "nodes/bitmapset.h"
index 602276a35c3eab2f00793c17bd60b445bc44cc87..a84747d927586fb1fb9841f9ce8b6030f6dc7056 100644 (file)
@@ -37,6 +37,7 @@
 #include "catalog/pg_type.h"
 #include "utils/fmgrprotos.h"
 #include "utils/inet.h"
+#include "varatt.h"
 
 
 static int inet_spg_node_number(const inet *val, int commonbits);
index 2b4482dc1e62b05f44bbb9ddcad6d6f4a3d2610d..63dd41c1f21bf38d56a6cc3965d053734f8f7c4c 100644 (file)
@@ -15,6 +15,8 @@
 #include "access/cmptype.h"
 #include "access/genam.h"
 #include "access/stratnum.h"
+#include "nodes/nodes.h"
+#include "nodes/pg_list.h"
 
 /*
  * We don't wish to include planner header files here, since most of an index
index ac62f6a6abdb77fa8701944c5ecdaf17f9ca794a..9200a22bd9f95d2564fe85ff41151ac702d49f66 100644 (file)
 #include "nodes/tidbitmap.h"
 #include "storage/buf.h"
 #include "storage/lockdefs.h"
-#include "utils/relcache.h"
 #include "utils/snapshot.h"
 
 /* We don't want this file to depend on execnodes.h. */
 typedef struct IndexInfo IndexInfo;
 typedef struct TupleTableSlot TupleTableSlot;
 
+/* or relcache.h */
+typedef struct RelationData *Relation;
+
 
 /*
  * Struct for statistics maintained by amgettuple and amgetbitmap
index 9ab467cb8fdecfca743259a2c486072bd68775e0..db1345f54c8e730a7d02bb4ace075c394f99a672 100644 (file)
@@ -22,6 +22,7 @@
 #include "catalog/pg_index.h"
 #include "lib/stringinfo.h"
 #include "storage/bufmgr.h"
+#include "storage/dsm.h"
 #include "storage/shm_toc.h"
 #include "utils/skipsupport.h"
 
index 99f795ceab526925972a9a3ca4416db9111ca77e..f54e61c719040e84d642a3883c9026830d861fda 100644 (file)
@@ -22,7 +22,6 @@
 #ifndef TIDBITMAP_H
 #define TIDBITMAP_H
 
-#include "access/htup_details.h"
 #include "storage/itemptr.h"
 #include "utils/dsa.h"