Thread: How to get the PID associated with a Perl DBI dbh?

How to get the PID associated with a Perl DBI dbh?

From
Kynn Jones
Date:
Is there a reliable way to find out the (Unix) PID associated with a database handle generated by Perl DBI's database connection?

TIA!

Kynn

Re: How to get the PID associated with a Perl DBI dbh?

From
"A. Kretschmer"
Date:
In response to Kynn Jones :
> Is there a reliable way to find out the (Unix) PID associated with a database
> handle generated by Perl DBI's database connection?

You can ask the pg_stat_activity - View, column procpid.


HTH, Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

Re: How to get the PID associated with a Perl DBI dbh?

From
Joshua Tolley
Date:
On Thu, Mar 12, 2009 at 03:13:13PM +0100, A. Kretschmer wrote:
> In response to Kynn Jones :
> > Is there a reliable way to find out the (Unix) PID associated with a database
> > handle generated by Perl DBI's database connection?
>
> You can ask the pg_stat_activity - View, column procpid.

The query "select pg_backend_pid()" issued through that handle will also
return the PID.

- Josh / eggyknap

Attachment

Re: How to get the PID associated with a Perl DBI dbh?

From
Martin Gainty
Date:
pg clients communicate on 5432 so a simple search on 5432 will yield the pid e.g.
netstat -aon | grep 5432

Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.





Date: Thu, 12 Mar 2009 09:59:56 -0400
Subject: [GENERAL] How to get the PID associated with a Perl DBI dbh?
From: kynnjo@gmail.com
To: pgsql-general@postgresql.org

Is there a reliable way to find out the (Unix) PID associated with a database handle generated by Perl DBI's database connection?

TIA!

Kynn



Windows Live™ Groups: Create an online spot for your favorite groups to meet. Check it out.

Re: How to get the PID associated with a Perl DBI dbh?

From
"A. Kretschmer"
Date:
In response to Martin Gainty :
> pg clients communicate on 5432 so a simple search on 5432 will yield the pid
> e.g.
> netstat -aon | grep 5432

Thats no useful:

- you can't do that from the client (across the network)
- you can't see which pid has a particular client


Regards, Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

Re: How to get the PID associated with a Perl DBI dbh?

From
"Greg Sabino Mullane"
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


> Is there a reliable way to find out the (Unix) PID associated with a
> database handle generated by Perl DBI's database connection?

$dbh->{pg_pid}

- --
Greg Sabino Mullane greg@turnstep.com
End Point Corporation
PGP Key: 0x14964AC8 200903121148
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkm5LwgACgkQvJuQZxSWSsgojQCgyqfH1SyJx+8H3rDXmnoea560
T0AAn2Av9W9Edmt8aNBaV4caN1rScH2O
=GoEE
-----END PGP SIGNATURE-----