Skip to content

Commit ea9b574

Browse files
authored
Fix compatibility with pg18 (#70)
Upstream commit postgres/postgres@525392d changed return type of ExecutorStart_hook API from void to bool.
1 parent 0a1922c commit ea9b574

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

pg_qualstats.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,14 @@ PG_MODULE_MAGIC;
109109
#define ParallelLeaderBackendId ParallelMasterBackendId
110110
#endif
111111

112+
/* ExecutorStart hook */
113+
#if PG_VERSION_NUM >= 180000
114+
#define EXEC_START_RET bool
115+
#else
116+
#define EXEC_START_RET void
117+
#endif
118+
/* end of ExecutorStart hook */
119+
112120
/*
113121
* Extension version number, for supporting older extension versions' objects
114122
*/
@@ -145,7 +153,7 @@ static void pgqs_backend_mode_startup(void);
145153
static void pgqs_shmem_request(void);
146154
#endif
147155
static void pgqs_shmem_startup(void);
148-
static void pgqs_ExecutorStart(QueryDesc *queryDesc, int eflags);
156+
static EXEC_START_RET pgqs_ExecutorStart(QueryDesc *queryDesc, int eflags);
149157
static void pgqs_ExecutorRun(QueryDesc *queryDesc,
150158
ScanDirection direction,
151159
#if PG_VERSION_NUM >= 90600
@@ -604,7 +612,7 @@ pgqs_fillnames(pgqsEntryWithNames *entry)
604612
/*
605613
* Request rows and buffers instrumentation if pgqs is enabled
606614
*/
607-
static void
615+
static EXEC_START_RET
608616
pgqs_ExecutorStart(QueryDesc *queryDesc, int eflags)
609617
{
610618
/* Setup instrumentation */
@@ -636,9 +644,9 @@ pgqs_ExecutorStart(QueryDesc *queryDesc, int eflags)
636644
queryDesc->instrument_options |= PGQS_FLAGS;
637645
}
638646
if (prev_ExecutorStart)
639-
prev_ExecutorStart(queryDesc, eflags);
647+
return prev_ExecutorStart(queryDesc, eflags);
640648
else
641-
standard_ExecutorStart(queryDesc, eflags);
649+
return standard_ExecutorStart(queryDesc, eflags);
642650

643651
}
644652

0 commit comments

Comments
 (0)