Skip to content

Fix compatibility with pg18 #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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