From f227b7b20c36b7348867eec48d539d28cfdf831c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Herrera?= Date: Tue, 24 Mar 2026 17:30:40 +0100 Subject: [PATCH] Avoid including clog.h in proc.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Discussion: https://postgr.es/m/202603221856.iwlhitt6dxxx@alvherre.pgsql --- src/backend/storage/lmgr/proc.c | 1 + src/include/storage/proc.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index ec41c86f390..5c47cf13473 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -33,6 +33,7 @@ #include #include +#include "access/clog.h" #include "access/transam.h" #include "access/twophase.h" #include "access/xlogutils.h" diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index bf3094f0f7d..1dad125706e 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -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