mirror of https://github.com/citusdata/citus.git
Add wrapper function introduced in PG11 for compatibility
parent
1106e14385
commit
574b071113
|
@ -67,6 +67,7 @@
|
|||
#include "distributed/query_colocation_checker.h"
|
||||
#include "distributed/recursive_planning.h"
|
||||
#include "distributed/relation_restriction_equivalence.h"
|
||||
#include "distributed/version_compat.h"
|
||||
#include "lib/stringinfo.h"
|
||||
#include "optimizer/planner.h"
|
||||
#include "optimizer/prep.h"
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "optimizer/prep.h"
|
||||
#include "postmaster/bgworker.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "funcapi.h"
|
||||
|
||||
/* PostgreSQL 11 splits hash procs into "standard" and "extended" */
|
||||
#define HASHSTANDARD_PROC HASHPROC
|
||||
|
@ -134,6 +135,33 @@ canonicalize_qual_compat(Expr *qual, bool is_check)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* A convenient wrapper around get_expr_result_type() that is added on PG11
|
||||
*
|
||||
* Note that this function ignores the second parameter and behaves
|
||||
* slightly differently.
|
||||
*
|
||||
* 1. The original function throws errors if noError flag is not set, we ignore
|
||||
* this flag here and return NULL in that case
|
||||
* 2. TYPEFUNC_COMPOSITE_DOMAIN is introduced in PG11, and references to this
|
||||
* macro is removed
|
||||
* */
|
||||
static inline TupleDesc
|
||||
get_expr_result_tupdesc(Node *expr, bool noError)
|
||||
{
|
||||
TupleDesc tupleDesc;
|
||||
TypeFuncClass functypclass;
|
||||
|
||||
functypclass = get_expr_result_type(expr, NULL, &tupleDesc);
|
||||
|
||||
if (functypclass == TYPEFUNC_COMPOSITE)
|
||||
{
|
||||
return tupleDesc;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#if (PG_VERSION_NUM >= 110000)
|
||||
|
|
Loading…
Reference in New Issue