in reply to Trouble Connecting to PostgreSQL with DBD::Pg

$OS_ERROR does not contain what you think. Read the DBI connect documentation for how to properly report errors.

Also note that PostgreSQL, by default, refuses most connect / login attempts. See Client Authentication in the PostgreSQL documentation. psql will probably use a different communication path (Unix domain socket) than your perl script (TCP/IP socket via localhost IPv4/IPv6), and the server probably consideres the first one trustworthy, but not the second one.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^2: Trouble Connecting to PostgreSQL with DBD::Pg
by vendion (Scribe) on Nov 15, 2010 at 04:20 UTC

    Thanks for the pointer about catching errors when DBI trys to connect to the database, I'm checking into the possibily I don't have PostgreSQL configured correctly to allow for connections.