Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f8a834b

Browse files
committed
makeRangeVar for 9.5
1 parent dee9b0d commit f8a834b

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

online_analyze.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
#include "utils/rel.h"
4747
#include "utils/relcache.h"
4848
#include "utils/timestamp.h"
49+
#if PG_VERSION_NUM >= 90500
50+
#include "nodes/makefuncs.h"
51+
#endif
4952
#endif
5053

5154
#ifdef PG_MODULE_MAGIC
@@ -63,7 +66,7 @@ static ExecutorEnd_hook_type oldExecutorEndHook = NULL;
6366
static ProcessUtility_hook_type oldProcessUtilityHook = NULL;
6467
#endif
6568

66-
typedef enum
69+
typedef enum
6770
{
6871
OATT_ALL = 0x03,
6972
OATT_PERSISTENT = 0x01,
@@ -301,6 +304,19 @@ matchOid(TableList *tbl, Oid oid)
301304
return false;
302305
}
303306

307+
#if PG_VERSION_NUM >= 90500
308+
static RangeVar*
309+
makeRangeVarFromOid(Oid relOid)
310+
{
311+
return makeRangeVar(
312+
get_namespace_name(get_rel_namespace(relOid)),
313+
get_rel_name(relOid),
314+
-1
315+
);
316+
317+
}
318+
#endif
319+
304320
static void
305321
makeAnalyze(Oid relOid, CmdType operation, uint32 naffected)
306322
{
@@ -423,7 +439,7 @@ makeAnalyze(Oid relOid, CmdType operation, uint32 naffected)
423439
, true
424440
#endif
425441
#else
426-
NULL /*RangeVar*/, VACOPT_ANALYZE | ((online_analyze_verbose) ? VACOPT_VERBOSE : 0),
442+
makeRangeVarFromOid(relOid), VACOPT_ANALYZE | ((online_analyze_verbose) ? VACOPT_VERBOSE : 0),
427443
&vacstmt, NULL, true, GetAccessStrategy(BAS_VACUUM)
428444
#endif
429445
);

0 commit comments

Comments
 (0)