From 0423de4d30850327e3c6860377b82a77cf45a1d2 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 7 May 2008 14:41:56 +0000 Subject: Make the pg_stat_activity view call a SRF (pg_stat_get_activity()) instead of calling a bunch of individual functions. This function can also be called directly, taking a PID as an argument, to return only the data for a single PID. --- doc/src/sgml/monitoring.sgml | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index f634d818420..069bad8dc13 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -1,4 +1,4 @@ - + Monitoring Database Activity @@ -655,20 +655,31 @@ postgres: user database host - pg_stat_get_backend_idset() - setof integer + + pg_backend_pid() + integer - Set of currently active server process numbers (from 1 to the - number of active server processes). See usage example in the text + Process ID of the server process attached to the current session - - pg_backend_pid() - integer + pg_stat_get_activity(integer) + setof record - Process ID of the server process attached to the current session + Returns a record of information about the backend with the specified pid, or + one record for each active backend in the system if NULL is + specified. The fields returned are the same as in the + pg_stat_activity view + + + + + pg_stat_get_backend_idset() + setof integer + + Set of currently active server process numbers (from 1 to the + number of active server processes). See usage example in the text @@ -869,6 +880,8 @@ postgres: user database host + All functions to access information about backends are indexed by backend id + number, except pg_stat_get_activity which is indexed by PID. The function pg_stat_get_backend_idset provides a convenient way to generate one row for each active server process. For example, to show the PIDs and current queries of all server processes: -- cgit v1.2.3