Re: getpid() function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: getpid() function
Дата
Msg-id 6810.1028432641@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: getpid() function  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Sorry, I mean pg_backend_pid.

Okay, I was unsure if that was a typo or not.

> I could expose backend_id but it may
> confuse people so pid is probably better.  If you had the id, you could
> use pg_stat_get_backend_pid() to get the pid.

Yeah, I thought of suggesting pg_backend_id() to return MyBackendId and
then pg_stat_get_backend_pid() to get the PID, but was stopped by the
thought that this breaks down if the stats collector isn't running.
While I'm not convinced that there's any need for backend PID that's not
connected to looking at stats-collector results, it's probably foolish
to set up a mechanism that doesn't work outside that context.  Let's go
with pg_backend_pid().
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: CLUSTER and indisclustered
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [PATCHES] START TRANSACTION