Skip to content

Commit dd524f2

Browse files
authored
Fix compatibility with pg18
Upstream commit postgres/postgres@525392d changed return type of ExecutorStart_hook API from void to bool.
1 parent e3b1e15 commit dd524f2

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Diff for: pg_wait_sampling.c

+15-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,13 @@ static PlannedStmt *pgws_planner_hook(Query *parse,
7373
const char *query_string,
7474
#endif
7575
int cursorOptions, ParamListInfo boundParams);
76-
static void pgws_ExecutorStart(QueryDesc *queryDesc, int eflags);
76+
static
77+
#if PG_VERSION_NUM >= 180000
78+
bool
79+
#else
80+
void
81+
#endif
82+
pgws_ExecutorStart(QueryDesc *queryDesc, int eflags);
7783
static void pgws_ExecutorRun(QueryDesc *queryDesc,
7884
ScanDirection direction,
7985
uint64 count
@@ -965,16 +971,21 @@ pgws_planner_hook(Query *parse,
965971
/*
966972
* ExecutorStart hook: save queryId for collector
967973
*/
968-
static void
974+
static
975+
#if PG_VERSION_NUM >= 180000
976+
bool
977+
#else
978+
void
979+
#endif
969980
pgws_ExecutorStart(QueryDesc *queryDesc, int eflags)
970981
{
971982
int i = MyProc - ProcGlobal->allProcs;
972983
if (pgws_enabled(nesting_level))
973984
pgws_proc_queryids[i] = queryDesc->plannedstmt->queryId;
974985
if (prev_ExecutorStart)
975-
prev_ExecutorStart(queryDesc, eflags);
986+
return prev_ExecutorStart(queryDesc, eflags);
976987
else
977-
standard_ExecutorStart(queryDesc, eflags);
988+
return standard_ExecutorStart(queryDesc, eflags);
978989
}
979990

980991
static void

0 commit comments

Comments
 (0)