From fb3b098fe88441f9531a5169008ea17eac01301f Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Fri, 16 Aug 2019 10:35:31 -0700 Subject: [PATCH] Remove fmgr.h includes from headers that don't really need it. Most of the fmgr.h includes were obsoleted by 352a24a1f9d6f7d4abb1. A few others can be obsoleted using the underlying struct type in an implementation detail. Author: Andres Freund Discussion: https://postgr.es/m/20190803193733.g3l3x3o42uv4qj7l@alap3.anarazel.de --- src/backend/access/common/printsimple.c | 1 - src/backend/nodes/makefuncs.c | 1 - src/backend/replication/logical/logical.c | 1 + src/backend/replication/pgoutput/pgoutput.c | 2 ++ src/include/access/brin.h | 1 - src/include/access/gist_private.h | 1 - src/include/access/hash.h | 1 - src/include/access/spgist.h | 1 - src/include/commands/async.h | 2 -- src/include/executor/executor.h | 1 + src/include/jit/llvmjit_emit.h | 1 - src/include/nodes/execnodes.h | 1 + src/include/nodes/pathnodes.h | 3 +-- src/include/pgstat.h | 4 ++-- src/include/replication/origin.h | 1 - src/include/replication/slot.h | 1 - src/include/replication/walreceiver.h | 1 - src/include/replication/walsender.h | 2 -- src/include/utils/bytea.h | 1 - src/include/utils/formatting.h | 2 -- src/include/utils/rel.h | 3 +-- src/include/utils/snapmgr.h | 1 - src/include/utils/tuplesort.h | 1 - 23 files changed, 9 insertions(+), 25 deletions(-) diff --git a/src/backend/access/common/printsimple.c b/src/backend/access/common/printsimple.c index 3ea188d701..651ade14dd 100644 --- a/src/backend/access/common/printsimple.c +++ b/src/backend/access/common/printsimple.c @@ -20,7 +20,6 @@ #include "access/printsimple.h" #include "catalog/pg_type.h" -#include "fmgr.h" #include "libpq/pqformat.h" #include "utils/builtins.h" diff --git a/src/backend/nodes/makefuncs.c b/src/backend/nodes/makefuncs.c index 5c11b5472e..18466ac568 100644 --- a/src/backend/nodes/makefuncs.c +++ b/src/backend/nodes/makefuncs.c @@ -17,7 +17,6 @@ #include "catalog/pg_class.h" #include "catalog/pg_type.h" -#include "fmgr.h" #include "nodes/makefuncs.h" #include "nodes/nodeFuncs.h" #include "utils/lsyscache.h" diff --git a/src/backend/replication/logical/logical.c b/src/backend/replication/logical/logical.c index 9853be6d1c..f8b9020081 100644 --- a/src/backend/replication/logical/logical.c +++ b/src/backend/replication/logical/logical.c @@ -28,6 +28,7 @@ #include "postgres.h" +#include "fmgr.h" #include "miscadmin.h" #include "access/xact.h" diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c index d317fd7006..9c08757fca 100644 --- a/src/backend/replication/pgoutput/pgoutput.c +++ b/src/backend/replication/pgoutput/pgoutput.c @@ -14,6 +14,8 @@ #include "catalog/pg_publication.h" +#include "fmgr.h" + #include "replication/logical.h" #include "replication/logicalproto.h" #include "replication/origin.h" diff --git a/src/include/access/brin.h b/src/include/access/brin.h index 612721baf3..fb351b36e0 100644 --- a/src/include/access/brin.h +++ b/src/include/access/brin.h @@ -10,7 +10,6 @@ #ifndef BRIN_H #define BRIN_H -#include "fmgr.h" #include "nodes/execnodes.h" #include "utils/relcache.h" diff --git a/src/include/access/gist_private.h b/src/include/access/gist_private.h index 664f322df3..fc1a311556 100644 --- a/src/include/access/gist_private.h +++ b/src/include/access/gist_private.h @@ -17,7 +17,6 @@ #include "access/amapi.h" #include "access/gist.h" #include "access/itup.h" -#include "fmgr.h" #include "lib/pairingheap.h" #include "storage/bufmgr.h" #include "storage/buffile.h" diff --git a/src/include/access/hash.h b/src/include/access/hash.h index 0d49f4253c..24af778fdf 100644 --- a/src/include/access/hash.h +++ b/src/include/access/hash.h @@ -20,7 +20,6 @@ #include "access/amapi.h" #include "access/itup.h" #include "access/sdir.h" -#include "fmgr.h" #include "lib/stringinfo.h" #include "storage/bufmgr.h" #include "storage/lockdefs.h" diff --git a/src/include/access/spgist.h b/src/include/access/spgist.h index 02c87949ce..d787ab213d 100644 --- a/src/include/access/spgist.h +++ b/src/include/access/spgist.h @@ -16,7 +16,6 @@ #include "access/amapi.h" #include "access/xlogreader.h" -#include "fmgr.h" #include "lib/stringinfo.h" diff --git a/src/include/commands/async.h b/src/include/commands/async.h index d132fd5999..c295dc67c6 100644 --- a/src/include/commands/async.h +++ b/src/include/commands/async.h @@ -15,8 +15,6 @@ #include -#include "fmgr.h" - /* * The number of SLRU page buffers we use for the notification queue. */ diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h index 39c8b3bbbe..affe6ad698 100644 --- a/src/include/executor/executor.h +++ b/src/include/executor/executor.h @@ -15,6 +15,7 @@ #define EXECUTOR_H #include "executor/execdesc.h" +#include "fmgr.h" #include "nodes/lockoptions.h" #include "nodes/parsenodes.h" #include "utils/memutils.h" diff --git a/src/include/jit/llvmjit_emit.h b/src/include/jit/llvmjit_emit.h index 71a8625efe..cdfa0dc721 100644 --- a/src/include/jit/llvmjit_emit.h +++ b/src/include/jit/llvmjit_emit.h @@ -17,7 +17,6 @@ #include -#include "fmgr.h" #include "jit/llvmjit.h" diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 063b49013c..f42189d2bf 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -16,6 +16,7 @@ #include "access/tupconvert.h" #include "executor/instrument.h" +#include "fmgr.h" #include "lib/pairingheap.h" #include "nodes/params.h" #include "nodes/plannodes.h" diff --git a/src/include/nodes/pathnodes.h b/src/include/nodes/pathnodes.h index 13b147d85d..23a06d718e 100644 --- a/src/include/nodes/pathnodes.h +++ b/src/include/nodes/pathnodes.h @@ -15,7 +15,6 @@ #define PATHNODES_H #include "access/sdir.h" -#include "fmgr.h" #include "lib/stringinfo.h" #include "nodes/params.h" #include "nodes/parsenodes.h" @@ -400,7 +399,7 @@ typedef struct PartitionSchemeData bool *parttypbyval; /* Cached information about partition comparison functions. */ - FmgrInfo *partsupfunc; + struct FmgrInfo *partsupfunc; } PartitionSchemeData; typedef struct PartitionSchemeData *PartitionScheme; diff --git a/src/include/pgstat.h b/src/include/pgstat.h index 0a3ad3a188..fe076d823d 100644 --- a/src/include/pgstat.h +++ b/src/include/pgstat.h @@ -12,7 +12,6 @@ #define PGSTAT_H #include "datatype/timestamp.h" -#include "fmgr.h" #include "libpq/pqcomm.h" #include "port/atomics.h" #include "portability/instr_time.h" @@ -1402,7 +1401,8 @@ extern void pgstat_count_heap_delete(Relation rel); extern void pgstat_count_truncate(Relation rel); extern void pgstat_update_heap_dead_tuples(Relation rel, int delta); -extern void pgstat_init_function_usage(FunctionCallInfo fcinfo, +struct FunctionCallInfoBaseData; +extern void pgstat_init_function_usage(struct FunctionCallInfoBaseData *fcinfo, PgStat_FunctionCallUsage *fcu); extern void pgstat_end_function_usage(PgStat_FunctionCallUsage *fcu, bool finalize); diff --git a/src/include/replication/origin.h b/src/include/replication/origin.h index 7422b26a6d..dccf48418f 100644 --- a/src/include/replication/origin.h +++ b/src/include/replication/origin.h @@ -10,7 +10,6 @@ #ifndef PG_ORIGIN_H #define PG_ORIGIN_H -#include "fmgr.h" #include "access/xlog.h" #include "access/xlogdefs.h" #include "access/xlogreader.h" diff --git a/src/include/replication/slot.h b/src/include/replication/slot.h index 8fbddea78f..3a5763fb07 100644 --- a/src/include/replication/slot.h +++ b/src/include/replication/slot.h @@ -9,7 +9,6 @@ #ifndef SLOT_H #define SLOT_H -#include "fmgr.h" #include "access/xlog.h" #include "access/xlogreader.h" #include "storage/condition_variable.h" diff --git a/src/include/replication/walreceiver.h b/src/include/replication/walreceiver.h index 86a8130051..bc9468b519 100644 --- a/src/include/replication/walreceiver.h +++ b/src/include/replication/walreceiver.h @@ -14,7 +14,6 @@ #include "access/xlog.h" #include "access/xlogdefs.h" -#include "fmgr.h" #include "getaddrinfo.h" /* for NI_MAXHOST */ #include "replication/logicalproto.h" #include "replication/walsender.h" diff --git a/src/include/replication/walsender.h b/src/include/replication/walsender.h index 4a60893a3b..61223aecbc 100644 --- a/src/include/replication/walsender.h +++ b/src/include/replication/walsender.h @@ -14,8 +14,6 @@ #include -#include "fmgr.h" - /* * What to do with a snapshot in create replication slot command. */ diff --git a/src/include/utils/bytea.h b/src/include/utils/bytea.h index c96011fae8..72224ca95f 100644 --- a/src/include/utils/bytea.h +++ b/src/include/utils/bytea.h @@ -14,7 +14,6 @@ #ifndef BYTEA_H #define BYTEA_H -#include "fmgr.h" typedef enum diff --git a/src/include/utils/formatting.h b/src/include/utils/formatting.h index 741c5f4809..0117144779 100644 --- a/src/include/utils/formatting.h +++ b/src/include/utils/formatting.h @@ -17,8 +17,6 @@ #ifndef _FORMATTING_H_ #define _FORMATTING_H_ -#include "fmgr.h" - extern char *str_tolower(const char *buff, size_t nbytes, Oid collid); extern char *str_toupper(const char *buff, size_t nbytes, Oid collid); diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index 2174bbafd1..c5d36680a2 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -19,7 +19,6 @@ #include "catalog/pg_class.h" #include "catalog/pg_index.h" #include "catalog/pg_publication.h" -#include "fmgr.h" #include "nodes/bitmapset.h" #include "rewrite/prs2lock.h" #include "storage/block.h" @@ -159,7 +158,7 @@ typedef struct RelationData Oid *rd_opfamily; /* OIDs of op families for each index col */ Oid *rd_opcintype; /* OIDs of opclass declared input data types */ RegProcedure *rd_support; /* OIDs of support procedures */ - FmgrInfo *rd_supportinfo; /* lookup info for support procedures */ + struct FmgrInfo *rd_supportinfo; /* lookup info for support procedures */ int16 *rd_indoption; /* per-column AM-specific flags */ List *rd_indexprs; /* index expression trees, if any */ List *rd_indpred; /* index predicate tree, if any */ diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h index 6641ee510a..8c070d7f41 100644 --- a/src/include/utils/snapmgr.h +++ b/src/include/utils/snapmgr.h @@ -14,7 +14,6 @@ #define SNAPMGR_H #include "access/transam.h" -#include "fmgr.h" #include "utils/relcache.h" #include "utils/resowner.h" #include "utils/snapshot.h" diff --git a/src/include/utils/tuplesort.h b/src/include/utils/tuplesort.h index 4521de18e1..d774bc1152 100644 --- a/src/include/utils/tuplesort.h +++ b/src/include/utils/tuplesort.h @@ -23,7 +23,6 @@ #include "access/itup.h" #include "executor/tuptable.h" -#include "fmgr.h" #include "storage/dsm.h" #include "utils/relcache.h" -- 2.40.0