Re: Can we have a new SQL callable function to get Postmaster PID? - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: Can we have a new SQL callable function to get Postmaster PID?
Date
Msg-id CALj2ACW1zbGVakfseapvWxH5AcRbRHvg7ETJEgCmQGEDxSWcYQ@mail.gmail.com
Whole thread Raw
In response to Re: Can we have a new SQL callable function to get Postmaster PID?  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Responses Re: Can we have a new SQL callable function to get Postmaster PID?
List pgsql-hackers
On Thu, Feb 4, 2021 at 2:39 AM Tomas Vondra
<tomas.vondra@enterprisedb.com> wrote:
>
> On 2/3/21 7:12 AM, Bharath Rupireddy wrote:
> > Hi,
> >
> > Can we have a new function, say pg_postgres_pid(), to return
> > postmaster PID similar to pg_backend_pid()? At times, it will be
>
> Curious question - why do you actually need PID of the postmaster? For
> debugging, I'd say it's not quite necessary - you can just attach a
> debugger to the backend and print the PostmasterPid directly. Or am I
> missing something?

But sometimes we may also have to debug postmaster code, on different
platforms maybe. I don't know how the postmaster pid from the user
perspective will be useful in customer environments and I can't think
of other usages of the pg_postgres_pid().

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: a curious case of force_parallel_mode = on with jit'ing
Next
From: Bharath Rupireddy
Date:
Subject: Re: Can we have a new SQL callable function to get Postmaster PID?