From 1609797c25f6b440371045039733d69fe8cb9410 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 4 Sep 2011 01:13:16 -0400 Subject: [PATCH] Clean up the #include mess a little. walsender.h should depend on xlog.h, not vice versa. (Actually, the inclusion was circular until a couple hours ago, which was even sillier; but Bruce broke it in the expedient rather than logically correct direction.) Because of that poor decision, plus blind application of pgrminclude, we had a situation where half the system was depending on xlog.h to include such unrelated stuff as array.h and guc.h. Clean up the header inclusion, and manually revert a lot of what pgrminclude had done so things build again. This episode reinforces my feeling that pgrminclude should not be run without adult supervision. Inclusion changes in header files in particular need to be reviewed with great care. More generally, it'd be good if we had a clearer notion of module layering to dictate which headers can sanely include which others ... but that's a big task for another day. --- contrib/auto_explain/auto_explain.c | 1 + contrib/cube/cube.c | 1 + contrib/pg_stat_statements/pg_stat_statements.c | 1 + contrib/tsearch2/tsearch2.c | 1 + src/backend/access/common/reloptions.c | 2 ++ src/backend/access/gin/ginarrayproc.c | 1 + src/backend/access/transam/slru.c | 1 + src/backend/access/transam/twophase_rmgr.c | 1 + src/backend/access/transam/varsup.c | 1 + src/backend/access/transam/xact.c | 3 +++ src/backend/access/transam/xlogutils.c | 2 ++ src/backend/bootstrap/bootstrap.c | 1 + src/backend/catalog/dependency.c | 1 + src/backend/catalog/index.c | 1 + src/backend/catalog/namespace.c | 1 + src/backend/catalog/pg_constraint.c | 1 + src/backend/commands/analyze.c | 2 ++ src/backend/commands/discard.c | 1 + src/backend/commands/functioncmds.c | 1 + src/backend/commands/indexcmds.c | 1 + src/backend/commands/sequence.c | 1 + src/backend/commands/tablespace.c | 1 + src/backend/commands/vacuum.c | 2 ++ src/backend/executor/nodeIndexscan.c | 1 + src/backend/executor/nodeSubplan.c | 1 + src/backend/executor/nodeTidscan.c | 1 + src/backend/optimizer/util/predtest.c | 1 + src/backend/parser/parse_clause.c | 1 + src/backend/postmaster/bgwriter.c | 5 +++++ src/backend/postmaster/walwriter.c | 3 +++ src/backend/replication/syncrep.c | 6 ++++++ src/backend/replication/walreceiver.c | 2 ++ src/backend/replication/walreceiverfuncs.c | 1 + src/backend/replication/walsender.c | 1 + src/backend/storage/ipc/procarray.c | 1 + src/backend/storage/ipc/procsignal.c | 1 + src/backend/storage/lmgr/lwlock.c | 2 ++ src/backend/storage/smgr/smgr.c | 1 + src/backend/utils/adt/arrayfuncs.c | 1 + src/backend/utils/adt/enum.c | 1 + src/backend/utils/adt/int.c | 1 + src/backend/utils/adt/regexp.c | 1 + src/backend/utils/adt/ri_triggers.c | 1 + src/backend/utils/adt/ruleutils.c | 1 + src/backend/utils/cache/relcache.c | 1 + src/backend/utils/cache/relmapper.c | 1 + src/backend/utils/cache/spccache.c | 1 + src/backend/utils/fmgr/funcapi.c | 1 + src/backend/utils/hash/dynahash.c | 2 ++ src/backend/utils/resowner/resowner.c | 1 + src/backend/utils/time/combocid.c | 2 ++ src/backend/utils/time/snapmgr.c | 1 + src/include/access/gin.h | 1 + src/include/access/heapam.h | 2 ++ src/include/access/xact.h | 2 ++ src/include/access/xlog.h | 1 - src/include/access/xlog_internal.h | 2 ++ src/include/catalog/storage.h | 2 ++ src/include/commands/copy.h | 2 ++ src/include/commands/dbcommands.h | 1 + src/include/commands/portalcmds.h | 1 + src/include/commands/sequence.h | 2 ++ src/include/commands/tablespace.h | 1 + src/include/commands/trigger.h | 1 + src/include/executor/execdesc.h | 1 + src/include/executor/functions.h | 1 + src/include/executor/spi.h | 1 + src/include/replication/syncrep.h | 8 +------- src/include/replication/walsender.h | 3 +-- src/include/storage/standby.h | 2 ++ src/include/tcop/pquery.h | 1 + src/include/tcop/tcopprot.h | 2 ++ src/pl/plpgsql/src/pl_comp.c | 1 + src/pl/plpgsql/src/pl_handler.c | 1 + 74 files changed, 102 insertions(+), 10 deletions(-) diff --git a/contrib/auto_explain/auto_explain.c b/contrib/auto_explain/auto_explain.c index 42b45377fe..b320698748 100644 --- a/contrib/auto_explain/auto_explain.c +++ b/contrib/auto_explain/auto_explain.c @@ -14,6 +14,7 @@ #include "commands/explain.h" #include "executor/instrument.h" +#include "utils/guc.h" PG_MODULE_MAGIC; diff --git a/contrib/cube/cube.c b/contrib/cube/cube.c index b0564f75a4..1d119ddbb5 100644 --- a/contrib/cube/cube.c +++ b/contrib/cube/cube.c @@ -13,6 +13,7 @@ #include "access/gist.h" #include "access/skey.h" +#include "utils/array.h" #include "utils/builtins.h" #include "cubedata.h" diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c index 582c8d6cce..eb4c494ae6 100644 --- a/contrib/pg_stat_statements/pg_stat_statements.c +++ b/contrib/pg_stat_statements/pg_stat_statements.c @@ -30,6 +30,7 @@ #include "pgstat.h" #include "storage/fd.h" #include "storage/ipc.h" +#include "storage/spin.h" #include "tcop/utility.h" #include "utils/builtins.h" diff --git a/contrib/tsearch2/tsearch2.c b/contrib/tsearch2/tsearch2.c index 9b22d6f99a..2b3bc3fc1d 100644 --- a/contrib/tsearch2/tsearch2.c +++ b/contrib/tsearch2/tsearch2.c @@ -18,6 +18,7 @@ #include "commands/trigger.h" #include "tsearch/ts_utils.h" #include "utils/builtins.h" +#include "utils/guc.h" #include "utils/syscache.h" PG_MODULE_MAGIC; diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 7c63298cb0..900b222865 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -23,8 +23,10 @@ #include "commands/defrem.h" #include "commands/tablespace.h" #include "nodes/makefuncs.h" +#include "utils/array.h" #include "utils/attoptcache.h" #include "utils/builtins.h" +#include "utils/guc.h" #include "utils/memutils.h" #include "utils/rel.h" diff --git a/src/backend/access/gin/ginarrayproc.c b/src/backend/access/gin/ginarrayproc.c index 3e4b43d475..2de58604ee 100644 --- a/src/backend/access/gin/ginarrayproc.c +++ b/src/backend/access/gin/ginarrayproc.c @@ -15,6 +15,7 @@ #include "access/gin.h" #include "access/skey.h" +#include "utils/array.h" #include "utils/builtins.h" #include "utils/lsyscache.h" diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c index a83962b4f0..69e5245beb 100644 --- a/src/backend/access/transam/slru.c +++ b/src/backend/access/transam/slru.c @@ -55,6 +55,7 @@ #include "access/transam.h" #include "access/xlog.h" #include "storage/fd.h" +#include "storage/shmem.h" #include "miscadmin.h" diff --git a/src/backend/access/transam/twophase_rmgr.c b/src/backend/access/transam/twophase_rmgr.c index 088c837358..eeb445da9d 100644 --- a/src/backend/access/transam/twophase_rmgr.c +++ b/src/backend/access/transam/twophase_rmgr.c @@ -17,6 +17,7 @@ #include "access/multixact.h" #include "access/twophase_rmgr.h" #include "pgstat.h" +#include "storage/lock.h" #include "storage/predicate.h" diff --git a/src/backend/access/transam/varsup.c b/src/backend/access/transam/varsup.c index 41f261a4b6..61dcfedad4 100644 --- a/src/backend/access/transam/varsup.c +++ b/src/backend/access/transam/varsup.c @@ -21,6 +21,7 @@ #include "miscadmin.h" #include "postmaster/autovacuum.h" #include "storage/pmsignal.h" +#include "storage/proc.h" #include "utils/syscache.h" diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index 7922f7ac20..59685dc85c 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -36,12 +36,15 @@ #include "libpq/be-fsstubs.h" #include "miscadmin.h" #include "pgstat.h" +#include "replication/walsender.h" +#include "replication/syncrep.h" #include "storage/lmgr.h" #include "storage/predicate.h" #include "storage/procarray.h" #include "storage/sinvaladt.h" #include "storage/smgr.h" #include "utils/combocid.h" +#include "utils/guc.h" #include "utils/inval.h" #include "utils/memutils.h" #include "utils/relmapper.h" diff --git a/src/backend/access/transam/xlogutils.c b/src/backend/access/transam/xlogutils.c index 038d593eea..803d390772 100644 --- a/src/backend/access/transam/xlogutils.c +++ b/src/backend/access/transam/xlogutils.c @@ -21,6 +21,8 @@ #include "access/xlogutils.h" #include "catalog/catalog.h" #include "storage/smgr.h" +#include "utils/guc.h" +#include "utils/hsearch.h" #include "utils/rel.h" diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index ab148404b0..baea46c0a8 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -33,6 +33,7 @@ #include "replication/walreceiver.h" #include "storage/bufmgr.h" #include "storage/ipc.h" +#include "storage/proc.h" #include "tcop/tcopprot.h" #include "utils/builtins.h" #include "utils/fmgroids.h" diff --git a/src/backend/catalog/dependency.c b/src/backend/catalog/dependency.c index 2bce663e51..290e74a777 100644 --- a/src/backend/catalog/dependency.c +++ b/src/backend/catalog/dependency.c @@ -71,6 +71,7 @@ #include "utils/acl.h" #include "utils/builtins.h" #include "utils/fmgroids.h" +#include "utils/guc.h" #include "utils/lsyscache.h" #include "utils/syscache.h" #include "utils/tqual.h" diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 509a86df69..67ade8f5e9 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -55,6 +55,7 @@ #include "storage/smgr.h" #include "utils/builtins.h" #include "utils/fmgroids.h" +#include "utils/guc.h" #include "utils/inval.h" #include "utils/lsyscache.h" #include "utils/memutils.h" diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index 16568976a2..fcb41a8adb 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -46,6 +46,7 @@ #include "storage/sinval.h" #include "utils/acl.h" #include "utils/builtins.h" +#include "utils/guc.h" #include "utils/inval.h" #include "utils/lsyscache.h" #include "utils/memutils.h" diff --git a/src/backend/catalog/pg_constraint.c b/src/backend/catalog/pg_constraint.c index e1cff30f8d..69979942af 100644 --- a/src/backend/catalog/pg_constraint.c +++ b/src/backend/catalog/pg_constraint.c @@ -23,6 +23,7 @@ #include "catalog/pg_operator.h" #include "catalog/pg_type.h" #include "commands/defrem.h" +#include "utils/array.h" #include "utils/builtins.h" #include "utils/fmgroids.h" #include "utils/lsyscache.h" diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index a9ddb2c280..7abf75dce6 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -37,10 +37,12 @@ #include "postmaster/autovacuum.h" #include "storage/bufmgr.h" #include "storage/lmgr.h" +#include "storage/proc.h" #include "storage/procarray.h" #include "utils/acl.h" #include "utils/attoptcache.h" #include "utils/datum.h" +#include "utils/guc.h" #include "utils/lsyscache.h" #include "utils/memutils.h" #include "utils/pg_rusage.h" diff --git a/src/backend/commands/discard.c b/src/backend/commands/discard.c index fae726a987..5a5aaf9865 100644 --- a/src/backend/commands/discard.c +++ b/src/backend/commands/discard.c @@ -18,6 +18,7 @@ #include "commands/async.h" #include "commands/discard.h" #include "commands/prepare.h" +#include "utils/guc.h" #include "utils/portal.h" static void DiscardAll(bool isTopLevel); diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index bee4313a52..92abd44a60 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -58,6 +58,7 @@ #include "utils/acl.h" #include "utils/builtins.h" #include "utils/fmgroids.h" +#include "utils/guc.h" #include "utils/lsyscache.h" #include "utils/rel.h" #include "utils/syscache.h" diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 80925d58a4..69aa5bf646 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -35,6 +35,7 @@ #include "parser/parse_func.h" #include "parser/parse_oper.h" #include "storage/lmgr.h" +#include "storage/proc.h" #include "storage/procarray.h" #include "utils/acl.h" #include "utils/builtins.h" diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index c23a39f758..54660f4480 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -26,6 +26,7 @@ #include "miscadmin.h" #include "nodes/makefuncs.h" #include "storage/lmgr.h" +#include "storage/proc.h" #include "storage/smgr.h" #include "utils/acl.h" #include "utils/builtins.h" diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c index c8c9337b56..d223f8c964 100644 --- a/src/backend/commands/tablespace.c +++ b/src/backend/commands/tablespace.c @@ -70,6 +70,7 @@ #include "utils/acl.h" #include "utils/builtins.h" #include "utils/fmgroids.h" +#include "utils/guc.h" #include "utils/memutils.h" #include "utils/rel.h" #include "utils/tqual.h" diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index 005d72997b..7fe787ecb7 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -37,9 +37,11 @@ #include "postmaster/autovacuum.h" #include "storage/bufmgr.h" #include "storage/lmgr.h" +#include "storage/proc.h" #include "storage/procarray.h" #include "utils/acl.h" #include "utils/fmgroids.h" +#include "utils/guc.h" #include "utils/memutils.h" #include "utils/snapmgr.h" #include "utils/syscache.h" diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c index 9a74a8135d..955008e012 100644 --- a/src/backend/executor/nodeIndexscan.c +++ b/src/backend/executor/nodeIndexscan.c @@ -29,6 +29,7 @@ #include "executor/execdebug.h" #include "executor/nodeIndexscan.h" #include "optimizer/clauses.h" +#include "utils/array.h" #include "utils/lsyscache.h" #include "utils/memutils.h" #include "utils/rel.h" diff --git a/src/backend/executor/nodeSubplan.c b/src/backend/executor/nodeSubplan.c index b0fb70488e..0e12bb5afb 100644 --- a/src/backend/executor/nodeSubplan.c +++ b/src/backend/executor/nodeSubplan.c @@ -24,6 +24,7 @@ #include "executor/nodeSubplan.h" #include "nodes/makefuncs.h" #include "optimizer/clauses.h" +#include "utils/array.h" #include "utils/lsyscache.h" #include "utils/memutils.h" diff --git a/src/backend/executor/nodeTidscan.c b/src/backend/executor/nodeTidscan.c index a54bb9dba3..69f47ff472 100644 --- a/src/backend/executor/nodeTidscan.c +++ b/src/backend/executor/nodeTidscan.c @@ -30,6 +30,7 @@ #include "executor/nodeTidscan.h" #include "optimizer/clauses.h" #include "storage/bufmgr.h" +#include "utils/array.h" #include "utils/rel.h" diff --git a/src/backend/optimizer/util/predtest.c b/src/backend/optimizer/util/predtest.c index 304ca407ed..3e4a775290 100644 --- a/src/backend/optimizer/util/predtest.c +++ b/src/backend/optimizer/util/predtest.c @@ -22,6 +22,7 @@ #include "optimizer/clauses.h" #include "optimizer/planmain.h" #include "optimizer/predtest.h" +#include "utils/array.h" #include "utils/inval.h" #include "utils/lsyscache.h" #include "utils/syscache.h" diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c index 978417d6ca..e8177bca3f 100644 --- a/src/backend/parser/parse_clause.c +++ b/src/backend/parser/parse_clause.c @@ -33,6 +33,7 @@ #include "parser/parse_relation.h" #include "parser/parse_target.h" #include "rewrite/rewriteManip.h" +#include "utils/guc.h" #include "utils/lsyscache.h" #include "utils/rel.h" diff --git a/src/backend/postmaster/bgwriter.c b/src/backend/postmaster/bgwriter.c index 7443d80771..2d0b63987e 100644 --- a/src/backend/postmaster/bgwriter.c +++ b/src/backend/postmaster/bgwriter.c @@ -54,10 +54,15 @@ #include "miscadmin.h" #include "pgstat.h" #include "postmaster/bgwriter.h" +#include "replication/syncrep.h" #include "storage/bufmgr.h" #include "storage/ipc.h" +#include "storage/lwlock.h" #include "storage/pmsignal.h" +#include "storage/shmem.h" #include "storage/smgr.h" +#include "storage/spin.h" +#include "utils/guc.h" #include "utils/memutils.h" #include "utils/resowner.h" diff --git a/src/backend/postmaster/walwriter.c b/src/backend/postmaster/walwriter.c index a516199484..23c4aacd7d 100644 --- a/src/backend/postmaster/walwriter.c +++ b/src/backend/postmaster/walwriter.c @@ -51,8 +51,11 @@ #include "postmaster/walwriter.h" #include "storage/bufmgr.h" #include "storage/ipc.h" +#include "storage/lwlock.h" #include "storage/pmsignal.h" #include "storage/smgr.h" +#include "utils/guc.h" +#include "utils/hsearch.h" #include "utils/memutils.h" #include "utils/resowner.h" diff --git a/src/backend/replication/syncrep.c b/src/backend/replication/syncrep.c index 65e0a59d08..542bdf2bce 100644 --- a/src/backend/replication/syncrep.c +++ b/src/backend/replication/syncrep.c @@ -47,7 +47,10 @@ #include "access/xact.h" #include "miscadmin.h" +#include "replication/syncrep.h" +#include "replication/walsender.h" #include "storage/pmsignal.h" +#include "storage/proc.h" #include "tcop/tcopprot.h" #include "utils/builtins.h" #include "utils/ps_status.h" @@ -58,6 +61,9 @@ char *SyncRepStandbyNames; #define SyncStandbysDefined() \ (SyncRepStandbyNames != NULL && SyncRepStandbyNames[0] != '\0') +#define SyncRepRequested() \ + (max_wal_senders > 0 && synchronous_commit > SYNCHRONOUS_COMMIT_LOCAL_FLUSH) + static bool announce_next_takeover = true; static void SyncRepQueueInsert(void); diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c index f4c6cc3672..6d7f215d40 100644 --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@ -43,9 +43,11 @@ #include "miscadmin.h" #include "replication/walprotocol.h" #include "replication/walreceiver.h" +#include "replication/walsender.h" #include "storage/ipc.h" #include "storage/pmsignal.h" #include "storage/procarray.h" +#include "utils/guc.h" #include "utils/ps_status.h" #include "utils/resowner.h" diff --git a/src/backend/replication/walreceiverfuncs.c b/src/backend/replication/walreceiverfuncs.c index fe009b5332..29c2f806e0 100644 --- a/src/backend/replication/walreceiverfuncs.c +++ b/src/backend/replication/walreceiverfuncs.c @@ -26,6 +26,7 @@ #include "access/xlog_internal.h" #include "replication/walreceiver.h" #include "storage/pmsignal.h" +#include "storage/shmem.h" WalRcvData *WalRcv = NULL; diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index 0eadf6437e..0e8098abf4 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -47,6 +47,7 @@ #include "miscadmin.h" #include "nodes/replnodes.h" #include "replication/basebackup.h" +#include "replication/syncrep.h" #include "replication/walprotocol.h" #include "replication/walreceiver.h" #include "replication/walsender.h" diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index ba0cfde28a..9489012a18 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -52,6 +52,7 @@ #include "access/twophase.h" #include "miscadmin.h" #include "storage/procarray.h" +#include "storage/spin.h" #include "utils/builtins.h" #include "utils/snapmgr.h" diff --git a/src/backend/storage/ipc/procsignal.c b/src/backend/storage/ipc/procsignal.c index c8a9e86727..c8393d773f 100644 --- a/src/backend/storage/ipc/procsignal.c +++ b/src/backend/storage/ipc/procsignal.c @@ -20,6 +20,7 @@ #include "bootstrap/bootstrap.h" #include "commands/async.h" #include "miscadmin.h" +#include "storage/latch.h" #include "storage/ipc.h" #include "storage/sinval.h" #include "tcop/tcopprot.h" diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index 2fe610532c..8fae67ebbb 100644 --- a/src/backend/storage/lmgr/lwlock.c +++ b/src/backend/storage/lmgr/lwlock.c @@ -29,6 +29,8 @@ #include "pg_trace.h" #include "storage/ipc.h" #include "storage/predicate.h" +#include "storage/proc.h" +#include "storage/spin.h" /* We use the ShmemLock spinlock to protect LWLockAssign */ diff --git a/src/backend/storage/smgr/smgr.c b/src/backend/storage/smgr/smgr.c index 5f1497d5f4..4f607cda73 100644 --- a/src/backend/storage/smgr/smgr.c +++ b/src/backend/storage/smgr/smgr.c @@ -21,6 +21,7 @@ #include "storage/bufmgr.h" #include "storage/ipc.h" #include "storage/smgr.h" +#include "utils/hsearch.h" #include "utils/inval.h" diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c index 8705725580..bfb6065172 100644 --- a/src/backend/utils/adt/arrayfuncs.c +++ b/src/backend/utils/adt/arrayfuncs.c @@ -18,6 +18,7 @@ #include "funcapi.h" #include "libpq/pqformat.h" +#include "utils/array.h" #include "utils/builtins.h" #include "utils/datum.h" #include "utils/lsyscache.h" diff --git a/src/backend/utils/adt/enum.c b/src/backend/utils/adt/enum.c index f9ab358129..457925f97a 100644 --- a/src/backend/utils/adt/enum.c +++ b/src/backend/utils/adt/enum.c @@ -18,6 +18,7 @@ #include "catalog/indexing.h" #include "catalog/pg_enum.h" #include "libpq/pqformat.h" +#include "utils/array.h" #include "utils/builtins.h" #include "utils/fmgroids.h" #include "utils/snapmgr.h" diff --git a/src/backend/utils/adt/int.c b/src/backend/utils/adt/int.c index fadcf7ace0..a367421f82 100644 --- a/src/backend/utils/adt/int.c +++ b/src/backend/utils/adt/int.c @@ -34,6 +34,7 @@ #include "catalog/pg_type.h" #include "funcapi.h" #include "libpq/pqformat.h" +#include "utils/array.h" #include "utils/builtins.h" diff --git a/src/backend/utils/adt/regexp.c b/src/backend/utils/adt/regexp.c index 61362c97e1..70c8297b67 100644 --- a/src/backend/utils/adt/regexp.c +++ b/src/backend/utils/adt/regexp.c @@ -32,6 +32,7 @@ #include "catalog/pg_type.h" #include "funcapi.h" #include "regex/regex.h" +#include "utils/array.h" #include "utils/builtins.h" #define PG_GETARG_TEXT_PP_IF_EXISTS(_n) \ diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c index bf9b2bc5f0..af194f0c90 100644 --- a/src/backend/utils/adt/ri_triggers.c +++ b/src/backend/utils/adt/ri_triggers.c @@ -44,6 +44,7 @@ #include "miscadmin.h" #include "utils/builtins.h" #include "utils/fmgroids.h" +#include "utils/guc.h" #include "utils/lsyscache.h" #include "utils/memutils.h" #include "utils/rel.h" diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index f25c50f9a4..8852bf9346 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -47,6 +47,7 @@ #include "rewrite/rewriteHandler.h" #include "rewrite/rewriteManip.h" #include "rewrite/rewriteSupport.h" +#include "utils/array.h" #include "utils/builtins.h" #include "utils/fmgroids.h" #include "utils/lsyscache.h" diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 6101ef8071..b22ad07ca8 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -62,6 +62,7 @@ #include "rewrite/rewriteDefine.h" #include "storage/lmgr.h" #include "storage/smgr.h" +#include "utils/array.h" #include "utils/builtins.h" #include "utils/fmgroids.h" #include "utils/inval.h" diff --git a/src/backend/utils/cache/relmapper.c b/src/backend/utils/cache/relmapper.c index 9337181f68..b33a846f9d 100644 --- a/src/backend/utils/cache/relmapper.c +++ b/src/backend/utils/cache/relmapper.c @@ -49,6 +49,7 @@ #include "catalog/storage.h" #include "miscadmin.h" #include "storage/fd.h" +#include "storage/lwlock.h" #include "utils/inval.h" #include "utils/relmapper.h" diff --git a/src/backend/utils/cache/spccache.c b/src/backend/utils/cache/spccache.c index 54d8d6f808..228e7d1ec8 100644 --- a/src/backend/utils/cache/spccache.c +++ b/src/backend/utils/cache/spccache.c @@ -23,6 +23,7 @@ #include "commands/tablespace.h" #include "miscadmin.h" #include "optimizer/cost.h" +#include "utils/hsearch.h" #include "utils/inval.h" #include "utils/spccache.h" #include "utils/syscache.h" diff --git a/src/backend/utils/fmgr/funcapi.c b/src/backend/utils/fmgr/funcapi.c index 3861f402c3..0911c8083b 100644 --- a/src/backend/utils/fmgr/funcapi.c +++ b/src/backend/utils/fmgr/funcapi.c @@ -19,6 +19,7 @@ #include "funcapi.h" #include "nodes/nodeFuncs.h" #include "parser/parse_coerce.h" +#include "utils/array.h" #include "utils/builtins.h" #include "utils/lsyscache.h" #include "utils/memutils.h" diff --git a/src/backend/utils/hash/dynahash.c b/src/backend/utils/hash/dynahash.c index dad7994923..d9027291ee 100644 --- a/src/backend/utils/hash/dynahash.c +++ b/src/backend/utils/hash/dynahash.c @@ -64,6 +64,8 @@ #include "postgres.h" #include "access/xact.h" +#include "storage/shmem.h" +#include "storage/spin.h" #include "utils/dynahash.h" #include "utils/memutils.h" diff --git a/src/backend/utils/resowner/resowner.c b/src/backend/utils/resowner/resowner.c index 773a0d82ef..b0faaa108a 100644 --- a/src/backend/utils/resowner/resowner.c +++ b/src/backend/utils/resowner/resowner.c @@ -22,6 +22,7 @@ #include "access/hash.h" #include "storage/predicate.h" +#include "storage/proc.h" #include "utils/memutils.h" #include "utils/rel.h" #include "utils/snapmgr.h" diff --git a/src/backend/utils/time/combocid.c b/src/backend/utils/time/combocid.c index 28c8a17220..d9b37b2ba3 100644 --- a/src/backend/utils/time/combocid.c +++ b/src/backend/utils/time/combocid.c @@ -41,8 +41,10 @@ #include "postgres.h" +#include "access/htup.h" #include "access/xact.h" #include "utils/combocid.h" +#include "utils/hsearch.h" #include "utils/memutils.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 4b674c7c42..bb25ac6ab2 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -28,6 +28,7 @@ #include "access/transam.h" #include "access/xact.h" #include "storage/predicate.h" +#include "storage/proc.h" #include "storage/procarray.h" #include "utils/memutils.h" #include "utils/memutils.h" diff --git a/src/include/access/gin.h b/src/include/access/gin.h index aeba4c1e08..31e9733546 100644 --- a/src/include/access/gin.h +++ b/src/include/access/gin.h @@ -11,6 +11,7 @@ #define GIN_H #include "access/xlog.h" +#include "storage/block.h" #include "utils/relcache.h" diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index b8d06abf1f..776ea5c4cc 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -17,6 +17,8 @@ #include "access/sdir.h" #include "access/skey.h" #include "access/xlog.h" +#include "nodes/primnodes.h" +#include "storage/lock.h" #include "utils/relcache.h" #include "utils/snapshot.h" diff --git a/src/include/access/xact.h b/src/include/access/xact.h index 575bcd3cde..aaa620469f 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -15,6 +15,8 @@ #define XACT_H #include "access/xlog.h" +#include "nodes/pg_list.h" +#include "storage/relfilenode.h" /* diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h index 64f342ce59..3771ccbec4 100644 --- a/src/include/access/xlog.h +++ b/src/include/access/xlog.h @@ -14,7 +14,6 @@ #include "access/rmgr.h" #include "access/xlogdefs.h" #include "lib/stringinfo.h" -#include "replication/walsender.h" #include "storage/buf.h" #include "utils/pg_crc.h" #include "utils/timestamp.h" diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h index 097072ced1..68c0691015 100644 --- a/src/include/access/xlog_internal.h +++ b/src/include/access/xlog_internal.h @@ -17,6 +17,8 @@ #define XLOG_INTERNAL_H #include "access/xlog.h" +#include "storage/block.h" +#include "storage/relfilenode.h" /* diff --git a/src/include/catalog/storage.h b/src/include/catalog/storage.h index 5b4d674e5d..8769bfd644 100644 --- a/src/include/catalog/storage.h +++ b/src/include/catalog/storage.h @@ -15,6 +15,8 @@ #define STORAGE_H #include "access/xlog.h" +#include "storage/block.h" +#include "storage/relfilenode.h" #include "utils/relcache.h" extern void RelationCreateStorage(RelFileNode rnode, char relpersistence); diff --git a/src/include/commands/copy.h b/src/include/commands/copy.h index 06337e6114..a31479defb 100644 --- a/src/include/commands/copy.h +++ b/src/include/commands/copy.h @@ -15,6 +15,8 @@ #define COPY_H #include "nodes/execnodes.h" +#include "nodes/parsenodes.h" +#include "tcop/dest.h" /* CopyStateData is private in commands/copy.c */ typedef struct CopyStateData *CopyState; diff --git a/src/include/commands/dbcommands.h b/src/include/commands/dbcommands.h index e704380b60..21dacff39c 100644 --- a/src/include/commands/dbcommands.h +++ b/src/include/commands/dbcommands.h @@ -15,6 +15,7 @@ #define DBCOMMANDS_H #include "access/xlog.h" +#include "nodes/parsenodes.h" /* XLOG stuff */ #define XLOG_DBASE_CREATE 0x00 diff --git a/src/include/commands/portalcmds.h b/src/include/commands/portalcmds.h index 49605da63e..87c57f4c87 100644 --- a/src/include/commands/portalcmds.h +++ b/src/include/commands/portalcmds.h @@ -14,6 +14,7 @@ #ifndef PORTALCMDS_H #define PORTALCMDS_H +#include "nodes/parsenodes.h" #include "utils/portal.h" diff --git a/src/include/commands/sequence.h b/src/include/commands/sequence.h index 1ef0f91e95..85452b0cfd 100644 --- a/src/include/commands/sequence.h +++ b/src/include/commands/sequence.h @@ -13,6 +13,8 @@ #ifndef SEQUENCE_H #define SEQUENCE_H +#include "nodes/parsenodes.h" +#include "storage/relfilenode.h" #include "access/xlog.h" diff --git a/src/include/commands/tablespace.h b/src/include/commands/tablespace.h index 5b1fb6eddc..4692098a65 100644 --- a/src/include/commands/tablespace.h +++ b/src/include/commands/tablespace.h @@ -15,6 +15,7 @@ #define TABLESPACE_H #include "access/xlog.h" +#include "nodes/parsenodes.h" /* XLOG stuff */ #define XLOG_TBLSPC_CREATE 0x00 diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h index 3ac4a823ec..fe21298b64 100644 --- a/src/include/commands/trigger.h +++ b/src/include/commands/trigger.h @@ -14,6 +14,7 @@ #define TRIGGER_H #include "nodes/execnodes.h" +#include "nodes/parsenodes.h" /* * TriggerData is the node type that is passed as fmgr "context" info diff --git a/src/include/executor/execdesc.h b/src/include/executor/execdesc.h index 1c00b0dd27..2925deb7b6 100644 --- a/src/include/executor/execdesc.h +++ b/src/include/executor/execdesc.h @@ -16,6 +16,7 @@ #define EXECDESC_H #include "nodes/execnodes.h" +#include "tcop/dest.h" /* ---------------- diff --git a/src/include/executor/functions.h b/src/include/executor/functions.h index d565469b26..aaa36c5826 100644 --- a/src/include/executor/functions.h +++ b/src/include/executor/functions.h @@ -15,6 +15,7 @@ #define FUNCTIONS_H #include "nodes/execnodes.h" +#include "tcop/dest.h" /* This struct is known only within executor/functions.c */ typedef struct SQLFunctionParseInfo *SQLFunctionParseInfoPtr; diff --git a/src/include/executor/spi.h b/src/include/executor/spi.h index d0c7696d34..7199debb27 100644 --- a/src/include/executor/spi.h +++ b/src/include/executor/spi.h @@ -13,6 +13,7 @@ #ifndef SPI_H #define SPI_H +#include "nodes/parsenodes.h" #include "utils/portal.h" diff --git a/src/include/replication/syncrep.h b/src/include/replication/syncrep.h index d71047e147..65b725f767 100644 --- a/src/include/replication/syncrep.h +++ b/src/include/replication/syncrep.h @@ -13,15 +13,8 @@ #ifndef _SYNCREP_H #define _SYNCREP_H -#include "access/xlog.h" -#include "storage/proc.h" -#include "storage/shmem.h" -#include "storage/spin.h" #include "utils/guc.h" -#define SyncRepRequested() \ - (max_wal_senders > 0 && synchronous_commit > SYNCHRONOUS_COMMIT_LOCAL_FLUSH) - /* syncRepState */ #define SYNC_REP_NOT_WAITING 0 #define SYNC_REP_WAITING 1 @@ -45,6 +38,7 @@ extern void SyncRepUpdateSyncStandbysDefined(void); /* called by various procs */ extern int SyncRepWakeQueue(bool all); + extern bool check_synchronous_standby_names(char **newval, void **extra, GucSource source); #endif /* _SYNCREP_H */ diff --git a/src/include/replication/walsender.h b/src/include/replication/walsender.h index 1b7f50c52b..fe4dac81aa 100644 --- a/src/include/replication/walsender.h +++ b/src/include/replication/walsender.h @@ -12,10 +12,9 @@ #ifndef _WALSENDER_H #define _WALSENDER_H -#include "fmgr.h" +#include "access/xlog.h" #include "nodes/nodes.h" #include "storage/latch.h" -#include "replication/syncrep.h" #include "storage/shmem.h" #include "storage/spin.h" diff --git a/src/include/storage/standby.h b/src/include/storage/standby.h index d2e3e92d19..6ebac62db5 100644 --- a/src/include/storage/standby.h +++ b/src/include/storage/standby.h @@ -15,7 +15,9 @@ #define STANDBY_H #include "access/xlog.h" +#include "storage/lock.h" #include "storage/procsignal.h" +#include "storage/relfilenode.h" /* User-settable GUC parameters */ extern int vacuum_defer_cleanup_age; diff --git a/src/include/tcop/pquery.h b/src/include/tcop/pquery.h index 018577ecad..2a5e871c92 100644 --- a/src/include/tcop/pquery.h +++ b/src/include/tcop/pquery.h @@ -14,6 +14,7 @@ #ifndef PQUERY_H #define PQUERY_H +#include "nodes/parsenodes.h" #include "utils/portal.h" diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h index 898c732681..d5192d9855 100644 --- a/src/include/tcop/tcopprot.h +++ b/src/include/tcop/tcopprot.h @@ -20,7 +20,9 @@ #define TCOPPROT_H #include "executor/execdesc.h" +#include "nodes/parsenodes.h" #include "storage/procsignal.h" +#include "utils/guc.h" /* Required daylight between max_stack_depth and the kernel limit, in bytes */ diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.c index afc745612e..578cae5734 100644 --- a/src/pl/plpgsql/src/pl_comp.c +++ b/src/pl/plpgsql/src/pl_comp.c @@ -25,6 +25,7 @@ #include "nodes/makefuncs.h" #include "parser/parse_type.h" #include "utils/builtins.h" +#include "utils/guc.h" #include "utils/lsyscache.h" #include "utils/memutils.h" #include "utils/rel.h" diff --git a/src/pl/plpgsql/src/pl_handler.c b/src/pl/plpgsql/src/pl_handler.c index a10e418b33..e6e71432ff 100644 --- a/src/pl/plpgsql/src/pl_handler.c +++ b/src/pl/plpgsql/src/pl_handler.c @@ -20,6 +20,7 @@ #include "funcapi.h" #include "miscadmin.h" #include "utils/builtins.h" +#include "utils/guc.h" #include "utils/lsyscache.h" #include "utils/syscache.h"