projects
/
online_analyze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e7737f1
)
make compile on 9.2, although CREATE TABLE AS/SELECT INTO is not working yet
author
Teodor Sigaev
<teodor@sigaev.ru>
Tue, 11 Sep 2012 18:27:38 +0000
(22:27 +0400)
committer
Teodor Sigaev
<teodor@sigaev.ru>
Tue, 11 Sep 2012 18:27:38 +0000
(22:27 +0400)
online_analyze.c
patch
|
blob
|
history
diff --git
a/online_analyze.c
b/online_analyze.c
index
188e4db
..
a823216
100644
(file)
--- a/
online_analyze.c
+++ b/
online_analyze.c
@@
-39,6
+39,12
@@
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/guc.h"
#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;
#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);
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)
{
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_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);
}
{
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;
queryDesc->plannedstmt->rtable)
{
ListCell *l;