X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id C0493D1C4E6 for ; Fri, 1 Aug 2003 22:21:21 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 74803-09 for ; Fri, 1 Aug 2003 19:20:15 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id BA66DD1C4D5 for ; Fri, 1 Aug 2003 19:21:19 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h71MLLQ3014175; Fri, 1 Aug 2003 18:21:21 -0400 (EDT) To: gry@ll.mit.edu Cc: pgsql-sql@postgresql.org Subject: Re: backend cpu usage? [7.2] In-reply-to: <20030801162301.4ae86d31.gry@ll.mit.edu> References: <20030801162301.4ae86d31.gry@ll.mit.edu> Comments: In-reply-to george young message dated "Fri, 01 Aug 2003 16:23:01 -0400" Date: Fri, 01 Aug 2003 18:21:21 -0400 Message-ID: <14174.1059776481@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/20 X-Sequence-Number: 14636 george young 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