pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laszlo Tibor <ltibor@mail.tiszanet.hu>
To: Tom Lane <tgl@sss.pgh.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: Wed, 06 Mar 2002 11:46:28 +0100
Message-ID: <NDELKOGEMPNIBNDBEANMKEAJCBAA.ltibor@mail.tiszanet.hu> (raw)
In-Reply-To: <19415.1015371443@sss.pgh.pa.us>

> Kovacs Zoltan <kovacsz@pc10.radnoti-szeged.sulinet.hu> writes:
> > I mean the current pid number of the actual connection. Not the
> postmaster
> > process, I need the pid of the currently running postgres. :-)
>
> I don't believe it's available as a SQL query, but libpq can tell you
> what it is.
>
> Probably a more interesting question is "why do you want to know?".
> I can't offhand think of a really good reason to use the backend pid
> for anything on the client side, other than distinguishing self-notifies
> from other notifies, which is not something you can do at the SQL level
> anyway.
>
> 			regards, tom lane

We need the backend's pid in the backend side. The backend's pid is good to
figure out the client ip address and good for logging.

We need to log the connections and the Win32 exe-s to determine the
ownership relations between backends and programs. Unfortunately, there are
backends without programs, eating server resources in our production system.

Plus we need to connect the logs to existing user and system dictionary data
in the database so we want to log into database tables.

Do you think it's a silly thing?


Regards, Tibor Laszlo
ltibor@mail.tiszanet.hu




view thread (6+ messages)

Message-ID: <NDELKOGEMPNIBNDBEANMKEAJCBAA.ltibor@mail.tiszanet.hu>
Permalink:  ../NDELKOGEMPNIBNDBEANMKEAJCBAA.ltibor@mail.tiszanet.hu/
Also on:    postgresql.org/message-id/NDELKOGEMPNIBNDBEANMKEAJCBAA.ltibor@mail.tiszanet.hu

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: ltibor@mail.tiszanet.hu, tgl@sss.pgh.pa.us, kovacsz@pc10.radnoti-szeged.sulinet.hu, josh@agliodbs.com
  Subject: Re: getting pid of backend
  In-Reply-To: <NDELKOGEMPNIBNDBEANMKEAJCBAA.ltibor@mail.tiszanet.hu>
  References: <19415.1015371443@sss.pgh.pa.us> <NDELKOGEMPNIBNDBEANMKEAJCBAA.ltibor@mail.tiszanet.hu>

* 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