1/*------------------------------------------------------------------------
4 * Functions for accessing wait event data.
6 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
11 * src/backend/utils/activity/wait_event_funcs.c
13 *------------------------------------------------------------------------
22 * Each wait event has one corresponding entry in this structure, fed to
23 * the SQL function of this file.
34#include "wait_event_funcs_data.c"
43 * List information about wait events (type, name and description).
48#define PG_GET_WAIT_EVENTS_COLS 3
50 char **waiteventnames;
53 /* Build tuplestore to hold the result rows */
56 /* Iterate over the list of wait events */
69 /* Handle custom wait events for extensions */
73 for (
int idx = 0;
idx < nbwaitevents;
idx++)
85 "Waiting for custom wait event \"%s\" defined by extension module",
93 /* Likewise for injection points */
97 for (
int idx = 0;
idx < nbwaitevents;
idx++)
109 "Waiting for injection point \"%s\"",
110 waiteventnames[
idx]);
Datum idx(PG_FUNCTION_ARGS)
static Datum values[MAXATTR]
#define CStringGetTextDatum(s)
void InitMaterializedSRF(FunctionCallInfo fcinfo, bits32 flags)
void appendStringInfo(StringInfo str, const char *fmt,...)
void initStringInfo(StringInfo str)
Tuplestorestate * setResult
void tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc, const Datum *values, const bool *isnull)
#define PG_WAIT_INJECTIONPOINT
#define PG_WAIT_EXTENSION
char ** GetWaitEventCustomNames(uint32 classId, int *nwaitevents)
#define PG_GET_WAIT_EVENTS_COLS
static const struct @23 waitEventData[]
Datum pg_get_wait_events(PG_FUNCTION_ARGS)