From 37eb65f748ca2413f8d4425e87120c027a95b48b Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Tue, 2 Apr 2024 14:42:05 +0300 Subject: [PATCH] Replace BackendIds with 0-based ProcNumbers Marina Polyakova --- online_analyze.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/online_analyze.c b/online_analyze.c index afc6b29..150a126 100644 --- a/online_analyze.c +++ b/online_analyze.c @@ -171,7 +171,12 @@ tableListAssign(const char * newval, bool doit, TableList *tbl) * follow work could be done only in normal processing because of * accsess to system catalog */ - if (MyBackendId == InvalidBackendId || !IsUnderPostmaster || +#if PG_VERSION_NUM >= 170000 + if (MyProcNumber == INVALID_PROC_NUMBER || +#else + if (MyBackendId == InvalidBackendId || +#endif + !IsUnderPostmaster || !IsTransactionState()) { includeTables.inited = false; @@ -314,7 +319,12 @@ lateInit() TableList *tl[] = {&includeTables, &excludeTables}; int i; - if (MyBackendId == InvalidBackendId || !IsUnderPostmaster || +#if PG_VERSION_NUM >= 170000 + if (MyProcNumber == INVALID_PROC_NUMBER || +#else + if (MyBackendId == InvalidBackendId || +#endif + !IsUnderPostmaster || !IsTransactionState()) return; /* we aren't in connected state */ -- 2.46.1