From: Tom Lane <tgl@sss.pgh.pa.us>
To: gry@ll.mit.edu
Cc: pgsql-sql@postgresql.org
Subject: Re: backend cpu usage? [7.2]
Date: Fri, 01 Aug 2003 18:21:21 -0400
Message-ID: <14174.1059776481@sss.pgh.pa.us> (raw)
In-Reply-To: <20030801162301.4ae86d31.gry@ll.mit.edu>
References: <20030801162301.4ae86d31.gry@ll.mit.edu>
george young <gry@ll.mit.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, gry@ll.mit.edu
Subject: Re: backend cpu usage? [7.2]
In-Reply-To: <14174.1059776481@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox