From: | Dave Page <dpage(at)vale-housing(dot)co(dot)uk> |
---|---|
To: | Andreas Pflug <pgadmin(at)pse-consulting(dot)de>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org> |
Subject: | Server status query problem |
Date: | 2005-11-20 23:20:59 |
Message-ID: | BFA6B55B.5F3D%dpage@vale-housing.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-hackers |
Hi Andreas,
It was pointed out to me that the server status lock tab doesn't show data
correctly - specifically, the username is always blank, and the query string
normally shows up as <backend information unavailable>.
It seems the cause is that most of the stats functions don't take a PID as
an argument, but a backend ID between 1 and the current number of backends.
A hacked together replacement query looks like the following, but before I
appy it I just wanted to run it past you and the list in case I missed
anything:
SELECT
(SELECT datname FROM pg_database WHERE oid = pgl.database) AS dbname,
pgl.relation::regclass AS class,
pg_get_userbyid(pg_stat_get_backend_userid(svrid)) as user,
pgl.transaction,
pg_stat_get_backend_pid(svrid) AS pid,
pgl.mode,
pgl.granted,
pg_stat_get_backend_activity(svrid) AS current_query
FROM
pg_stat_get_backend_idset() svrid,
pg_locks pgl
WHERE
pgl.pid = pg_stat_get_backend_pid(svrid)
ORDER BY
pid;
Regards, Dave
From | Date | Subject | |
---|---|---|---|
Next Message | Guillaume LELARGE | 2005-11-21 17:37:13 | french po updates and ui patch |
Previous Message | svn | 2005-11-20 22:58:16 | SVN Commit by dpage: r4751 - branches/REL-1_4_0_PATCHES/pgadmin3 |