Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Corrupted server name in DBI or DBD::Pg

by paulbort (Hermit)
on Oct 01, 2004 at 17:40 UTC ( #395668=perlquestion: print w/replies, xml ) Need Help??

paulbort has asked for the wisdom of the Perl Monks concerning the following question:

Fellow Monks,

I have, in the process of upgrading my Request Tracker server from RedHat 8.0 to Fedora Core 2, seriously broken DBI and DBD::Pg.

I have removed the DBI and DBD::Pg RPMs, and installed (from CPAN) fresh copies of both, without error. But when I try to run my simple test program, things go strange:
#!/usr/bin/perl use DBI; use DBD::Pg; my $dbh = DBI->connect( 'dbi:Pg:dbname=template1;host=localhost', 'postgres', undef ); die DBI->errstr;
The output is as follows:
DBI connect('dbname=template1;host=localhost','postgres',...) failed: +could not connect to server: DY@_O at /root/ line 8 could not connect to server: DY@_O at /root/ line 10.
I know I've broken something while flailing about, and I hate asking for help with my own mistakes, but I'm stuck. If I change the DSN, the strange characters change, but seem to always start with a 'D'. I've searched Google and the monastery with no luck.

Relevant details:
Perl 5.8.3 (from Fedora Core 2 RPM, multi-threaded)
DBI 1.43
DBD::Pg 1.32
PostgreSQL 7.4.2 (Also from RPM)
psql works normally.

@INC includes the following, but I have no idea if this is sane or not:
/usr/lib/perl5/5.8.3/i386-linux-thread-multi /usr/lib/perl5/5.8.3 /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl
Thanks in advance.

Update:Never Mind, I didn't see the forest for the trees. Props to hsinclai for the gentle reminder.

Spring: Forces, Coiled Again!

Replies are listed 'Best First'.
Re: Corrupted server name in DBI or DBD::Pg
by hsinclai (Deacon) on Oct 01, 2004 at 17:50 UTC
    Hey paulbort - is your pg_hba.conf set up correctly? What is in your postgres log? It will probably have the clues!


      In one of my earlier flailing attempts, I re-installed PostgreSQL, and didn't re-enable sockets (in both postgresql.conf and pg_hba.conf.)

      Thank you for ponting out the blindingly obvious.
      But I still don't get the bizarre mangling of the servername

      Spring: Forces, Coiled Again!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://395668]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2019-07-21 09:09 GMT
Find Nodes?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?

    Results (7 votes). Check out past polls.