Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pg17 support #42

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pg_stat_kcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ typedef uint32 pgsk_queryid;
#define TIMEVAL_DIFF(start, end) ((double) end.tv_sec + (double) end.tv_usec / 1000000.0) \
- ((double) start.tv_sec + (double) start.tv_usec / 1000000.0)

#if PG_VERSION_NUM < 170000
#define MyProcNumber MyBackendId
#define ParallelLeaderProcNumber ParallelLeaderBackendId
#endif

#if PG_VERSION_NUM < 140000
#define ParallelLeaderBackendId ParallelMasterBackendId
#endif
Expand Down Expand Up @@ -431,7 +436,7 @@ pgsk_set_queryid(pgsk_queryid queryid)
/* Only the leader knows the queryid. */
Assert(!IsParallelWorker());

pgsk->queryids[MyBackendId] = queryid;
pgsk->queryids[MyProcNumber] = queryid;
}
#endif

Expand Down Expand Up @@ -1082,7 +1087,7 @@ pgsk_ExecutorEnd (QueryDesc *queryDesc)

#if PG_VERSION_NUM >= 90600
if (IsParallelWorker())
queryId = pgsk->queryids[ParallelLeaderBackendId];
queryId = pgsk->queryids[ParallelLeaderProcNumber];
else
#endif
queryId = queryDesc->plannedstmt->queryId;
Expand Down
Loading