Add static decoration to avoid error: "no
[plantuner.git] / plantuner.c
index 0c07b7f..0148a75 100644 (file)
@@ -69,7 +69,7 @@ static int    nOnlyIndexes = 0;
 static Oid     *onlyIndexes = NULL;
 static char *onlyIndexesOutStr = "";
 
 static Oid     *onlyIndexes = NULL;
 static char *onlyIndexesOutStr = "";
 
-get_relation_info_hook_type    prevHook = NULL;
+static get_relation_info_hook_type     prevHook = NULL;
 static bool    fix_empty_table = false;
 
 static bool    plantuner_enable_inited = false;
 static bool    fix_empty_table = false;
 
 static bool    plantuner_enable_inited = false;
@@ -102,7 +102,12 @@ indexesAssign(const char * newval, bool doit, GucSource source,
         * follow work could be done only in normal processing because of
         * accsess to system catalog
         */
         * 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())
        {
                /* reset init state */
                !IsTransactionState())
        {
                /* reset init state */