Re: How to extract db hostname from the $dbh handle?

[email protected] ("Greg Sabino Mullane")
Newsgroups perl.dbi.users
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


> If I have a $dbh handle, is it possible to know which
> hostname is that $dbh connected to?

Not in generic DBI, but some drivers (e.g. Postgres via DBD::Pg) 
provide a custom attribute:

my $host = $dbh->{pg_host};

If your driver doesn't have that, bug the author, or perhaps 
even petition to have it added to DBI.

- -- 
Greg Sabino Mullane [email protected]
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201003121324
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkuahwMACgkQvJuQZxSWSshl+wCgpMQyIpWoznnKmOidnEEOR9qJ
C8IAoITr6UOShu6gMH4Jtv7svepRhJNQ
=ZJcH
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.