Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 544a4ee

Browse filesBrowse files
Merge pull request #64 from postgrespro/PGPRO-7444
Fix build due to changes in PostgreSQL 16
2 parents 1ff4426 + 9526428 commit 544a4ee
Copy full SHA for 544a4ee

File tree

Expand file treeCollapse file tree

3 files changed

+18
-5
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+18
-5
lines changed

‎collector.c

Copy file name to clipboardExpand all lines: collector.c
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ pgws_collector_main(Datum main_arg)
470470
send_profile(profile_hash, mqh);
471471
break;
472472
default:
473-
AssertState(false);
473+
Assert(false);
474474
}
475475
break;
476476
case SHM_MQ_DETACHED:
@@ -480,7 +480,7 @@ pgws_collector_main(Datum main_arg)
480480
"detached")));
481481
break;
482482
default:
483-
AssertState(false);
483+
Assert(false);
484484
}
485485
shm_mq_detach_compat(mqh, pgws_collector_mq);
486486
}

‎compat.h

Copy file name to clipboardExpand all lines: compat.h
+15Lines changed: 15 additions & 0 deletions
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

Copy file name to clipboardExpand all lines: pg_wait_sampling.c
+1-3Lines changed: 1 addition & 3 deletions
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
{
@@ -452,7 +451,6 @@ pg_wait_sampling_get_current(PG_FUNCTION_ARGS)
452451
{
453452
MemoryContext oldcontext;
454453
TupleDesc tupdesc;
455-
WaitCurrentContext *params;
456454

457455
funcctx = SRF_FIRSTCALL_INIT();
458456

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.