On Wed, Feb 3, 2021, at 3:12 AM, Bharath Rupireddy wrote:
> Can we have a new function, say pg_postgres_pid(), to return
> postmaster PID similar to pg_backend_pid()?
It is not that difficult to read the postmaster PID using existing functions.
postgres=# SELECT (regexp_match(pg_read_file('postmaster.pid'), '\d+'))[1];
regexp_match
--------------
13496
(1 row)
While investigating an issue, you are probably interested in a backend PID or
one of the auxiliary processes. In both cases, it is easier to obtain the PIDs.
--
Euler Taveira
EDB https://www.enterprisedb.com/