]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Stop including {brin,gin}_tuple.h in tuplesort.h
authorÁlvaro Herrera <alvherre@kurilemu.de>
Mon, 12 Jan 2026 17:09:36 +0000 (18:09 +0100)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Mon, 12 Jan 2026 17:09:49 +0000 (18:09 +0100)
Doing this meant that those two headers, which are supposed to be
internal to their corresponding index AMs, were being included pretty
much universally, because tuplesort.h is included by execnodes.h which
is very widely used.  Stop that, and fix fallout.

We also change indexing.h to no longer include execnodes.h (tuptable.h
is sufficient), and relscan.h to no longer include buf.h (pointless
since c2fe139c201c).

Author: Mario González <gonzalemario@gmail.com>
Discussion: https://postgr.es/m/CAFsReFUcBFup=Ohv_xd7SNQ=e73TXi8YNEkTsFEE2BW7jS1noQ@mail.gmail.com

15 files changed:
contrib/pageinspect/gistfuncs.c
src/backend/access/gin/gininsert.c
src/backend/catalog/pg_attrdef.c
src/backend/catalog/pg_largeobject.c
src/backend/commands/collationcmds.c
src/backend/commands/user.c
src/backend/executor/execReplication.c
src/backend/parser/parse_expr.c
src/backend/replication/logical/relation.c
src/backend/replication/logical/sequencesync.c
src/backend/statistics/stat_utils.c
src/include/access/relscan.h
src/include/catalog/indexing.h
src/include/nodes/execnodes.h
src/include/utils/tuplesort.h

index 60a4b24030240b1a6de501c13bdd2cc712fd7f03..e7759488c36b2e5145591952c0052e43533b23f0 100644 (file)
@@ -9,6 +9,7 @@
  */
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "access/gist.h"
 #include "access/htup.h"
 #include "access/htup_details.h"
index c08ea927ac53d956b251268946462feb2f1bce8e..0d63fb4ba27b6f50c59666b6c7ca52520e4a6a19 100644 (file)
@@ -31,8 +31,9 @@
 #include "tcop/tcopprot.h"
 #include "utils/datum.h"
 #include "utils/memutils.h"
-#include "utils/rel.h"
 #include "utils/builtins.h"
+#include "utils/rel.h"
+#include "utils/typcache.h"
 
 
 /* Magic numbers for parallel state sharing */
index b62f19bb803b189f59238394957b6a144bba7a2f..24815090d3d79a5e71efbad9f2f7e231a97f4152 100644 (file)
@@ -14,6 +14,7 @@
  */
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "access/htup_details.h"
 #include "access/relation.h"
 #include "access/table.h"
index 0f14ea198de2336cc3fd1a945465f80df284345b..0e1dd22d9082a50c0ab26f26d91a19216f328b56 100644 (file)
@@ -14,6 +14,7 @@
  */
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "access/htup_details.h"
 #include "access/table.h"
 #include "catalog/catalog.h"
index 980cc3ac62758ad8c808f2e9f89e50d8cec8b168..0bc31ec2b6f1970bec4ccc2d786261a4ab9eed75 100644 (file)
@@ -34,6 +34,7 @@
 #include "common/string.h"
 #include "mb/pg_wchar.h"
 #include "miscadmin.h"
+#include "storage/fd.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
index 97288b7f2c5aecf08ade885d6a6f76415102e0dd..8fb9ea25db0d80c4e3f9aef9eeabe38a0d1c548c 100644 (file)
@@ -32,6 +32,7 @@
 #include "commands/user.h"
 #include "libpq/crypt.h"
 #include "miscadmin.h"
+#include "port/pg_bitutils.h"
 #include "storage/lmgr.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
index 173d2fe548d6016a40966058262ae7253ad76d55..72f2bff770892d1c192b7d78ee5fb9f2b843c2e8 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "postgres.h"
 
+#include "access/amapi.h"
 #include "access/commit_ts.h"
 #include "access/genam.h"
 #include "access/gist.h"
