From f8a834b84931b269df6568ce294468984ea5b879 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Tue, 3 Nov 2015 19:32:19 +0300 Subject: [PATCH] makeRangeVar for 9.5 --- online_analyze.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/online_analyze.c b/online_analyze.c index 3f54bab..c4c2691 100644 --- a/online_analyze.c +++ b/online_analyze.c @@ -46,6 +46,9 @@ #include "utils/rel.h" #include "utils/relcache.h" #include "utils/timestamp.h" +#if PG_VERSION_NUM >= 90500 +#include "nodes/makefuncs.h" +#endif #endif #ifdef PG_MODULE_MAGIC @@ -63,7 +66,7 @@ static ExecutorEnd_hook_type oldExecutorEndHook = NULL; static ProcessUtility_hook_type oldProcessUtilityHook = NULL; #endif -typedef enum +typedef enum { OATT_ALL = 0x03, OATT_PERSISTENT = 0x01, @@ -301,6 +304,19 @@ matchOid(TableList *tbl, Oid oid) return false; } +#if PG_VERSION_NUM >= 90500 +static RangeVar* +makeRangeVarFromOid(Oid relOid) +{ + return makeRangeVar( + get_namespace_name(get_rel_namespace(relOid)), + get_rel_name(relOid), + -1 + ); + +} +#endif + static void makeAnalyze(Oid relOid, CmdType operation, uint32 naffected) { @@ -423,7 +439,7 @@ makeAnalyze(Oid relOid, CmdType operation, uint32 naffected) , true #endif #else - NULL /*RangeVar*/, VACOPT_ANALYZE | ((online_analyze_verbose) ? VACOPT_VERBOSE : 0), + makeRangeVarFromOid(relOid), VACOPT_ANALYZE | ((online_analyze_verbose) ? VACOPT_VERBOSE : 0), &vacstmt, NULL, true, GetAccessStrategy(BAS_VACUUM) #endif ); -- 2.37.3