ee642cccc43c has added syscache.h in inval.h and objectaddress.h,
enlarging by a lot the footprint of this header, particularly via
objectaddress.h. A change in syscache.h would cause a lot more files to
be recompiled.
This commit reduces the presence of syscache.h by switching to a direct
use of syscache_ids.h in inval.h and objectaddress.h, where the enum
SysCacheIdentifier is defined. genbki.pl gains an #ifndef block for
this header, so as its inclusion is more controlled.
Reported-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/vlcexdcimsmvu3aplt2yxpfndkgtuvjsrms2fdl46rbw3k2kug@drspkoxlaije
# Now generate syscache info
print_boilerplate($syscache_ids_fh, "syscache_ids.h", "SysCache identifiers");
-print $syscache_ids_fh "typedef enum SysCacheIdentifier
+print $syscache_ids_fh "#ifndef SYSCACHE_IDS_H
+#define SYSCACHE_IDS_H
+
+typedef enum SysCacheIdentifier
{
\tSYSCACHEID_INVALID = -1,\n";
}
print $syscache_ids_fh "} SysCacheIdentifier;\n";
-print $syscache_ids_fh "#define SysCacheSize ($last_syscache + 1)\n";
+print $syscache_ids_fh "#define SysCacheSize ($last_syscache + 1)\n\n";
+
+# Closing boilerplate for syscache_ids.h
+print $syscache_ids_fh "#endif\t\t\t\t\t\t\t/* SYSCACHE_IDS_H */\n";
print $syscache_info_fh "};\n";
#define OBJECTADDRESS_H
#include "access/htup.h"
+#include "catalog/syscache_ids.h"
#include "nodes/parsenodes.h"
#include "storage/lockdefs.h"
#include "utils/relcache.h"
-#include "utils/syscache.h"
/*
* An ObjectAddress represents a database object of any type.
#define INVAL_H
#include "access/htup.h"
+#include "catalog/syscache_ids.h"
#include "storage/relfilelocator.h"
#include "utils/relcache.h"
-#include "utils/syscache.h"
extern PGDLLIMPORT int debug_discard_caches;