Environment:
RedHat 6.1
DBI-1.14
DBD-Pg-0.95
Prior to running the perl scripts I connected as the user to confrm I
could see data from the Postgres databse.
Test script WITHOUT using dbiproxy this works:
#!/usr/bin/perl -w
#
package DB;
$dsn = 'dbi:Pg:dbname=life';
$user = 'user';
$pass = 'pw';
package main;
use DBI;
use DBD::Pg;
print "\nConnection information\n";
print "$DB::user $DB::pass $DB::dsn\n\n";
my $dbh = DBI->connect("$DB::dsn","$DB::user","$DB::pass") ||
print "$DBI::errstr $DBI::err\n";
$dbh->disconnect || print "$DBI::errstr $DBI::err\n";
exit;
------------------------------------------------------------------
Test script using dbiproxy that hangs on the connect statement.
Note that I set up dbiproxy to listen on port 1101 with this
statement(done as user "postgres") which is all on one line:
/usr/bin/dbiproxy --logfile /home/postgres/dbiproxy.log
+--pidfile=/tmp/dbiproxy_pg.pid --localport 1101 --debug &
#!/usr/bin/perl -w
#
package DB;
$dsn = "dbi:Pg:dbname=life;host=127.0.0.1;port=1101";
$user = 'user';
$pass = 'pw';
package main;
use DBI;
use DBD::Pg;
print "\nConnection information\n";
print "$DB::user $DB::pass $DB::dsn\n\n";
my $dbh = DBI->connect("$DB::dsn","$DB::user","$DB::pass") ||
print "$DBI::errstr $DBI::err\n";
$dbh->disconnect || print "$DBI::errstr $DBI::err\n";
exit;
------------------------------------------------------------------
Using ^C to stop the hang gives the following error message from dbiproxy with
+--debug switch used.
debug, Connection from 127.0.0.1, port 1101
debug, Child clone: DBI::ProxyServer=HASH(0x81ab148)
debug, New child starting (DBI::ProxyServer=HASH(0x81ab148)).
debug, Accepting client from 127.0.0.1, port 1101
err, Child died: Unexpected EOF at
+/usr/lib/perl5/site_perl/5.005/RPC/PlServer/Comm.pm line 129.
debug, Child terminating.
Any ideas why this dbiproxy connect hangs?
TIA.
--
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com