Received: from candle.pha.pa.us (216-55-132-35.dsl.san-diego.abac.net [216.55.132.35]) by postgresql.org (Postfix) with ESMTP id BB4AE47599A for ; Tue, 5 Mar 2002 18:35:25 -0500 (EST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id g25NYu403277; Tue, 5 Mar 2002 18:34:56 -0500 (EST) From: Bruce Momjian Message-Id: <200203052334.g25NYu403277@candle.pha.pa.us> Subject: Re: getting pid of backend In-Reply-To: To: Kovacs Zoltan Date: Tue, 5 Mar 2002 18:34:56 -0500 (EST) Cc: Josh Berkus , pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL96 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200203/60 X-Sequence-Number: 6942 Kovacs Zoltan wrote: > On Tue, 5 Mar 2002, Josh Berkus wrote: > > > Kovacs, > > > > > Is there an easier method? > > > > Much easier. Take a look at $PGDATA/postmaster.pid > > I mean the current pid number of the actual connection. Not the postmaster > process, I need the pid of the currently running postgres. :-) You are going to love this one: test=> create function getpid() returns int as '/shlib/libc.so', 'getpid' language c; CREATE test=> select getpid(); getpid -------- 2971 (1 row) You may need to modify the libc.so path. -- 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, Pennsylvania 19026