Skip to content

Commit a7fe4a6

Browse files
committed
Fix compatibility with PG13.
planner_hook now requires the input query_string, and tag_hash isn't automatically available anymore with the existing includes.
1 parent 4c7549e commit a7fe4a6

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

collector.c

Lines changed: 3 additions & 0 deletions
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"

pg_wait_sampling.c

Lines changed: 18 additions & 3 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy