I neglected to mention a potentially crucial difference between the installations of DBD-Pg-2.11.8 and DBD-Pg-2.12.0 referred to below. The DBD-Pg-2.11.8 installation was done as root, and lives in the normal Perl library tree; in contrast, the DBD-Pg-2.12.0 installation was done as a regular user, and lives off my home directory, in ~/ local/test.

Thanks!

Gabriel Berriz

Begin forwarded message:

From: Gabriel Berriz <[email protected]>
Date: April 25, 2009 12:44:05 PM EDT
To: [email protected]
Cc: [email protected]
Subject: DBI connect fails with DBD-Pg-2.12.0 but works with DBD- Pg-2.11.8



Hi. I'd like to upgrade our version of DBD::Pg from 2.11.8 to 2.12.0 (or higher), but 2.12.0 (the version I get when I upgrade DBD::Pg from CPAN) results in a connection error that did not occur with the earlier versions. Specifically, when I attempt to run my test scripts all my connection attempts fail with error messages like:

DBI connect('dbname=postgres','dev',...) failed: FATAL: role "dev" does not exist at t/read.t line 442

The source code line for referred to by this error message is

 my $pgh = DBI->connect(
                         'dbi:Pg:dbname=postgres',
                         'dev', '',
                         +{
                            AutoCommit => 1,
                            RaiseError => 1,
                            PrintError => 0,
                            PrintWarn  => 0,
                          }
                       );


As far as I know, there is only one Pg server running on localhost, and it uses the standard port. For this server, contrary to what the error message above says, the "dev" role most definitely exists. In fact, to get these errors to disappear (and all the tests to pass) all I need to do is ensure that the version of DBD::Pg that the code uses is 2.11.8 instead of 2.12.0, which confirms that role "dev" does exist as expected.

Does DBD-Pg-2.12.0 need a specific version of DBI?  I'm using 1.607.

How can I troubleshoot this further?

Thanks in advance,

Gabriel Berriz




Reply via email to