From: Teodor Sigaev Date: Tue, 3 Nov 2015 16:32:19 +0000 (+0300) Subject: makeRangeVar for 9.5 X-Git-Url: http://sigaev.ru/git/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;h=f8a834b84931b269df6568ce294468984ea5b879;p=online_analyze.git makeRangeVar for 9.5 --- 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 );