Re: getpid() function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Thomas Lockhart <lockhart(at)fourpalms(dot)org>, Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: getpid() function
Date: 2002-08-04 03:44:01
Message-ID: 6810.1028432641@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2002-08-04 03:46:09 Re: Data Corruption
Previous Message Bruce Momjian 2002-08-04 03:38:09 Re: getpid() function

Browse pgsql-hackers by date

  From Date Subject
Next Message Curt Sampson 2002-08-04 03:49:41 Re: Why is MySQL more chosen over PostgreSQL?
Previous Message mark Kirkwood 2002-08-04 03:39:10 Re: CLUSTER and indisclustered