@@ -152,7 +152,8 @@ pathman_join_pathlist_hook(PlannerInfo *root,
152152 Relids required_nestloop ,
153153 required_inner ;
154154 List * filtered_joinclauses = NIL ,
155- * saved_ppi_list ;
155+ * saved_ppi_list ,
156+ * pathkeys ;
156157 ListCell * rinfo_lc ;
157158
158159 if (!IsA (cur_inner_path , AppendPath ))
@@ -217,17 +218,18 @@ pathman_join_pathlist_hook(PlannerInfo *root,
217218 return ;
218219
219220
221+ /* TODO: create macro initial_cost_nestloop_compat() */
222+ #if defined(PGPRO_VERSION ) && PG_VERSION_NUM >= 90603
223+ initial_cost_nestloop (root , & workspace , jointype ,
224+ outer , inner , /* built paths */
225+ extra );
226+ #else
220227 initial_cost_nestloop (root , & workspace , jointype ,
221228 outer , inner , /* built paths */
222229 extra -> sjinfo , & extra -> semifactors );
230+ #endif
223231
224- nest_path = create_nestloop_path (root , joinrel , jointype , & workspace ,
225- extra -> sjinfo , & extra -> semifactors ,
226- outer , inner , extra -> restrictlist ,
227- build_join_pathkeys (root , joinrel ,
228- jointype ,
229- outer -> pathkeys ),
230- required_nestloop );
232+ pathkeys = build_join_pathkeys (root , joinrel , jointype , outer -> pathkeys );
231233
232234 /* Discard all clauses that are to be evaluated by 'inner' */
233235 foreach (rinfo_lc , extra -> restrictlist )
@@ -239,6 +241,24 @@ pathman_join_pathlist_hook(PlannerInfo *root,
239241 filtered_joinclauses = lappend (filtered_joinclauses , rinfo );
240242 }
241243
244+ /* TODO: create macro create_nestloop_path_compat() */
245+ #if defined(PGPRO_VERSION ) && PG_VERSION_NUM >= 90603
246+ nest_path = create_nestloop_path (root , joinrel , jointype , & workspace ,
247+ extra ,
248+ outer , inner ,
249+ filtered_joinclauses ,
250+ pathkeys ,
251+ calc_nestloop_required_outer (outer , inner ));
252+ #else
253+ nest_path = create_nestloop_path (root , joinrel , jointype , & workspace ,
254+ extra -> sjinfo ,
255+ & extra -> semifactors ,
256+ outer , inner ,
257+ filtered_joinclauses ,
258+ pathkeys ,
259+ calc_nestloop_required_outer (outer , inner ));
260+ #endif
261+
242262 /*
243263 * NOTE: Override 'rows' value produced by standard estimator.
244264 * Currently we use get_parameterized_joinrel_size() since
0 commit comments