aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/init/postinit.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-03-04 10:25:12 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-03-04 10:25:12 +0200
commit393b5599e5177e456cdce500039813629d370b38 (patch)
treebafd118d5dd94f63bcc711457a6d9c9248064051 /src/backend/utils/init/postinit.c
parent067701f57758f9baed5bd9d868539738d77bfa92 (diff)
downloadpostgresql-393b5599e5177e456cdce500039813629d370b38.tar.gz
postgresql-393b5599e5177e456cdce500039813629d370b38.zip
Use MyBackendType in more places to check what process this is
Remove IsBackgroundWorker, IsAutoVacuumLauncherProcess(), IsAutoVacuumWorkerProcess(), and IsLogicalSlotSyncWorker() in favor of new Am*Process() macros that use MyBackendType. For consistency with the existing Am*Process() macros. Reviewed-by: Andres Freund Discussion: https://www.postgresql.org/message-id/f3ecd4cb-85ee-4e54-8278-5fabfb3a4ed0@iki.fi
Diffstat (limited to 'src/backend/utils/init/postinit.c')
-rw-r--r--src/backend/utils/init/postinit.c8
1 files changed, 4 insertions, 4 deletions
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))
{