Introduces pg_get_statisticsobj_worker_compat macro

Relevant PG commit:
a4d75c86bf15220df22de0a92c819ecef9db3849
pull/5209/head
Halil Ozan Akgul 2021-08-19 19:33:10 +03:00 committed by Sait Talha Nisanci
parent f16d5e1833
commit 7823e49219
3 changed files with 8 additions and 2 deletions

View File

@ -442,8 +442,8 @@ GetExplicitStatisticsCommandList(Oid relationId)
foreach_oid(statisticsId, statisticsIdList) foreach_oid(statisticsId, statisticsIdList)
{ {
/* we need create commands for already created stats before distribution */ /* we need create commands for already created stats before distribution */
char *createStatisticsCommand = pg_get_statisticsobj_worker(statisticsId, char *createStatisticsCommand = pg_get_statisticsobj_worker_compat(statisticsId,
false, false); false, false);
explicitStatisticsCommandList = explicitStatisticsCommandList =
lappend(explicitStatisticsCommandList, lappend(explicitStatisticsCommandList,

View File

@ -50,8 +50,12 @@ char * pg_get_rule_expr(Node *expression);
extern void deparse_shard_query(Query *query, Oid distrelid, int64 shardid, extern void deparse_shard_query(Query *query, Oid distrelid, int64 shardid,
StringInfo buffer); StringInfo buffer);
extern char * pg_get_triggerdef_command(Oid triggerId); extern char * pg_get_triggerdef_command(Oid triggerId);
#if PG_VERSION_NUM >= PG_VERSION_14
extern char * pg_get_statisticsobj_worker(Oid statextid, bool columns_only, extern char * pg_get_statisticsobj_worker(Oid statextid, bool columns_only,
bool missing_ok); bool missing_ok);
#else
extern char * pg_get_statisticsobj_worker(Oid statextid, bool missing_ok);
#endif
extern char * generate_relation_name(Oid relid, List *namespaces); extern char * generate_relation_name(Oid relid, List *namespaces);
extern char * generate_qualified_relation_name(Oid relid); extern char * generate_qualified_relation_name(Oid relid);
extern char * generate_operator_name(Oid operid, Oid arg1, Oid arg2); extern char * generate_operator_name(Oid operid, Oid arg1, Oid arg2);

View File

@ -62,6 +62,7 @@
#define RelationGetPartitionDesc_compat(a, b) RelationGetPartitionDesc(a, b) #define RelationGetPartitionDesc_compat(a, b) RelationGetPartitionDesc(a, b)
#define make_simple_restrictinfo_compat(a, b) make_simple_restrictinfo(a, b) #define make_simple_restrictinfo_compat(a, b) make_simple_restrictinfo(a, b)
#define pull_varnos_compat(a, b) pull_varnos(a, b) #define pull_varnos_compat(a, b) pull_varnos(a, b)
#define pg_get_statisticsobj_worker_compat(a, b, c) pg_get_statisticsobj_worker(a, b, c)
#else #else
#define AlterTableStmtObjType(a) ((a)->relkind) #define AlterTableStmtObjType(a) ((a)->relkind)
#define F_NEXTVAL_COMPAT F_NEXTVAL_OID #define F_NEXTVAL_COMPAT F_NEXTVAL_OID
@ -98,6 +99,7 @@
#define PQ_LARGE_MESSAGE_LIMIT 0 #define PQ_LARGE_MESSAGE_LIMIT 0
#define make_simple_restrictinfo_compat(a, b) make_simple_restrictinfo(b) #define make_simple_restrictinfo_compat(a, b) make_simple_restrictinfo(b)
#define pull_varnos_compat(a, b) pull_varnos(b) #define pull_varnos_compat(a, b) pull_varnos(b)
#define pg_get_statisticsobj_worker_compat(a, b, c) pg_get_statisticsobj_worker(a, c)
#endif #endif
#if PG_VERSION_NUM >= PG_VERSION_13 #if PG_VERSION_NUM >= PG_VERSION_13