Skip to content

Commit d33586c

Browse files
authored
Update PortalDefineQuery call for postgres 18 compatibility (#387)
525392d from postgres upstream adds a new argument in PortalDefineQuery, CachedPlanSource. The CachedPlan in this call is NULL so naturally CachedPlanSource is passed NULL here.
1 parent 237c525 commit d33586c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/pg_cron.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2265,7 +2265,11 @@ ExecuteSqlString(const char *sql)
22652265
portal = CreatePortal("", true, true);
22662266
/* Don't display the portal in pg_cursors */
22672267
portal->visible = false;
2268-
PortalDefineQuery(portal, NULL, sql, commandTag, plantree_list, NULL);
2268+
#if PG_VERSION_NUM < 180000
2269+
PortalDefineQuery(portal, NULL, sql, commandTag, plantree_list, NULL);
2270+
#else
2271+
PortalDefineQuery(portal, NULL, sql, commandTag, plantree_list, NULL, NULL);
2272+
#endif
22692273
PortalStart(portal, NULL, 0, InvalidSnapshot);
22702274
PortalSetResultFormat(portal, 1, &format); /* binary format */
22712275

0 commit comments

Comments
 (0)