There's more...

Mind the version! PostgreSQL versions below 9.2 do not have the state or query fields and supply only the current_query column. While it might be tempting to use query and current_query interchangeably, older PostgreSQL versions are strictly at a disadvantage.

Similarly, the way waits are displayed changed drastically in PostgreSQL 9.6. In older versions, the waiting column merely noted whether or not the query was blocked by some other process. The wait_event replacement makes it possible to actually see what is blocking a particular query. Previously obscured actions such as lock acquisitions, disk synchronization, or even background worker interaction, are now plainly visible. This amount of detail is far more useful for ...

Get PostgreSQL High Availability Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.