Skip to content

Commit 8440edd

Browse files
authored
Merge pull request #24 from rjuju/fix_pg13
Fix compatibility with PG13.
2 parents df0e68a + a7fe4a6 commit 8440edd

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

Diff for: collector.c

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
#include "postgres.h"
1111

1212
#include "catalog/pg_type.h"
13+
#if PG_VERSION_NUM >= 130000
14+
#include "common/hashfn.h"
15+
#endif
1316
#include "funcapi.h"
1417
#include "miscadmin.h"
1518
#include "postmaster/bgworker.h"

Diff for: pg_wait_sampling.c

+18-3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ CollectorShmqHeader *collector_hdr = NULL;
5050
static shmem_startup_hook_type prev_shmem_startup_hook = NULL;
5151
static PGPROC * search_proc(int backendPid);
5252
static PlannedStmt *pgws_planner_hook(Query *parse,
53+
#if PG_VERSION_NUM >= 130000
54+
const char *query_string,
55+
#endif
5356
int cursorOptions, ParamListInfo boundParams);
5457
static void pgws_ExecutorEnd(QueryDesc *queryDesc);
5558

@@ -771,7 +774,11 @@ pg_wait_sampling_get_history(PG_FUNCTION_ARGS)
771774
* planner_hook hook, save queryId for collector
772775
*/
773776
static PlannedStmt *
774-
pgws_planner_hook(Query *parse, int cursorOptions,
777+
pgws_planner_hook(Query *parse,
778+
#if PG_VERSION_NUM >= 130000
779+
const char *query_string,
780+
#endif
781+
int cursorOptions,
775782
ParamListInfo boundParams)
776783
{
777784
if (MyProc)
@@ -795,9 +802,17 @@ pgws_planner_hook(Query *parse, int cursorOptions,
795802

796803
/* Invoke original hook if needed */
797804
if (planner_hook_next)
798-
return planner_hook_next(parse, cursorOptions, boundParams);
805+
return planner_hook_next(parse,
806+
#if PG_VERSION_NUM >= 130000
807+
query_string,
808+
#endif
809+
cursorOptions, boundParams);
799810

800-
return standard_planner(parse, cursorOptions, boundParams);
811+
return standard_planner(parse,
812+
#if PG_VERSION_NUM >= 130000
813+
query_string,
814+
#endif
815+
cursorOptions, boundParams);
801816
}
802817

803818
/*

0 commit comments

Comments
 (0)