On 2010-03-12 18:25:42 -0000, Greg Sabino Mullane wrote:
> > 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.
This may not be possible in the general case. For some databases (e.g.,
Oracle, probably ODBC) you pass in an opaque identifier which is
resolved by the library, not the DBD.
hp
--
_ | Peter J. Holzer | Auf jedem Computer sollte der Satz Ludwigs II
|_|_) | Sysadmin WSR | eingeprägt stehen: "Ein ewig Rätsel will ich
| | | [email protected] | bleiben, mir und andern."
__/ | http://www.hjp.at/ | -- Wolfram Heinrich in desd
signature.asc
Description: Digital signature
