Re: getpid() function - Mailing list pgsql-hackers

From Tom Lane
Subject Re: getpid() function
Date
Msg-id 6709.1028431935@sss.pgh.pa.us
Whole thread Raw
In response to Re: getpid() function  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: getpid() function  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> Let's take it out and wait to see if anyone really still wants it.

> Just when I am ready to throw it away, I come up with a use for the
> function:

>     test=> select * from pg_stat_activity where procpid != backend_pid();

> This shows all activity _except_ my session, which pgmonitor or others
> may want to use, and I can think of no other way to do it.

Hm.  Actually this seems like an argument for exposing MyBackendId, since
what pg_stat_activity really depends on is BackendId.  But as that view
is presently defined, you'd not be able to writeWHERE backendid = my_backend_id()
because the view doesn't expose backendid.

> Comments?  Maybe this is why it should be called pg_backend_id and put
> in the stat section.

*Please* don't call it pg_backend_id --- that invites confusion with
BackendId which is a different thing.

I'd suggest pg_backend_pid.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: CLUSTER and indisclustered
Next
From: Tom Lane
Date:
Subject: Re: CLUSTER and indisclustered