diff options
author | Magnus Hagander <magnus@hagander.net> | 2008-05-07 14:41:56 +0000 |
---|---|---|
committer | Magnus Hagander <magnus@hagander.net> | 2008-05-07 14:41:56 +0000 |
commit | 0423de4d30850327e3c6860377b82a77cf45a1d2 (patch) | |
tree | 8af7a17d7416f5505cc937cd80e11096abf90a50 /doc/src | |
parent | 8008988be30f69f2c4534a8a8bad47d08cff7a21 (diff) | |
download | postgresql-0423de4d30850327e3c6860377b82a77cf45a1d2.tar.gz postgresql-0423de4d30850327e3c6860377b82a77cf45a1d2.zip |
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.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/monitoring.sgml | 31 |
1 files changed, 22 insertions, 9 deletions
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 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/monitoring.sgml,v 1.57 2008/04/10 13:34:33 alvherre Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/monitoring.sgml,v 1.58 2008/05/07 14:41:55 mha Exp $ --> <chapter id="monitoring"> <title>Monitoring Database Activity</title> @@ -655,20 +655,31 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re </row> <row> - <entry><literal><function>pg_stat_get_backend_idset</function>()</literal></entry> - <entry><type>setof integer</type></entry> + <!-- See also the entry for this in func.sgml --> + <entry><literal><function>pg_backend_pid</function>()</literal></entry> + <entry><type>integer</type></entry> <entry> - 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 </entry> </row> <row> - <!-- See also the entry for this in func.sgml --> - <entry><literal><function>pg_backend_pid</function>()</literal></entry> - <entry><type>integer</type></entry> + <entry><literal><function>pg_stat_get_activity</function>(<type>integer</type>)</literal></entry> + <entry><type>setof record</type></entry> <entry> - 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 <symbol>NULL</symbol> is + specified. The fields returned are the same as in the + <structname>pg_stat_activity</structname> view + </entry> + </row> + + <row> + <entry><literal><function>pg_stat_get_backend_idset</function>()</literal></entry> + <entry><type>setof integer</type></entry> + <entry> + Set of currently active server process numbers (from 1 to the + number of active server processes). See usage example in the text </entry> </row> @@ -869,6 +880,8 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re </note> <para> + All functions to access information about backends are indexed by backend id + number, except <function>pg_stat_get_activity</function> which is indexed by PID. The function <function>pg_stat_get_backend_idset</function> provides a convenient way to generate one row for each active server process. For example, to show the <acronym>PID</>s and current queries of all server processes: |