diff options
| author | Heikki Linnakangas | 2024-03-04 08:25:12 +0000 |
|---|---|---|
| committer | Heikki Linnakangas | 2024-03-04 08:25:12 +0000 |
| commit | 393b5599e5177e456cdce500039813629d370b38 (patch) | |
| tree | bafd118d5dd94f63bcc711457a6d9c9248064051 /src/backend/commands/vacuum.c | |
| parent | 067701f57758f9baed5bd9d868539738d77bfa92 (diff) | |
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/[email protected]
Diffstat (limited to 'src/backend/commands/vacuum.c')
| -rw-r--r-- | src/backend/commands/vacuum.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index 64da8486276..e40cef6566e 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -564,7 +564,7 @@ vacuum(List *relations, VacuumParams *params, BufferAccessStrategy bstrategy, else { Assert(params->options & VACOPT_ANALYZE); - if (IsAutoVacuumWorkerProcess()) + if (AmAutoVacuumWorkerProcess()) use_own_xacts = true; else if (in_outer_xact) use_own_xacts = false; @@ -809,7 +809,7 @@ vacuum_open_relation(Oid relid, RangeVar *relation, bits32 options, * statements in the permission checks; otherwise, only log if the caller * so requested. */ - if (!IsAutoVacuumWorkerProcess()) + if (!AmAutoVacuumWorkerProcess()) elevel = WARNING; else if (verbose) elevel = LOG; @@ -896,7 +896,7 @@ expand_vacuum_rel(VacuumRelation *vrel, MemoryContext vac_context, * Since autovacuum workers supply OIDs when calling vacuum(), no * autovacuum worker should reach this code. */ - Assert(!IsAutoVacuumWorkerProcess()); + Assert(!AmAutoVacuumWorkerProcess()); /* * We transiently take AccessShareLock to protect the syscache lookup @@ -2336,7 +2336,7 @@ vacuum_delay_point(void) * [autovacuum_]vacuum_cost_delay to take effect while a table is being * vacuumed or analyzed. */ - if (ConfigReloadPending && IsAutoVacuumWorkerProcess()) + if (ConfigReloadPending && AmAutoVacuumWorkerProcess()) { ConfigReloadPending = false; ProcessConfigFile(PGC_SIGHUP); |
