Replace BackendIds with 0-based ProcNumbers Marina Polyakova <m.polyakova@postgrespro.ru>
authorTeodor Sigaev <teodor@sigaev.ru>
Tue, 2 Apr 2024 11:42:05 +0000 (14:42 +0300)
committerTeodor Sigaev <teodor@sigaev.ru>
Tue, 2 Apr 2024 11:42:05 +0000 (14:42 +0300)
online_analyze.c

index afc6b29..150a126 100644 (file)
@@ -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 */