Skip to content

Commit

Permalink
Merge pull request #91 from RekGRpth/patch-2
Browse files Browse the repository at this point in the history
Fix compatibility with pg18

Upstream commit postgres/postgres@525392d changed return type of ExecutorStart_hook API from void to bool.
  • Loading branch information
Medvecrab authored Feb 24, 2025
2 parents fbf8346 + 637679b commit 56546f0
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions pg_wait_sampling.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@ static PlannedStmt *pgws_planner_hook(Query *parse,
const char *query_string,
#endif
int cursorOptions, ParamListInfo boundParams);
static void pgws_ExecutorStart(QueryDesc *queryDesc, int eflags);
static
#if PG_VERSION_NUM >= 180000
bool
#else
void
#endif
pgws_ExecutorStart(QueryDesc *queryDesc, int eflags);
static void pgws_ExecutorRun(QueryDesc *queryDesc,
ScanDirection direction,
uint64 count
Expand Down Expand Up @@ -976,17 +982,22 @@ pgws_planner_hook(Query *parse,
/*
* ExecutorStart hook: save queryId for collector
*/
static void
static
#if PG_VERSION_NUM >= 180000
bool
#else
void
#endif
pgws_ExecutorStart(QueryDesc *queryDesc, int eflags)
{
int i = MyProc - ProcGlobal->allProcs;

if (pgws_enabled(nesting_level))
pgws_proc_queryids[i] = queryDesc->plannedstmt->queryId;
if (prev_ExecutorStart)
prev_ExecutorStart(queryDesc, eflags);
return prev_ExecutorStart(queryDesc, eflags);
else
standard_ExecutorStart(queryDesc, eflags);
return standard_ExecutorStart(queryDesc, eflags);
}

static void
Expand Down

0 comments on commit 56546f0

Please sign in to comment.