diff --git a/src/backend/distributed/test/fake_fdw.c b/src/backend/distributed/test/fake_fdw.c index 585e61d4108..90b205b1ea1 100644 --- a/src/backend/distributed/test/fake_fdw.c +++ b/src/backend/distributed/test/fake_fdw.c @@ -29,7 +29,7 @@ #include "optimizer/restrictinfo.h" #include "utils/palloc.h" -#include "pg_version_constants.h" +#include "pg_version_compat.h" /* local function forward declarations */ static void FakeGetForeignRelSize(PlannerInfo *root, RelOptInfo *baserel, @@ -91,9 +91,11 @@ FakeGetForeignPaths(PlannerInfo *root, RelOptInfo *baserel, Oid foreigntableid) Cost startup_cost = 0; Cost total_cost = startup_cost + baserel->rows; - add_path(baserel, (Path *) create_foreignscan_path(root, baserel, NULL, baserel->rows, - startup_cost, total_cost, NIL, - NULL, NULL, NIL)); + add_path(baserel, (Path *) create_foreignscan_path_compat(root, baserel, NULL, + baserel->rows, + startup_cost, total_cost, + NIL, + NULL, NULL, NIL, NIL)); } diff --git a/src/include/pg_version_compat.h b/src/include/pg_version_compat.h index 4a835176c4b..e177e43815b 100644 --- a/src/include/pg_version_compat.h +++ b/src/include/pg_version_compat.h @@ -104,6 +104,10 @@ getStxstattarget_compat(HeapTuple tup) #define matched_compat(a) (a->matchKind == MERGE_WHEN_MATCHED) +#define create_foreignscan_path_compat(a, b, c, d, e, f, g, h, i, j, \ + k) create_foreignscan_path(a, b, c, d, e, f, g, h, \ + i, j, k) + #else #include "access/htup_details.h" @@ -131,6 +135,10 @@ getStxstattarget_compat(HeapTuple tup) #define matched_compat(a) (a->matched) +#define create_foreignscan_path_compat(a, b, c, d, e, f, g, h, i, j, \ + k) create_foreignscan_path(a, b, c, d, e, f, g, h, \ + i, k) + #endif #if PG_VERSION_NUM >= PG_VERSION_16