Enhance compatibility for create_foreignscan_path with PG18 and PG17 versions

pull/8041/merge
Mehmet Yilmaz 2025-07-09 13:03:02 +00:00
parent 44821f1264
commit 08ed6433a2
1 changed files with 25 additions and 30 deletions

View File

@ -13,6 +13,31 @@
#include "pg_version_constants.h" #include "pg_version_constants.h"
#if PG_VERSION_NUM >= PG_VERSION_18
#define create_foreignscan_path_compat(a, b, c, d, e, f, g, h, i, j, k) \
create_foreignscan_path( \
(a), /* root */ \
(b), /* rel */ \
(c), /* target */ \
(d), /* rows */ \
0, /* disabled_nodes */ \
(e), /* startup_cost */ \
(f), /* total_cost */ \
(g), /* pathkeys */ \
(h), /* required_outer */ \
(i), /* fdw_outerpath */ \
(j), /* fdw_restrictinfo*/ \
(k) /* fdw_private */ \
)
#elif PG_VERSION_NUM >= PG_VERSION_17
#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) \
)
#endif
#if PG_VERSION_NUM >= PG_VERSION_17 #if PG_VERSION_NUM >= PG_VERSION_17
#include "catalog/pg_am.h" #include "catalog/pg_am.h"
@ -384,36 +409,6 @@ getStxstattarget_compat(HeapTuple tup)
#define matched_compat(a) (a->matchKind == MERGE_WHEN_MATCHED) #define matched_compat(a) (a->matchKind == MERGE_WHEN_MATCHED)
#include "nodes/bitmapset.h" /* for Relids */
#include "nodes/pg_list.h" /* for List */
#include "optimizer/pathnode.h" /* for create_foreignscan_path() */
#if PG_VERSION_NUM >= PG_VERSION_18
#define create_foreignscan_path_compat(a, b, c, d, e, f, g, h, i, j, k) \
create_foreignscan_path( \
(a), /* root */ \
(b), /* rel */ \
(c), /* target */ \
(d), /* rows */ \
0, /* disabled_nodes */ \
(e), /* startup_cost */ \
(f), /* total_cost */ \
(g), /* pathkeys */ \
(h), /* required_outer */ \
(i), /* fdw_outerpath */ \
(j), /* fdw_restrictinfo*/ \
(k) /* fdw_private */ \
)
#else
#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) \
)
#endif
#define getProcNo_compat(a) (a->vxid.procNumber) #define getProcNo_compat(a) (a->vxid.procNumber)
#define getLxid_compat(a) (a->vxid.lxid) #define getLxid_compat(a) (a->vxid.lxid)