From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Kovacs Zoltan <kovacsz@pc10.radnoti-szeged.sulinet.hu>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: getting pid of backend
Date: Tue, 5 Mar 2002 18:34:56 -0500 (EST)
Message-ID: <200203052334.g25NYu403277@candle.pha.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.21.0203052348130.13904-100000@pc10.radnoti-szeged.sulinet.hu>
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
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: pgman@candle.pha.pa.us, kovacsz@pc10.radnoti-szeged.sulinet.hu, josh@agliodbs.com
Subject: Re: getting pid of backend
In-Reply-To: <200203052334.g25NYu403277@candle.pha.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