Re: backend cpu usage? [7.2]

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: gry(at)ll(dot)mit(dot)edu
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: backend cpu usage? [7.2]
Date: 2003-08-01 22:21:21
Message-ID: 14174.1059776481@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

george young <gry(at)ll(dot)mit(dot)edu> writes:
> How can I get cpu usage info in 7.2 about the backend process of my db
> connection? I tried looking at the pg_stat_get_backend_pid function
> but it requires a backend_id that I don't know how to get.
> If I can get the backend pid I can fork a 'ps' command from my app,
> though it would be nicer to get it directly through sql.

There's a pg_backend_pid() function in 7.3 that returns your own PID.
Not sure if it was in 7.2.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bertrand Petit 2003-08-02 00:21:52 Efficient deletions?
Previous Message Bruce Momjian 2003-08-01 21:44:10 Re: TODO item for plpgsql Was Re: obtuse plpgsql function needs