* 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;
foreach(l, namelist)
{
char *curname = (char *) lfirst(l);
-#if PG_VERSION_NUM >= 90200
+#if PG_VERSION_NUM >= 160000
+ Oid relOid = RangeVarGetRelid(makeRangeVarFromNameList(
+ stringToQualifiedNameList(curname, NULL)), NoLock, true);
+#elif PG_VERSION_NUM >= 90200
Oid relOid = RangeVarGetRelid(makeRangeVarFromNameList(
stringToQualifiedNameList(curname)), NoLock, true);
#else
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 */
{
Datum tblnamed = constval->constvalue;
char *tblname = text_to_cstring(DatumGetTextP(tblnamed));
+#if PG_VERSION_NUM >= 160000
+ RangeVar *tblvar =
+ makeRangeVarFromNameList(stringToQualifiedNameList(tblname, NULL));
+#else
RangeVar *tblvar =
makeRangeVarFromNameList(stringToQualifiedNameList(tblname));
+#endif
makeAnalyze(RangeVarGetRelid(tblvar,
NoLock,
RegisterXactCallback(removeTable, NULL);
}
-
-#if PG_VERSION_NUM < 150000
-void _PG_fini(void);
-void
-_PG_fini(void)
-{
- ExecutorEnd_hook = oldExecutorEndHook;
-#if PG_VERSION_NUM >= 90200
- ProcessUtility_hook = oldProcessUtilityHook;
-#endif
-
- if (excludeTables.tables)
- free(excludeTables.tables);
- if (includeTables.tables)
- free(includeTables.tables);
-
- excludeTables.tables = includeTables.tables = NULL;
- excludeTables.nTables = includeTables.nTables = 0;
-}
-#endif