@@ -137,6 +137,27 @@ void CatalogIndexInsert(CatalogIndexState indstate, HeapTuple heapTuple);
137137#endif /* PG_VERSION_NUM */
138138
139139
140+ /*
141+ * create_nestloop_path()
142+ */
143+ #if PG_VERSION_NUM >= 100000
144+ #define create_nestloop_path_compat (root , joinrel , jointype , workspace , extra , \
145+ outer , inner , filtered_joinclauses , pathkeys , \
146+ required_outer ) \
147+ create_nestloop_path((root), (joinrel), (jointype), (workspace), (extra), \
148+ (outer), (inner), (filtered_joinclauses), (pathkeys), \
149+ (required_outer))
150+ #elif PG_VERSION_NUM >= 90500
151+ #define create_nestloop_path_compat (root , joinrel , jointype , workspace , extra , \
152+ outer , inner , filtered_joinclauses , pathkeys , \
153+ required_outer ) \
154+ create_nestloop_path((root), (joinrel), (jointype), (workspace), \
155+ (extra)->sjinfo, &(extra)->semifactors, (outer), \
156+ (inner), (filtered_joinclauses), (pathkeys), \
157+ (required_outer))
158+ #endif
159+
160+
140161/*
141162 * create_plain_partial_paths()
142163 */
@@ -170,15 +191,23 @@ extern void create_plain_partial_paths(PlannerInfo *root,
170191 * a single value
171192 */
172193#if PG_VERSION_NUM >= 100000
173- #define ExecEvalExprCompat (expr , econtext , isNull , errmsg ) \
194+ #define ExecEvalExprCompat (expr , econtext , isNull , errHandler ) \
174195 ExecEvalExpr((expr), (econtext), (isNull))
175196#elif PG_VERSION_NUM >= 90500
176- #define ExecEvalExprCompat (expr , econtext , isNull , errmsg ) \
177- do { \
178- ExecEvalExpr((expr), (econtext), (isNull), (isDone)); \
179- if (isDone != ExprSingleResult) \
180- elog(ERROR, (errmsg)); \
181- } while (0)
197+ #include "partition_filter.h"
198+ extern Datum exprResult ;
199+ extern ExprDoneCond isDone ;
200+ static inline void
201+ not_signle_result_handler ()
202+ {
203+ elog (ERROR , ERR_PART_ATTR_MULTIPLE_RESULTS );
204+ }
205+ #define ExecEvalExprCompat (expr , econtext , isNull , errHandler ) \
206+ ( \
207+ exprResult = ExecEvalExpr((expr), (econtext), (isNull), &isDone), \
208+ (isDone != ExprSingleResult) ? (errHandler)() : (0), \
209+ exprResult \
210+ )
182211#endif
183212
184213
@@ -212,6 +241,22 @@ char get_rel_persistence(Oid relid);
212241#endif
213242
214243
244+ /*
245+ * initial_cost_nestloop
246+ */
247+ #if PG_VERSION_NUM >= 100000 || (defined(PGPRO_VERSION ) && PG_VERSION_NUM >= 90603 )
248+ #define initial_cost_nestloop_compat (root , workspace , jointype , outer_path , \
249+ inner_path , extra ) \
250+ initial_cost_nestloop((root), (workspace), (jointype), (outer_path), \
251+ (inner_path), (extra))
252+ #elif PG_VERSION_NUM >= 90500
253+ #define initial_cost_nestloop_compat (root , workspace , jointype , outer_path , \
254+ inner_path , extra ) \
255+ initial_cost_nestloop((root), (workspace), (jointype), (outer_path), \
256+ (inner_path), (extra)->sjinfo, &(extra)->semifactors)
257+ #endif
258+
259+
215260/*
216261 * InitResultRelInfo
217262 *
0 commit comments