Re: PostgreSQL Perl Module - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: PostgreSQL Perl Module
Date
Msg-id 380DBF2B.6D1DC13C@alumni.caltech.edu
Whole thread Raw
List pgsql-hackers
> I have downloaded and installed your packaged RPM for the Pg.pm module for
> PostgreSQL 6.5.1 on RedHat 6.0 i386 linux and cannot be found by perl.
> Is my problem unique? When I run a perl script with 'use Pg;' in it I get:
> Can't locate Pg.pm in @INC (@INC contains: /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503
/usr/lib/perl5/site_perl/5.005/i386-linux/usr/lib/perl5/site_perl/5.005 .) at ../src/Perl/pg.pl line 1.
 
> BEGIN failed--compilation aborted at ../src/Perl/pg.pl line 1.
> The Pg.pm has been installed into:
> /usr/lib/perl5/site_perl

I haven't had the chance to use much perl in the last year or two, but
it may be that the default @INC does not include the directories we
used for the installation. Also, the RPMs were generated on a RH5.2
system, which may have a slightly different configuration.

On my RH5.2 system, I have the following INC paths:

> perl -e 'foreach $i (@INC) { printf "$i\n" }'
/usr/lib/perl5/i386-linux/5.00405
/usr/lib/perl5
/usr/lib/perl5/site_perl/i386-linux
/usr/lib/perl5/site_perl
.

And the RPM puts files in:

[root@golem i386]# rpm -qlp postgresql-perl-6.5.1-2.i386.rpm
/usr/lib/perl5/man/man3/Pg.3
/usr/lib/perl5/site_perl/Pg.pm
/usr/lib/perl5/site_perl/auto/Pg
/usr/lib/perl5/site_perl/auto/Pg/autosplit.ix
/usr/lib/perl5/site_perl/i386-linux/auto
/usr/lib/perl5/site_perl/i386-linux/auto/Pg
/usr/lib/perl5/site_perl/i386-linux/auto/Pg/Pg.bs
/usr/lib/perl5/site_perl/i386-linux/auto/Pg/Pg.so

which seems to be consistant. One thing you can try is to add
/usr/lib/perl5/site_perl to INC at the top of your program and see if
that helps. Try:
 unshift(@INC, "/usr/lib/perl5/site_perl"); ...

One of the problems with generating RPMs is that unless you have more
than one machine you can't *really* test how they behave, but need
others to try them out. 

btw, it would probably be better to focus on new RPMs posted on
ftp://postgresql.org/pub/RPMS/ (and elsewhere), generated by Lamar
Owens who has taken over the RPM development and maintenance. These
include RPMs generated specifically for RH6.0, but Lamar had just put
out a request for someone to test the RH6.1-generated RPMs on a RH6.0
machine to see if they are compatible. If you have time, I'm sure he
would appreciate trying that out.

Good luck.
                   - Thomas

-- 
Thomas Lockhart                lockhart@alumni.caltech.edu
South Pasadena, California


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] Creating operators
Next
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] Readline use in trouble?