X-Git-Url: http://sigaev.ru/git/gitweb.cgi?a=blobdiff_plain;f=online_analyze.c;h=82736730167ee7e9a991cb269d3396fa28735e43;hb=837e66bd8a47b18ef7c38210598357de001e40fe;hp=50ee68bf6b4f9c585f5ac772826fe59a7c890878;hpb=076f3634498b8bd7ae8bd5315f327f9a8fc5175a;p=online_analyze.git diff --git a/online_analyze.c b/online_analyze.c index 50ee68b..8273673 100644 --- a/online_analyze.c +++ b/online_analyze.c @@ -125,11 +125,13 @@ tableListAssign(const char * newval, bool doit, TableList *tbl) foreach(l, namelist) { char *curname = (char *) lfirst(l); - Oid relOid = RangeVarGetRelid(makeRangeVarFromNameList(stringToQualifiedNameList(curname)), #if PG_VERSION_NUM >= 90200 - NoLock, -#endif + Oid relOid = RangeVarGetRelid(makeRangeVarFromNameList(stringToQualifiedNameList(curname)), + NoLock, true); +#else + Oid relOid = RangeVarGetRelid(makeRangeVarFromNameList(stringToQualifiedNameList(curname)), true); +#endif if (relOid == InvalidOid) { @@ -308,6 +310,9 @@ makeAnalyze(Oid relOid, CmdType operation, uint32 naffected) if (relOid == InvalidOid) return; + if (get_rel_relkind(relOid) != RELKIND_RELATION) + return; + tabentry = pgstat_fetch_stat_tabentry(relOid); #if PG_VERSION_NUM >= 90000 @@ -442,11 +447,9 @@ onlineAnalyzeHooker(QueryDesc *queryDesc) if (online_analyze_enable && queryDesc->plannedstmt && (queryDesc->operation == CMD_INSERT || queryDesc->operation == CMD_UPDATE || - queryDesc->operation == CMD_DELETE || -#if PG_VERSION_NUM >= 90200 - 0 /* (queryDesc->operation == CMD_SELECT && queryDesc->dest && queryDesc->dest == DestIntoRel) */ -#else - (queryDesc->operation == CMD_SELECT && queryDesc->plannedstmt->intoClause) + queryDesc->operation == CMD_DELETE +#if PG_VERSION_NUM < 90200 + || (queryDesc->operation == CMD_SELECT && queryDesc->plannedstmt->intoClause) #endif )) {