|
From: Thomas G. <to...@ad...> - 2001-08-01 19:59:48
|
On Wed, 1 Aug 2001, Nicolas Lafferty wrote:
> Well. I have DBI installed. And Pg. Still no dice. See my just posted
> Subject "Pg not the problem" on the list. Hrmph. This is driving me nuts.
So, I'm unclear. Can you connect to Pg using DBI at all?
If not sure save the following as test.pl, make executable (chmod 755 test.pl)
and run it from the shell prompt: ./test.pl
#!/usr/bin/perl
use DBI;
$dbh = DBI->connect("dbi:Pg:dbname=template1", '', '') || die "$DBI::errstr";
$query = qq |select usename from pg_user|;
$sth=$dbh->prepare($query);
$sth->execute || die "$DBI::errstr";
@row=$sth->fetchrow_array;
$sth->finish;
$dbh->disconnect;
print "\n@row\n\n";
|