]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Avoid including clog.h in proc.h
authorÁlvaro Herrera <alvherre@kurilemu.de>
Tue, 24 Mar 2026 16:30:40 +0000 (17:30 +0100)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Tue, 24 Mar 2026 16:31:16 +0000 (17:31 +0100)
The number of .c files that must include access/clog.h can currently be
counted on one's fingers and miss only one (assuming one has the usual
number of hands).  However, due to indirect inclusion via proc.h,
there's a lot of files that are pointlessly including it.  This is easy
to avoid with the easy trick implemented by this commit.

Author: Álvaro Herrera <alvherre@kurilemu.de>
Discussion: https://postgr.es/m/202603221856.iwlhitt6dxxx@alvherre.pgsql

src/backend/storage/lmgr/proc.c
src/include/storage/proc.h

index ec41c86f390d10e6636dfaf4e702b76d01b2e61a..5c47cf13473eb06f3aeb7ef11984493c80d3eea5 100644 (file)
@@ -33,6 +33,7 @@
 #include <unistd.h>
 #include <sys/time.h>
 
+#include "access/clog.h"
 #include "access/transam.h"
 #include "access/twophase.h"
 #include "access/xlogutils.h"
index bf3094f0f7d95d79378080d7f7b8e407d047e617..1dad125706ea7d1df3302eaddff4cf3fab980337 100644 (file)
@@ -14,7 +14,6 @@
 #ifndef _PROC_H_
 #define _PROC_H_
 
-#include "access/clog.h"
 #include "access/xlogdefs.h"
 #include "lib/ilist.h"
 #include "miscadmin.h"
@@ -24,6 +23,9 @@
 #include "storage/proclist_types.h"
 #include "storage/procnumber.h"
 
+/* Avoid including clog.h here */
+typedef int XidStatus;
+
 /*
  * Each backend advertises up to PGPROC_MAX_CACHED_SUBXIDS TransactionIds
  * for non-aborted subtransactions of its current top transaction.  These