May 2019
Intermediate to advanced
600 pages
20h 46m
English
Perform the following steps:
SELECT datname, usename, wait_event_type, wait_event, pg_blocking_pids(pid) AS blocked_by, backend_type, queryFROM pg_stat_activityWHERE wait_event_type IS NOT NULLAND wait_event_type NOT IN ('Activity', 'Client');
-[ RECORD 1 ]---+-----------------datname | postgresusename | gianniwait_event_type | Lockwait_event | relationblocked_by | {18142}backend_type | client backendquery | select * from t;
This is, in fact, the query we described in the previous recipe, with the addition of the blocked_by column. Recall that the PID is the unique identifier assigned by the operating system to each session; for more details, see Chapter 4 ...
Read now
Unlock full access