+ /*
+ * follow work could be done only in normal processing because of
+ * accsess to system catalog
+ */
+#if PG_VERSION_NUM >= 170000
+ if (MyProcNumber == INVALID_PROC_NUMBER ||
+#else
+ if (MyBackendId == InvalidBackendId ||
+#endif
+ !IsUnderPostmaster ||
+ !IsTransactionState())
+ {
+ /* reset init state */
+ switch(kind)
+ {
+ case EnabledKind:
+ plantuner_enable_inited = false;
+ break;
+ case DisabledKind:
+ plantuner_disable_inited = false;
+ break;
+ case OnlyKind:
+ plantuner_only_inited = false;
+ break;
+ default:
+ elog(ERROR, "wrong kind");
+ }
+
+ return newval;
+ }
+