Re: WIP: new system catalog pg_wait_event

From: Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>
To: "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: WIP: new system catalog pg_wait_event
Date: 2023-10-23 10:17:42
Message-ID: 4f79be75-7e30-4817-b0da-4a691ea5427f@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Please, consider this small fix for the query example in the docs[1]:

SELECT a.pid, a.wait_event, w.description
FROM pg_stat_activity a JOIN
pg_wait_events w ON (a.wait_event_type = w.type AND
a.wait_event = w.name)
WHERE wait_event is NOT NULL and a.state = 'active';

I propose to add a table alias for the wait_event column in the WHERE clause for consistency.

1.https://www.postgresql.org/docs/devel/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW

--
Pavel Luzanov
Postgres Professional:https://postgrespro.com

Attachment Content-Type Size
0001-Fix-pg_wait_events-usage-example.patch text/x-patch 1015 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2023-10-23 11:00:00 Re: Removing unneeded self joins
Previous Message Junwang Zhao 2023-10-23 09:55:32 Re: Add trailing commas to enum definitions