Hi
I usually do something like...

$pgdbh = DBI->connect("DBI:Pg:dbname=testdb;host=myhost",
   'user', 'pass', {RaiseError => 0, PrintError => 0})
   or die "Cannot connect to testdb\n";


Adrian


-----Original Message-----
From: Anish Kumar K. [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 21 September 2004 15:26 
To: beginners perl
Subject: Can't connect to PG


Hi

I couldn't connect to the database. Following message is coming. Please help
me in this regard.

use strict;
use warnings;
use DBI;

my $dbh = DBI->connect('dbi:Pg:testdb','postgres','postgres') 
or die "Cannot connect to testdb\n";

exit;

Output

DBI->connect(testdb) failed: ERROR: Missing '=' after 'testdb' in conninfo
 at chkdbi.pl line 5
Cannot connect to testdb


Thanks
Anish

================================================================
This email message (and any accompanying file attachments) may contain copyright, 
confidential or privileged information and is intended for the sole use of the 
addressee named above. If you are not the intended recipient, or the person 
responsible for delivering this message to the intended recipient, please notify 
Australian Fast Foods Pty Ltd by return email and then delete the email, destroy any 
printed copy and do not disclose or use the information in it. Any unauthorised 
review, use, alteration, disclosure or distribution of this email (including 
attachments) by an unintended recipient is prohibited. Any views expressed in this 
message are those of the individual sender, Australian Fast Foods Pty Ltd does not 
represent that this message or any attached files are free from computer viruses.
================================================================

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to