Re: getting pid of backend

From: Laszlo Tibor <ltibor(at)mail(dot)tiszanet(dot)hu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kovacs Zoltan <kovacsz(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)hu>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: getting pid of backend
Date: 2002-03-06 10:46:28
Message-ID: NDELKOGEMPNIBNDBEANMKEAJCBAA.ltibor@mail.tiszanet.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Kovacs Zoltan <kovacsz(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)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(at)mail(dot)tiszanet(dot)hu

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bhuvan A 2002-03-06 13:54:22 inserting arrays from plpgsql.
Previous Message Tom Lane 2002-03-05 23:37:23 Re: getting pid of backend