From: Teodor Sigaev Date: Tue, 11 Sep 2012 18:27:38 +0000 (+0400) Subject: make compile on 9.2, although CREATE TABLE AS/SELECT INTO is not working yet X-Git-Url: http://sigaev.ru/git/gitweb.cgi?a=commitdiff_plain;h=14e9a758e05dd5467bab85ef98fad76b8dbfcc87;p=online_analyze.git make compile on 9.2, although CREATE TABLE AS/SELECT INTO is not working yet --- diff --git a/online_analyze.c b/online_analyze.c index 188e4db..a823216 100644 --- a/online_analyze.c +++ b/online_analyze.c @@ -39,6 +39,12 @@ #include "utils/builtins.h" #include "utils/lsyscache.h" #include "utils/guc.h" +#if PG_VERSION_NUM >= 90200 +#include "catalog/pg_class.h" +#include "utils/rel.h" +#include "utils/relcache.h" +#include "utils/timestamp.h" +#endif #ifdef PG_MODULE_MAGIC PG_MODULE_MAGIC; @@ -112,7 +118,11 @@ tableListAssign(const char * newval, bool doit, TableList *tbl) foreach(l, namelist) { char *curname = (char *) lfirst(l); - Oid relOid = RangeVarGetRelid(makeRangeVarFromNameList(stringToQualifiedNameList(curname)), true); + Oid relOid = RangeVarGetRelid(makeRangeVarFromNameList(stringToQualifiedNameList(curname)), +#if PG_VERSION_NUM >= 90200 + NoLock, +#endif + true); if (relOid == InvalidOid) { @@ -428,15 +438,23 @@ onlineAnalyzeHooker(QueryDesc *queryDesc) (queryDesc->operation == CMD_INSERT || queryDesc->operation == CMD_UPDATE || queryDesc->operation == CMD_DELETE || - (queryDesc->operation == CMD_SELECT && queryDesc->plannedstmt->intoClause))) +#if PG_VERSION_NUM >= 90200 + 0 /* (queryDesc->operation == CMD_SELECT && queryDesc->dest && queryDesc->dest == DestIntoRel) */ +#else + (queryDesc->operation == CMD_SELECT && queryDesc->plannedstmt->intoClause) +#endif + )) { - if (queryDesc->plannedstmt->intoClause) +#if PG_VERSION_NUM < 90200 + if (queryDesc->operation == CMD_SELECT) { Oid relOid = RangeVarGetRelid(queryDesc->plannedstmt->intoClause->rel, true); makeAnalyze(relOid, queryDesc->operation, naffected); } - else if (queryDesc->plannedstmt->resultRelations && + else +#endif + if (queryDesc->plannedstmt->resultRelations && queryDesc->plannedstmt->rtable) { ListCell *l;