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:
dee9b0d
)
makeRangeVar for 9.5
author
Teodor Sigaev
<teodor@sigaev.ru>
Tue, 3 Nov 2015 16:32:19 +0000
(19:32 +0300)
committer
Teodor Sigaev
<teodor@sigaev.ru>
Tue, 3 Nov 2015 16:32:19 +0000
(19:32 +0300)
online_analyze.c
patch
|
blob
|
history
diff --git
a/online_analyze.c
b/online_analyze.c
index
3f54bab
..
c4c2691
100644
(file)
--- a/
online_analyze.c
+++ b/
online_analyze.c
@@
-46,6
+46,9
@@
#include "utils/rel.h"
#include "utils/relcache.h"
#include "utils/timestamp.h"
#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
#endif
#ifdef PG_MODULE_MAGIC
@@
-63,7
+66,7
@@
static ExecutorEnd_hook_type oldExecutorEndHook = NULL;
static ProcessUtility_hook_type oldProcessUtilityHook = NULL;
#endif
static ProcessUtility_hook_type oldProcessUtilityHook = NULL;
#endif
-typedef enum
+typedef enum
{
OATT_ALL = 0x03,
OATT_PERSISTENT = 0x01,
{
OATT_ALL = 0x03,
OATT_PERSISTENT = 0x01,
@@
-301,6
+304,19
@@
matchOid(TableList *tbl, Oid oid)
return false;
}
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)
{
static void
makeAnalyze(Oid relOid, CmdType operation, uint32 naffected)
{
@@
-423,7
+439,7
@@
makeAnalyze(Oid relOid, CmdType operation, uint32 naffected)
, true
#endif
#else
, 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
);
&vacstmt, NULL, true, GetAccessStrategy(BAS_VACUUM)
#endif
);