index 9cba1272253502bcb8535887a23885bd6eec66c2..56826db4c2612cb5309a8f2aceb8c4961ba03e40 100644 (file)
@@ -38,6 +38,7 @@
 #include "utils/fmgroids.h"
 #include "utils/lsyscache.h"
 #include "utils/timestamp.h"
+#include "utils/typcache.h"
 #include "utils/xml.h"
 
 /* GUC parameters */
index 2df910378dcd3c1b36dd1b6d5723f8f569d3408d..0b1d80b5b0fd2deb8a7058b611d7cfa4906e0c27 100644 (file)
@@ -29,6 +29,7 @@
 #include "utils/inval.h"
 #include "utils/lsyscache.h"
 #include "utils/syscache.h"
+#include "utils/typcache.h"
 
 
 static MemoryContext LogicalRepRelMapContext = NULL;
index e51cb51a8ba04fd1825d6af069c227a14169cb43..509388d1bf4e0cc11838c7992258915c196da1a8 100644 (file)
@@ -51,6 +51,7 @@
 
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "access/table.h"
 #include "catalog/pg_sequence.h"
 #include "catalog/pg_subscription_rel.h"
index 44969159ea8345070f639c0153dbb2195772b734..9c680f1cb37170c418d4995854a0111218c9e4d2 100644 (file)
@@ -35,6 +35,7 @@
 #include "utils/lsyscache.h"
 #include "utils/rel.h"
 #include "utils/syscache.h"
+#include "utils/typcache.h"
 
 /* Default values assigned to new pg_statistic tuples. */
 #define DEFAULT_STATATT_NULL_FRAC      Float4GetDatum(0.0)     /* stanullfrac */
index 9b342d5bd80fbe1c8f0426fdea6d5241e20d24bc..ce340c076f84f723439a8e2353784ec20c37cd89 100644 (file)
@@ -18,7 +18,6 @@
 #include "access/itup.h"
 #include "nodes/tidbitmap.h"
 #include "port/atomics.h"
-#include "storage/buf.h"
 #include "storage/relfilelocator.h"
 #include "storage/spin.h"
 #include "utils/relcache.h"
index ab397409f17e3dc5c48bb7a00b1e2cf4621b52ea..58fc185d0d8cb2db24186578313eb078bcb35c50 100644 (file)
@@ -16,7 +16,7 @@
 #define INDEXING_H
 
 #include "access/htup.h"
-#include "nodes/execnodes.h"
+#include "executor/tuptable.h"
 #include "utils/relcache.h"
 
 /*
index 6fd8b6bfc0650090c7f59ae1708b68f9dbb2501f..f8053d9e572d767200ff1c8dd9fabc87d292ce4e 100644 (file)
 #ifndef EXECNODES_H
 #define EXECNODES_H
 
+#include "access/skey.h"
 #include "access/tupconvert.h"
 #include "executor/instrument.h"
+#include "executor/instrument_node.h"
 #include "fmgr.h"
 #include "lib/ilist.h"
 #include "lib/pairingheap.h"
index 943a2b7dc93f4752ddf5ef131bad7d9aefdf69d7..5fe229e211b2c3ed85cfad08281b869a942e4a76 100644 (file)
@@ -21,8 +21,6 @@
 #ifndef TUPLESORT_H
 #define TUPLESORT_H
 
-#include "access/brin_tuple.h"
-#include "access/gin_tuple.h"
 #include "access/itup.h"
 #include "executor/instrument_node.h"
 #include "executor/tuptable.h"
@@ -31,6 +29,9 @@
 #include "utils/relcache.h"
 #include "utils/sortsupport.h"
 
+/* We don't want this file to depend on AM-specific header files */
+typedef struct BrinTuple BrinTuple;
+typedef struct GinTuple GinTuple;
 
 /*
  * Tuplesortstate and Sharedsort are opaque types whose details are not