Skip to content
Closed
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
12 changes: 12 additions & 0 deletions pg_wait_sampling.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,11 @@ pg_wait_sampling_get_current(PG_FUNCTION_ARGS)
params->ts = GetCurrentTimestamp();

funcctx->user_fctx = params;
#if PG_VERSION_NUM >= 120000
tupdesc = CreateTemplateTupleDesc(4);
#else
tupdesc = CreateTemplateTupleDesc(4, false);
#endif
TupleDescInitEntry(tupdesc, (AttrNumber) 1, "pid",
INT4OID, -1, 0);
TupleDescInitEntry(tupdesc, (AttrNumber) 2, "type",
Expand Down Expand Up @@ -585,7 +589,11 @@ pg_wait_sampling_get_profile(PG_FUNCTION_ARGS)
funcctx->max_calls = profile->count;

/* Make tuple descriptor */
#if PG_VERSION_NUM >= 120000
tupdesc = CreateTemplateTupleDesc(5);
#else
tupdesc = CreateTemplateTupleDesc(5, false);
#endif
TupleDescInitEntry(tupdesc, (AttrNumber) 1, "pid",
INT4OID, -1, 0);
TupleDescInitEntry(tupdesc, (AttrNumber) 2, "type",
Expand Down Expand Up @@ -703,7 +711,11 @@ pg_wait_sampling_get_history(PG_FUNCTION_ARGS)
funcctx->max_calls = history->count;

/* Make tuple descriptor */
#if PG_VERSION_NUM >= 120000
tupdesc = CreateTemplateTupleDesc(5);
#else
tupdesc = CreateTemplateTupleDesc(5, false);
#endif
TupleDescInitEntry(tupdesc, (AttrNumber) 1, "pid",
INT4OID, -1, 0);
TupleDescInitEntry(tupdesc, (AttrNumber) 2, "sample_ts",
Expand Down