|
39 | 39 | #include "utils/builtins.h"
|
40 | 40 | #include "utils/lsyscache.h"
|
41 | 41 | #include "utils/guc.h"
|
| 42 | +#if PG_VERSION_NUM >= 90200 |
| 43 | +#include "catalog/pg_class.h" |
| 44 | +#include "utils/rel.h" |
| 45 | +#include "utils/relcache.h" |
| 46 | +#include "utils/timestamp.h" |
| 47 | +#endif |
42 | 48 |
|
43 | 49 | #ifdef PG_MODULE_MAGIC
|
44 | 50 | PG_MODULE_MAGIC;
|
@@ -112,7 +118,11 @@ tableListAssign(const char * newval, bool doit, TableList *tbl)
|
112 | 118 | foreach(l, namelist)
|
113 | 119 | {
|
114 | 120 | char *curname = (char *) lfirst(l);
|
115 |
| - Oid relOid = RangeVarGetRelid(makeRangeVarFromNameList(stringToQualifiedNameList(curname)), true); |
| 121 | + Oid relOid = RangeVarGetRelid(makeRangeVarFromNameList(stringToQualifiedNameList(curname)), |
| 122 | +#if PG_VERSION_NUM >= 90200 |
| 123 | + NoLock, |
| 124 | +#endif |
| 125 | + true); |
116 | 126 |
|
117 | 127 | if (relOid == InvalidOid)
|
118 | 128 | {
|
@@ -428,15 +438,23 @@ onlineAnalyzeHooker(QueryDesc *queryDesc)
|
428 | 438 | (queryDesc->operation == CMD_INSERT ||
|
429 | 439 | queryDesc->operation == CMD_UPDATE ||
|
430 | 440 | queryDesc->operation == CMD_DELETE ||
|
431 |
| - (queryDesc->operation == CMD_SELECT && queryDesc->plannedstmt->intoClause))) |
| 441 | +#if PG_VERSION_NUM >= 90200 |
| 442 | + 0 /* (queryDesc->operation == CMD_SELECT && queryDesc->dest && queryDesc->dest == DestIntoRel) */ |
| 443 | +#else |
| 444 | + (queryDesc->operation == CMD_SELECT && queryDesc->plannedstmt->intoClause) |
| 445 | +#endif |
| 446 | + )) |
432 | 447 | {
|
433 |
| - if (queryDesc->plannedstmt->intoClause) |
| 448 | +#if PG_VERSION_NUM < 90200 |
| 449 | + if (queryDesc->operation == CMD_SELECT) |
434 | 450 | {
|
435 | 451 | Oid relOid = RangeVarGetRelid(queryDesc->plannedstmt->intoClause->rel, true);
|
436 | 452 |
|
437 | 453 | makeAnalyze(relOid, queryDesc->operation, naffected);
|
438 | 454 | }
|
439 |
| - else if (queryDesc->plannedstmt->resultRelations && |
| 455 | + else |
| 456 | +#endif |
| 457 | + if (queryDesc->plannedstmt->resultRelations && |
440 | 458 | queryDesc->plannedstmt->rtable)
|
441 | 459 | {
|
442 | 460 | ListCell *l;
|
|
0 commit comments