support 9.4
[online_analyze.git] / online_analyze.c
index 8273673..299ae57 100644 (file)
@@ -337,6 +337,8 @@ makeAnalyze(Oid relOid, CmdType operation, uint32 naffected)
                VacuumStmt                              vacstmt;
                TimestampTz                             startStamp, endStamp;
 
+               memset(&startStamp, 0, sizeof(startStamp)); /* keep compiler quiet */
+
                /*
                 * includeTables overwrites excludeTables
                 */
@@ -398,8 +400,12 @@ makeAnalyze(Oid relOid, CmdType operation, uint32 naffected)
                if (online_analyze_verbose)
                        startStamp = GetCurrentTimestamp();
 
-               analyze_rel(relOid, &vacstmt, GetAccessStrategy(BAS_VACUUM)
-#if (PG_VERSION_NUM < 90004) && (PG_VERSION_NUM >= 90000)
+               analyze_rel(relOid, &vacstmt
+#if PG_VERSION_NUM >= 90018
+                       , true
+#endif
+                       , GetAccessStrategy(BAS_VACUUM)
+#if (PG_VERSION_NUM >= 90000) && (PG_VERSION_NUM < 90004)
                        , true
 #endif
                );
@@ -486,8 +492,12 @@ onlineAnalyzeHooker(QueryDesc *queryDesc)
 
 #if PG_VERSION_NUM >= 90200
 static void
-onlineAnalyzeHookerUtility(Node *parsetree, const char *queryString, 
+onlineAnalyzeHookerUtility(Node *parsetree, const char *queryString,
+#if PG_VERSION_NUM >= 90300
+                                                       ProcessUtilityContext context, ParamListInfo params,
+#else
                                                        ParamListInfo params, bool isTopLevel,
+#endif
                                                        DestReceiver *dest, char *completionTag) {
        RangeVar        *tblname = NULL;
 
@@ -495,9 +505,21 @@ onlineAnalyzeHookerUtility(Node *parsetree, const char *queryString,
                tblname = (RangeVar*)copyObject(((CreateTableAsStmt*)parsetree)->into->rel);
 
        if (oldProcessUtilityHook)
-               oldProcessUtilityHook(parsetree, queryString, params, isTopLevel, dest, completionTag);
+               oldProcessUtilityHook(parsetree, queryString, 
+#if PG_VERSION_NUM >= 90300
+                                                         context, params,
+#else
+                                                         params, isTopLevel,
+#endif
+                                                         dest, completionTag);
        else
-               standard_ProcessUtility(parsetree, queryString, params, isTopLevel, dest, completionTag);
+               standard_ProcessUtility(parsetree, queryString, 
+#if PG_VERSION_NUM >= 90300
+                                                               context, params,
+#else
+                                                               params, isTopLevel,
+#endif
+                                                               dest, completionTag);
 
        if (tblname) {
                Oid     tblOid = RangeVarGetRelid(tblname, NoLock, true);
@@ -606,7 +628,7 @@ _PG_init(void)
                "online_analyze.min_interval",
                "minimum time interval between analyze call (in milliseconds)",
                "minimum time interval between analyze call (in milliseconds)",
-               &online_analyze_scale_factor,
+               &online_analyze_min_interval,
 #if PG_VERSION_NUM >= 80400
                online_analyze_min_interval,
 #endif