@@ -147,7 +147,8 @@ pathman_join_pathlist_hook(PlannerInfo *root,
147147if (saved_jointype == JOIN_UNIQUE_INNER )
148148return ;/* No way to do this with a parameterized inner path */
149149
150- #if definedPGPRO_VERSION && PG_VERSION_NUM >=90603
150+ /* TODO: create macro initial_cost_nestloop_compat() */
151+ #if defined(PGPRO_VERSION )&& PG_VERSION_NUM >=90603
151152initial_cost_nestloop (root ,& workspace ,jointype ,
152153outer ,inner ,/* built paths */
153154extra );
@@ -159,20 +160,6 @@ pathman_join_pathlist_hook(PlannerInfo *root,
159160
160161pathkeys = build_join_pathkeys (root ,joinrel ,jointype ,outer -> pathkeys );
161162
162- #if definedPGPRO_VERSION && PG_VERSION_NUM >=90603
163- nest_path = create_nestloop_path (root ,joinrel ,jointype ,& workspace ,
164- extra ,outer ,inner ,
165- extra -> restrictlist ,
166- pathkeys ,
167- calc_nestloop_required_outer (outer ,inner ));
168- #else
169- nest_path = create_nestloop_path (root ,joinrel ,jointype ,& workspace ,
170- extra -> sjinfo ,& extra -> semifactors ,
171- outer ,inner ,extra -> restrictlist ,
172- pathkeys ,
173- calc_nestloop_required_outer (outer ,inner ));
174- #endif
175-
176163/* Discard all clauses that are to be evaluated by 'inner' */
177164foreach (rinfo_lc ,extra -> restrictlist )
178165{
@@ -183,6 +170,24 @@ pathman_join_pathlist_hook(PlannerInfo *root,
183170filtered_joinclauses = lappend (filtered_joinclauses ,rinfo );
184171}
185172
173+ /* TODO: create macro create_nestloop_path_compat() */
174+ #if defined(PGPRO_VERSION )&& PG_VERSION_NUM >=90603
175+ nest_path = create_nestloop_path (root ,joinrel ,jointype ,& workspace ,
176+ extra ,
177+ outer ,inner ,
178+ filtered_joinclauses ,
179+ pathkeys ,
180+ calc_nestloop_required_outer (outer ,inner ));
181+ #else
182+ nest_path = create_nestloop_path (root ,joinrel ,jointype ,& workspace ,
183+ extra -> sjinfo ,
184+ & extra -> semifactors ,
185+ outer ,inner ,
186+ filtered_joinclauses ,
187+ pathkeys ,
188+ calc_nestloop_required_outer (outer ,inner ));
189+ #endif
190+
186191/*
187192 * Override 'rows' value produced by standard estimator.
188193 * Currently we use get_parameterized_joinrel_size() since