diff options
Diffstat (limited to 'src/backend/utils')
-rw-r--r-- | src/backend/utils/activity/pgstat_relation.c | 4 | ||||
-rw-r--r-- | src/backend/utils/init/globals.c | 1 | ||||
-rw-r--r-- | src/backend/utils/init/miscinit.c | 4 | ||||
-rw-r--r-- | src/backend/utils/init/postinit.c | 8 |
4 files changed, 8 insertions, 9 deletions
diff --git a/src/backend/utils/activity/pgstat_relation.c b/src/backend/utils/activity/pgstat_relation.c index 111050725a6..b20a60b5a87 100644 --- a/src/backend/utils/activity/pgstat_relation.c +++ b/src/backend/utils/activity/pgstat_relation.c @@ -246,7 +246,7 @@ pgstat_report_vacuum(Oid tableoid, bool shared, */ tabentry->ins_since_vacuum = 0; - if (IsAutoVacuumWorkerProcess()) + if (AmAutoVacuumWorkerProcess()) { tabentry->last_autovacuum_time = ts; tabentry->autovacuum_count++; @@ -337,7 +337,7 @@ pgstat_report_analyze(Relation rel, if (resetcounter) tabentry->mod_since_analyze = 0; - if (IsAutoVacuumWorkerProcess()) + if (AmAutoVacuumWorkerProcess()) { tabentry->last_autoanalyze_time = GetCurrentTimestamp(); tabentry->autoanalyze_count++; diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c index aea95c8a69b..5b536ac50d1 100644 --- a/src/backend/utils/init/globals.c +++ b/src/backend/utils/init/globals.c @@ -115,7 +115,6 @@ pid_t PostmasterPid = 0; bool IsPostmasterEnvironment = false; bool IsUnderPostmaster = false; bool IsBinaryUpgrade = false; -bool IsBackgroundWorker = false; bool ExitOnAnyError = false; diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c index 77fd8047563..ad6ab45c677 100644 --- a/src/backend/utils/init/miscinit.c +++ b/src/backend/utils/init/miscinit.c @@ -841,8 +841,8 @@ InitializeSessionUserIdStandalone(void) * This function should only be called in single-user mode, in autovacuum * workers, in slot sync worker and in background workers. */ - Assert(!IsUnderPostmaster || IsAutoVacuumWorkerProcess() || - IsLogicalSlotSyncWorker() || IsBackgroundWorker); + Assert(!IsUnderPostmaster || AmAutoVacuumWorkerProcess() || + AmLogicalSlotSyncWorkerProcess() || AmBackgroundWorkerProcess()); /* call only once */ Assert(!OidIsValid(AuthenticatedUserId)); diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index c49c048441b..6a320aaedb7 100644 --- a/src/backend/utils/init/postinit.c +++ b/src/backend/utils/init/postinit.c @@ -346,7 +346,7 @@ CheckMyDatabase(const char *name, bool am_superuser, bool override_allow_connect * * We do not enforce them for autovacuum worker processes either. */ - if (IsUnderPostmaster && !IsAutoVacuumWorkerProcess()) + if (IsUnderPostmaster && !AmAutoVacuumWorkerProcess()) { /* * Check that the database is currently allowing connections. @@ -828,7 +828,7 @@ InitPostgres(const char *in_dbname, Oid dboid, before_shmem_exit(ShutdownPostgres, 0); /* The autovacuum launcher is done here */ - if (IsAutoVacuumLauncherProcess()) + if (AmAutoVacuumLauncherProcess()) { /* report this backend in the PgBackendStatus array */ pgstat_bestart(); @@ -873,7 +873,7 @@ InitPostgres(const char *in_dbname, Oid dboid, * process, we use a fixed ID, otherwise we figure it out from the * authenticated user name. */ - if (bootstrap || IsAutoVacuumWorkerProcess() || IsLogicalSlotSyncWorker()) + if (bootstrap || AmAutoVacuumWorkerProcess() || AmLogicalSlotSyncWorkerProcess()) { InitializeSessionUserIdStandalone(); am_superuser = true; @@ -889,7 +889,7 @@ InitPostgres(const char *in_dbname, Oid dboid, errhint("You should immediately run CREATE USER \"%s\" SUPERUSER;.", username != NULL ? username : "postgres"))); } - else if (IsBackgroundWorker) + else if (AmBackgroundWorkerProcess()) { if (username == NULL && !OidIsValid(useroid)) { |