Re: getpid() function

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: getpid() function
Дата
Msg-id 200208040303.g7433Lr25210@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: getpid() function  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: getpid() function
Список pgsql-hackers
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > As I remember, most cases where people have recently been asking for
> > backend pid were related to temp tables because they were named by pid. 
> 
> Ah, good point.
> 
> > I don't think they are anymore.  (?)
> 
> Check.
> 
> > We can do two things.  We can either rename it to pg_backend_pid and
> > move it to the statistics section in the docs, where the backend pids of
> > all active backends are available, or remove my code additions and see
> > if anyone asks for it in 7.3.
> 
> 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.

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

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: CLUSTER and indisclustered
Следующее
От: Gavin Sherry
Дата:
Сообщение: Re: CLUSTER and indisclustered