pg_stat_get_backend_wait_event_type()

A function a backend's wait event type

pg_stat_get_backend_wait_event_type() is a system function returning the current wait event type for the specified backend.

pg_stat_get_backend_wait_event_type() was added in PostgreSQL 9.6.

Usage

pg_stat_get_backend_wait_event_type ( integer ) → text

The backend is specified by a backend ID number reported by pg_stat_get_backend_idset(); see below for an execution example.

NULL is returned if there is no wait event type.

The value returned by pg_stat_get_backend_wait_event_type() corresponds to the column wait_event_type in pg_stat_activity.

The following related functions are also available:

Change history

Examples

Basic usage example for pg_stat_get_backend_wait_event_type():

postgres=# SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
                  pg_stat_get_backend_wait_event_type(s.backendid) AS wait_event_type
             FROM (SELECT pg_stat_get_backend_idset() AS backendid) AS s;
   pid   | wait_event_type 
---------+-----------------
 1451980 | Activity
 1451982 | Activity
 2382558 | 
 1764534 | Client
 1451978 | 
 1451977 | 
 1451979 | 
(7 rows)

Categories

System catalogue

See also

pg_stat_activity