On Mon, 31 Mar 2003, MedanKia - Han Lin wrote:
> Hi guys,
Hi.
>
> I have a problem with DBD-Pg when try to talk to Postgresql. I always get
> this error :
>
> Undefined subroutine &Pg::connectdb called at test.pl line 4.
>
> Below is my code ?
>
> 1.#!/usr/bin/perl -w
> 2.
> 3.use Pg;
> 4. $conn = Pg::connectdb("dbname=template1");
> 5. $res = $conn->exec("SELECT * from pg_user");
> 6. while (@row = $res->fetchrow) {
> 7. print = join(" ", @row);
> 8. }
>
You are not using DBD::Pg in your code; you are using Pg, an oder
interface to PostgreSQL. You want to upgrade to DBD::Pg and use that
instead if only because yhe last release of Pg was in Apr of 2000 and
there have been quite a few changes in PostgreSQL since then.
-r