Use DBI->trace() (or DBI_TRACE env var) to see what's happening.

Tim.

On Tue, Sep 16, 2008 at 10:34:55AM +1000, Ron Savage wrote:
> Hi Folks
> 
> OS: Debian.
> 
> I just used aptitude to install Postgres V 8.3.3, and recompiled DBD::Pg
> V 2.10.3.
> 
> >From the command line I can connect to Postgres, but via a CGI script or
> mod_perl handler I'm getting:
> 
> <==><8==>
> [Tue Sep 16 10:23:24 2008] [notice] Apache/2.2.9 (Unix) mod_ssl/2.2.9
> OpenSSL/0.9.8g mod_apreq2-20051231/2.6.0 mod_perl/2.0.4 Perl/v5.10.0
> configured -- resuming normal operations
> DBI connect('dbname=contacts','ron',...) failed: FATAL:  Ident
> authentication failed for user "ron"
> at /home/ron/perl.modules/Local-Contacts/lib/Local/Contacts/App/Database.pm 
> line 184
> [Dispatch] ERROR: Can't connect to data source '' because I can't work
> out what driver to use (it doesn't seem to contain a 'dbi:driver:'
> prefix and the DBI_DRIVER env var is not set)
> at /usr/local/share/perl/5.10.0/Log/Dispatch/DBI.pm line 31
> <==><8==>
> 
> Note the DSN has lost the prefix 'dbi:Pg:', so the error msg is correct.
> 
> If the mod_perl code uses warn "<$dsn>" I get:
> <dbi:Pg:dbname=contacts, ron, ...>
> as expected.
> 
> If I deliberately corrupt the command line script to use:
> my($dbh) = DBI -> connect('dbname=contacts', 'ron', '...');
> I get the same error msg:
> 
> [EMAIL PROTECTED]:~$ perl -I/home/ron/perl.modules/Local-Contacts/lib
> ~/scripts/Postgres/test.pg.pl
> Can't connect to data source 'dbname=contacts' because I can't work out
> what driver to use (it doesn't seem to contain a 'dbi:driver:' prefix
> and the DBI_DRIVER env var is not set)
> at /home/ron/scripts/Postgres/test.pg.pl line 17
> 
> Help!?
> 
> -- 
> Ron Savage
> [EMAIL PROTECTED]
> http://savage.net.au/index.html
> 

Reply via email to