diff --git a/pg_wait_sampling.c b/pg_wait_sampling.c index a0cc582..81c37ea 100644 --- a/pg_wait_sampling.c +++ b/pg_wait_sampling.c @@ -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 @@ -369,7 +375,7 @@ _PG_init(void) 1, INT_MAX, PGC_SIGHUP, - GUC_UNIT_MS, + 0, NULL, NULL, NULL); @@ -382,7 +388,7 @@ _PG_init(void) 1, INT_MAX, PGC_SIGHUP, - GUC_UNIT_MS, + 0, NULL, NULL, NULL); @@ -976,7 +982,12 @@ 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; @@ -984,9 +995,17 @@ pgws_ExecutorStart(QueryDesc *queryDesc, int eflags) if (pgws_enabled(nesting_level)) pgws_proc_queryids[i] = queryDesc->plannedstmt->queryId; if (prev_ExecutorStart) +#if PG_VERSION_NUM >= 180000 + return prev_ExecutorStart(queryDesc, eflags); +#else prev_ExecutorStart(queryDesc, eflags); +#endif else +#if PG_VERSION_NUM >= 180000 + return standard_ExecutorStart(queryDesc, eflags); +#else standard_ExecutorStart(queryDesc, eflags); +#endif } static void