From: | "John" <vze23skh(at)verizon(dot)net> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Cant get Perl Module loaded |
Date: | 2001-05-24 01:33:46 |
Message-ID: | _xZO6.2381$xM2.1092372@typhoon2.ba-dsg.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Yes I posted a bunch of stuff way to hastily and was not clear. I ran
perl -e 'use DBD::Pg' and got this:
perl -e 'use DBD::Pg'
Can't locate DBD/Pg.pm in @INC (@INC contains:
/usr/lib/perl5/5.00503/i586-linux /usr/lib/perl5/5.00503
/usr/lib/perl5/site_perl/5.005/i586-linux /usr/lib/perl5/site_perl/5.005 .)
at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
I did a find as follows:
joro(at)natascha:/usr/lib/perl5 > find . -name "Pg.pm" -print
./site_perl/5.005/i586-linux/Pg.pm
so the Pg.pm file is in the scripts search path and yet....!?
Anyway to make the original post more complete, I was running a cgi script
as follows:
#!/usr/bin/perl
use Pg;
use DBI;
use CGI qw/:standard/;
$q = new CGI;
print $q->header;
my($dbh)="";
my($datasource)="dbi:Pg:infoman";
$dbh=DBI->connect($datasource) or die "Can't connect\n";
$sth = $dbh->prepare("SELECT Name from Platform");
$sth->execute();
@PLATOPTS=$sth->fetchrow_array();
.
.
.
#After doing some HTML I now try to create the a drop down
print "<p align=\"left\">Platform Selected<select size=\"1\" name=\"PlatID\"
multiple>\n";
foreach $appoption (@PLATOPTS){
print "<option>$platoption</option>\n";
}
Then finish the HTML ...etc.
I get this output:
install_driver(Pg) failed: Can't locate DBD/Pg.pm in @INC (@INC contains:
/usr/lib/perl5/5.00503/i586-linux /usr/lib/perl5/5.00503
/usr/lib/perl5/site_perl/5.005/i586-linux /usr/lib/perl5/site_perl/5.005 .)
at (eval 5) line 3.
Perhaps the DBD::Pg perl module hasn't been fully installed,
or perhaps the capitalisation of 'Pg' isn't right.
Available drivers: ADO, ExampleP, Multiplex, Proxy.
at /usr/local/apache/cgi-bin/vuladd.cgi line 23
I am not sure if I was supposed to compile perl into the posgresql or
postgresql into my perl. Anyway I went to the src directory and followed the
instructions for make install in the postgresql/src/interfaces/perl5
directory and everything seems fine. the permissions are:
joro(at)natascha:/usr/lib/perl5/site_perl/5.005/i586-linux > ls -l Pg.pm
-r--r--r-- 1 root root 18124 May 23 21:32 Pg.pm
If this is not enough information please tell me what else to post. Thanks
for helping me as I am struggling.
-John
"Neil Conway" <nconway(at)klamath(dot)dyndns(dot)org> wrote in message
news:20010522182623(dot)A348(at)klamath(dot)dyndns(dot)org(dot)(dot)(dot)
> On Sun, May 20, 2001 at 12:48:48PM +0000, John wrote:
> > I have installed perl and postgres, followed the instructions on how to
> > install the perl modules and tried to run a simple cgi script to connect
to
> > postgress, get some data and display it.
> >
> > I keep getting a message in the error log that says perl can't find the
> > DBM:Pg module or maybe I misspelled it. I also tried to "include" Pg.pm
and
> > it says it cant find the module. I did a manual find and it is there.
>
> Spelling things correctly (like DBD::Pg) and including the full error
> messages would be helpful. Also, there's a difference between Pg and
> DBD::Pg.
>
> 1) What output does this produce:
>
> perl -e 'use DBI; print join("\n", DBI->available_drivers), "\n"'
>
> 2) Do you get an error when you execute:
>
> perl -e 'use DBD::Pg'
>
> 3) What steps did you follow to install DBD::Pg?
>
> Cheers,
>
> Neil
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2001-05-24 02:40:38 | Re: Estimating costs (was Functional Indices) |
Previous Message | Martijn van Oosterhout | 2001-05-24 00:04:20 | Re: Re: Incrementing a date type. |