pg_stat_get_backend_pid()

A function reporting a backend's PID

pg_stat_get_backend_pid() is a system function reporting the specified backend's PID.

pg_stat_get_backend_pid() was added in PostgreSQL 7.2.

Usage

pg_stat_get_backend_pid ( integer ) → integer

The backend is specified by a backend ID number reported by pg_stat_get_backend_idset(); see below for an execution example.

The value returned by pg_stat_get_backend_pid() corresponds to the column pid in pg_stat_activity.

pg_backend_pid() can be used to retrieve the current backend's PID.

The following related functions are also available:

Change history

Examples

Usage example for pg_stat_get_backend_pid():

postgres=# SELECT pg_stat_get_backend_pid(s.backendid) AS pid
             FROM (SELECT pg_stat_get_backend_idset() AS backendid) AS s;
   pid   
---------
 1451980
 1451982
 1455628
 1764534
 1468447
 1468445
 1468005
 1468202
 1451978
 1451977
 1451979
(11 rows)

Categories

System function

See also

pg_stat_activity, pg_backend_pid()