pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Pavel Luzanov <p.luzanov@postgrespro.ru>
To: Drouvot, Bertrand <bertranddrouvot.pg@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Masahiro Ikeda <ikedamsh@oss.nttdata.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: tgl@sss.pgh.pa.us
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: WIP: new system catalog pg_wait_event
Date: Mon, 23 Oct 2023 13:17:42 +0300
Message-ID: <4f79be75-7e30-4817-b0da-4a691ea5427f@postgrespro.ru> (raw )
In-Reply-To: <1e0e03a5-1aee-44d9-b409-081afc142603@gmail.com >
References: <ZNxrMdmgrlovw1qD@paquier.xyz >
<f2204399-cfdb-40e7-9479-9373ec6ba0ab@gmail.com >
<735fbd560ae914c96faaa23cc8d9a118@oss.nttdata.com >
<d28ad85d-1deb-4648-92a0-f38273fc91ca@gmail.com >
<393fe340ab6980f399402a7dfbe13c4c@oss.nttdata.com >
<0159e907-890d-4f11-8754-0311d7027bb7@gmail.com >
<ZN9IZ2b7AdDZKSn/@paquier.xyz >
<4fb03626-79aa-4c10-a002-2e5b71e65d22@gmail.com >
<ZOCSpcueqMduuJJ5@paquier.xyz >
<6f507a90-55db-4804-b360-eea4170d15fb@gmail.com >
<ZOHJvk3x980Cc3ss@paquier.xyz >
<1e0e03a5-1aee-44d9-b409-081afc142603@gmail.com >
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
Attachments:
0001-Fix-pg_wait_events-usage-example.patch (text/x-patch, 1015B) download
From 64e9aa8ddde392b97bff66d53a5d09e0a820380c Mon Sep 17 00:00:00 2001
From: Pavel Luzanov <p.luzanov@postgrespro.ru>
Date: Mon, 23 Oct 2023 13:00:16 +0300
Subject: [PATCH] Fix pg_wait_events usage example
This makes the use of column aliases consistent throughout the query.
---
doc/src/sgml/monitoring.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 1149093a8a..3f49ff79f3 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -1119,7 +1119,7 @@ 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';
+ WHERE a.wait_event is NOT NULL and a.state = 'active';
-[ RECORD 1 ]------------------------------------------------------&zwsp;------------
pid | 686674
wait_event | WALInitSync
--
2.34.1
view thread (34+ messages) latest in thread
Message-ID: <4f79be75-7e30-4817-b0da-4a691ea5427f@postgrespro.ru>
Permalink: ../4f79be75-7e30-4817-b0da-4a691ea5427f@postgrespro.ru/
Also on: postgresql.org/message-id/4f79be75-7e30-4817-b0da-4a691ea5427f@postgrespro.ru
copy link · copy postgr.es · copy git am
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: p.luzanov@postgrespro.ru, bertranddrouvot.pg@gmail.com, michael@paquier.xyz, ikedamsh@oss.nttdata.com, horikyota.ntt@gmail.com, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
Subject: Re: WIP: new system catalog pg_wait_event
In-Reply-To: <4f79be75-7e30-4817-b0da-4a691ea5427f@postgrespro.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox