Skip to content

Commit e277160

Browse files
committed
Adjust postgres imports to PG19 changes
1 parent 774cee2 commit e277160

2 files changed

Lines changed: 19 additions & 5 deletions

File tree

src/import/allpaths.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ set_tablesample_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *
8585
!(GetTsmRoutine(rte->tablesample->tsmhandler)->repeatable_across_scans))
8686
{
8787
#if PG19_GE
88-
path = (Path *) create_material_path(rel, path, enable_material);
88+
path = (Path *) create_material_path(rel, path, true);
8989
#else
9090
path = (Path *) create_material_path(rel, path);
9191
#endif

src/import/plancat.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,24 @@ ts_build_indexlist(PlannerInfo *root, RelOptInfo *rel)
279279

280280
info->indexprs = RelationGetIndexExpressions(indexRelation);
281281
info->indpred = RelationGetIndexPredicate(indexRelation);
282-
if (info->indexprs && varno != 1)
283-
ChangeVarNodes((Node *) info->indexprs, 1, varno, 0);
284-
if (info->indpred && varno != 1)
285-
ChangeVarNodes((Node *) info->indpred, 1, varno, 0);
282+
if (info->indexprs)
283+
{
284+
if (varno != 1)
285+
ChangeVarNodes((Node *) info->indexprs, 1, varno, 0);
286+
#if PG19_GE
287+
info->indexprs = (List *) eval_const_expressions(root, (Node *) info->indexprs);
288+
#endif
289+
}
290+
if (info->indpred)
291+
{
292+
if (varno != 1)
293+
ChangeVarNodes((Node *) info->indpred, 1, varno, 0);
294+
#if PG19_GE
295+
info->indpred =
296+
(List *) eval_const_expressions(root, (Node *) make_ands_explicit(info->indpred));
297+
info->indpred = make_ands_implicit((Expr *) info->indpred);
298+
#endif
299+
}
286300

287301
info->indextlist = build_index_tlist(root, info, relation);
288302

0 commit comments

Comments
 (0)