Skip to content

Commit fb3eb36

Browse files
author
Marina Polyakova
committed
Fix build due to changes in PostgreSQL 16
See the commit 3057465acfbea2f3dd7a914a1478064022c6eecd (Replace the sorted array of GUC variables with a hash table.) in PostgreSQL 16.
1 parent 1ff4426 commit fb3eb36

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

compat.h

+15
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "access/tupdesc.h"
1616
#include "miscadmin.h"
1717
#include "storage/shm_mq.h"
18+
#include "utils/guc_tables.h"
1819

1920
static inline TupleDesc
2021
CreateTemplateTupleDescCompat(int nattrs, bool hasoid)
@@ -65,4 +66,18 @@ InitPostgresCompat(const char *in_dbname, Oid dboid,
6566
#endif
6667
}
6768

69+
static inline void
70+
get_guc_variables_compat(struct config_generic ***vars, int *num_vars)
71+
{
72+
Assert(vars != NULL);
73+
Assert(num_vars != NULL);
74+
75+
#if PG_VERSION_NUM >= 160000
76+
*vars = get_guc_variables(num_vars);
77+
#else
78+
*vars = get_guc_variables();
79+
*num_vars = GetNumConfigOptions();
80+
#endif
81+
}
82+
6883
#endif

pg_wait_sampling.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ setup_gucs()
198198
profile_pid_found = false,
199199
profile_queries_found = false;
200200

201-
guc_vars = get_guc_variables();
202-
numOpts = GetNumConfigOptions();
201+
get_guc_variables_compat(&guc_vars, &numOpts);
203202

204203
for (i = 0; i < numOpts; i++)
205204
{

0 commit comments

Comments
 (0)