OT - pg perl DBI question
Hi chaps,
I'm trying yo run a perl script that uses DBI (Slonys
psql_replication_check.pl to be precise) and I'm getting the error:
Can't locate Pg.pm in @INC
Now I do have the file in /usr/lib/perl5/DBD/ but the script can't
see it. I'm guessing that unless I fudge it and put the absoloute
path in the script, I need to set some sort of path somewhere, but
I'm lost as to what or where.
Could someone point me in the correct direction please?
___________________________________________________________
Support the World Aids Awareness campaign this month with Yahoo! For Good http://uk.promotions.yahoo.com/forgood/
On Tue, Jan 29, 2008 at 04:24:05AM -0800, Glyn Astill wrote:
I'm trying yo run a perl script that uses DBI (Slonys
psql_replication_check.pl to be precise) and I'm getting the error:Can't locate Pg.pm in @INC
Now I do have the file in /usr/lib/perl5/DBD/ but the script can't
see it. I'm guessing that unless I fudge it and put the absoloute
path in the script, I need to set some sort of path somewhere, but
I'm lost as to what or where.Could someone point me in the correct direction please?
Run perl -V and see if the path is there for @INC. If it's there, check
such things as permissions. If not, ponder deeply as to why this is so
(as /usr/lib/perl5 is a standard path for perl in /usr) and if you can't
fix it 'properly' you can work-around with the use of 'use lib' (see
perldoc perlvar and search for @INC).
--
"To the extent that we overreact, we proffer the terrorists the
greatest tribute."
- High Court Judge Michael Kirby
Run perl -V and see if the path is there for @INC. If it's there,
check
such things as permissions. If not, ponder deeply as to why this is
so
(as /usr/lib/perl5 is a standard path for perl in /usr) and if you
can't
fix it 'properly' you can work-around with the use of 'use lib'
(see
perldoc perlvar and search for @INC).
perl -V shows
@INC:
/etc/perl
/usr/local/lib/perl/5.8.8
/usr/local/share/perl/5.8.8
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.8
/usr/share/perl/5.8
/usr/local/lib/site_perl
Should the subdirectory DBD be in there? Perl was setup using apt.
__________________________________________________________
Sent from Yahoo! Mail - a smarter inbox http://uk.mail.yahoo.com
On Tue, Jan 29, 2008 at 04:45:48AM -0800, Glyn Astill wrote:
Should the subdirectory DBD be in there? Perl was setup using apt.
How are you using it and what's your DBI db connect line?
I'm about to go to sleep so if I don't reply it'll be because I'm
unconcious. :)
--
"To the extent that we overreact, we proffer the terrorists the
greatest tribute."
- High Court Judge Michael Kirby
well its using the pgsql_replication_check.pl, which does:
----------------------
use Pg;
use Getopt::Std;
our ($opt_h, $opt_d, $opt_p, $opt_U, $opt_w, $opt_c) = '';
my ($conn, $res, $status, @tuple);
my $query = 'SELECT * FROM replication_status' ;
my @rep_time;
---------------------------------------
But the error I ge t is:
an't locate Pg.pm in @INC (@INC contains: /etc/perl
/usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5
/usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8
/usr/local/lib/site_perl .) at psql_replication_check.pl line 12.
BEGIN failed--compilation aborted at psql_replication_check.pl line
12.
So I assume it's not getting past the use Pg line as although it's
looking in /usr/lib/perl5 it's not going to look in
/usr/lib/perl5/DBD ??
--- CaT <cat@zip.com.au> wrote:
On Tue, Jan 29, 2008 at 04:45:48AM -0800, Glyn Astill wrote:
Should the subdirectory DBD be in there? Perl was setup using
apt.
How are you using it and what's your DBI db connect line?
I'm about to go to sleep so if I don't reply it'll be because I'm
unconcious. :)--
"To the extent that we overreact, we proffer the terrorists the
greatest tribute."
- High Court Judge Michael Kirby
__________________________________________________________
Sent from Yahoo! Mail - a smarter inbox http://uk.mail.yahoo.com
On Tue, Jan 29, 2008 at 05:10:00AM -0800, Glyn Astill wrote:
well its using the pgsql_replication_check.pl, which does:
----------------------
use Pg;
...
So I assume it's not getting past the use Pg line as although it's
looking in /usr/lib/perl5 it's not going to look in
/usr/lib/perl5/DBD ??
No. It's not using the DBI Pg. There's another module. A standalone one
that I believe it may be using. Under Debian this is available as
libpg-perl. Your OS/Distro may vary. If you don't have it available as a
package, check with CPAN.
Zzz...
--
"To the extent that we overreact, we proffer the terrorists the
greatest tribute."
- High Court Judge Michael Kirby
Glyn Astill wrote:
well its using the pgsql_replication_check.pl, which does:
----------------------
use Pg;
use Getopt::Std;
So I assume it's not getting past the use Pg line as although it's
looking in /usr/lib/perl5 it's not going to look in
/usr/lib/perl5/DBD ??
DBD::Pg is not the same as Pg.pm
perldoc DBD::Pg
perldoc Pg
I think it's libpg-perl that you want.
--
Richard Huxton
Archonet Ltd
this looks to be using the Pg module rather than DBI + DBD::Pg. This
one i think:
http://www.cpan.org/authors/id/M/ME/MERGL/pgsql_perl5-1.9.0.tar.gz
i think thats quite old now though....
On 29 Jan 2008, at 13:10, Glyn Astill wrote:
Show quoted text
well its using the pgsql_replication_check.pl, which does:
----------------------
use Pg;
use Getopt::Std;our ($opt_h, $opt_d, $opt_p, $opt_U, $opt_w, $opt_c) = '';
my ($conn, $res, $status, @tuple);
my $query = 'SELECT * FROM replication_status' ;
my @rep_time;
---------------------------------------But the error I ge t is:
an't locate Pg.pm in @INC (@INC contains: /etc/perl
/usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5
/usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8
/usr/local/lib/site_perl .) at psql_replication_check.pl line 12.
BEGIN failed--compilation aborted at psql_replication_check.pl line
12.So I assume it's not getting past the use Pg line as although it's
looking in /usr/lib/perl5 it's not going to look in
/usr/lib/perl5/DBD ??--- CaT <cat@zip.com.au> wrote:On Tue, Jan 29, 2008 at 04:45:48AM -0800, Glyn Astill wrote:
Should the subdirectory DBD be in there? Perl was setup using
apt.
How are you using it and what's your DBI db connect line?
I'm about to go to sleep so if I don't reply it'll be because I'm
unconcious. :)--
"To the extent that we overreact, we proffer the terrorists the
greatest tribute."
- High Court Judge Michael Kirby__________________________________________________________
Sent from Yahoo! Mail - a smarter inbox http://uk.mail.yahoo.com---------------------------(end of
broadcast)---------------------------
TIP 4: Have you searched our list archives?
CaT wrote:
On Tue, Jan 29, 2008 at 05:10:00AM -0800, Glyn Astill wrote:
well its using the pgsql_replication_check.pl, which does:
----------------------
use Pg;...
So I assume it's not getting past the use Pg line as although it's
looking in /usr/lib/perl5 it's not going to look in
/usr/lib/perl5/DBD ??No. It's not using the DBI Pg. There's another module. A standalone one
that I believe it may be using. Under Debian this is available as
libpg-perl. Your OS/Distro may vary. If you don't have it available as a
package, check with CPAN.
On Debian, you want libdbd-pg-perl.
cww@iron:~$ dpkg -S /usr/lib/perl5/DBD/Pg.pm
libdbd-pg-perl: /usr/lib/perl5/DBD/Pg.pm
To the OP: FYI, the DBI mailing lists can be found at the following URL.
Colin
adam_pgsql wrote:
this looks to be using the Pg module rather than DBI + DBD::Pg. This one
i think:http://www.cpan.org/authors/id/M/ME/MERGL/pgsql_perl5-1.9.0.tar.gz
i think thats quite old now though....
Indeed, that's how it looks. That would be in the libpg-perl package on
Debian. In Lenny (testing), the latest version of that is 1:2.1.1-3.
Colin
Colin Wetherbee wrote:
CaT wrote:
On Tue, Jan 29, 2008 at 05:10:00AM -0800, Glyn Astill wrote:
well its using the pgsql_replication_check.pl, which does:
----------------------
use Pg;...
So I assume it's not getting past the use Pg line as although it's
looking in /usr/lib/perl5 it's not going to look in
/usr/lib/perl5/DBD ??No. It's not using the DBI Pg. There's another module. A standalone one
that I believe it may be using. Under Debian this is available as
libpg-perl. Your OS/Distro may vary. If you don't have it available as a
package, check with CPAN.On Debian, you want libdbd-pg-perl.
cww@iron:~$ dpkg -S /usr/lib/perl5/DBD/Pg.pm
libdbd-pg-perl: /usr/lib/perl5/DBD/Pg.pmTo the OP: FYI, the DBI mailing lists can be found at the following URL.
Please ignore my noise. The OP isn't using DBI, and libpg-perl is the
correct package for Pg.
Colin
On Tue, Jan 29, 2008 at 01:30:04PM +0000, adam_pgsql wrote:
this looks to be using the Pg module rather than DBI + DBD::Pg. This
one i think:http://www.cpan.org/authors/id/M/ME/MERGL/pgsql_perl5-1.9.0.tar.gz
i think thats quite old now though....
In the one in this package:
http://packages.debian.org/lenny/libpg-perl
It's not old. It's kept reasonably up to date. It's more or less a shim
over the C library and has direct access to all its features, which is
not always possible with DBD:Pg.
Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
Show quoted text
Those who make peaceful revolution impossible will make violent revolution inevitable.
-- John F Kennedy
On 29 Jan 2008, at 13:39, Martijn van Oosterhout wrote:
On Tue, Jan 29, 2008 at 01:30:04PM +0000, adam_pgsql wrote:
this looks to be using the Pg module rather than DBI + DBD::Pg. This
one i think:http://www.cpan.org/authors/id/M/ME/MERGL/pgsql_perl5-1.9.0.tar.gz
i think thats quite old now though....
In the one in this package:
http://packages.debian.org/lenny/libpg-perlIt's not old. It's kept reasonably up to date. It's more or less a
shim
over the C library and has direct access to all its features, which is
not always possible with DBD:Pg.
ah sorry, i was just looking at the date on CPAN for
pgsql_perl5-1.9.0.tar.gz which says 04-Apr-2000.
Thanks for the more up to date info though.
adam
Hi chaps,
Excellent, it was libpg-perl I needed.
Thanks
--- Richard Huxton <dev@archonet.com> wrote:
Glyn Astill wrote:
well its using the pgsql_replication_check.pl, which does:
----------------------
use Pg;
use Getopt::Std;So I assume it's not getting past the use Pg line as although
it's
looking in /usr/lib/perl5 it's not going to look in
/usr/lib/perl5/DBD ??DBD::Pg is not the same as Pg.pm
perldoc DBD::Pg
perldoc PgI think it's libpg-perl that you want.
--
Richard Huxton
Archonet Ltd
__________________________________________________________
Sent from Yahoo! Mail - a smarter inbox http://uk.mail.yahoo.com
On Tue, Jan 29, 2008 at 05:10:00AM -0800, Glyn Astill wrote:
well its using the pgsql_replication_check.pl, which does:
----------------------
use Pg;
I wouldn't trust that library or anything that depends on it if I were
you. It's been unmaintained for a *very* long time.
Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
On Tue, Jan 29, 2008 at 04:24:05AM -0800, Glyn Astill wrote:
Hi chaps,
I'm trying yo run a perl script that uses DBI (Slonys
psql_replication_check.pl to be precise) and I'm getting the error:Can't locate Pg.pm in @INC
Pg.pm isn't DBI. It's the Pg Perl interface.
A
On Tue, Jan 29, 2008 at 08:14:28AM -0800, David Fetter wrote:
I wouldn't trust that library or anything that depends on it if I were
you. It's been unmaintained for a *very* long time.
Because code rusts when it's sitting around on a hard drive?
Pg.pm doesn't get much attention, I agree, but I've actually never run into
a (n undocumented) bug with it. Also, for simple Perl access for
Postgres-dedicated use, DBI can be a little heavyweight.
A
David Fetter wrote:
On Tue, Jan 29, 2008 at 05:10:00AM -0800, Glyn Astill wrote:
well its using the pgsql_replication_check.pl, which does:
----------------------
use Pg;I wouldn't trust that library or anything that depends on it if I were
you. It's been unmaintained for a *very* long time.
Are you speaking from personal experience, or just of the lack of
maintenance?
--
Until later, Geoffrey
Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety.
- Benjamin Franklin
On Jan 29, 2008, at 7:24 AM, Glyn Astill wrote:
I'm trying yo run a perl script that uses DBI (Slonys
psql_replication_check.pl to be precise) and I'm getting the error:Can't locate Pg.pm in @INC
It doesn't use DBI, it uses Pg. At some point I posted patches to
convert it to DBI and DBD::Pg, but I don't know where those are
anymore as I don't use that code.
On Jan 29, 2008, at 1:07 PM, Andrew Sullivan wrote:
On Tue, Jan 29, 2008 at 08:14:28AM -0800, David Fetter wrote:
I wouldn't trust that library or anything that depends on it if I
were
you. It's been unmaintained for a *very* long time.Because code rusts when it's sitting around on a hard drive?
Pg.pm doesn't get much attention, I agree, but I've actually never
run into
a (n undocumented) bug with it. Also, for simple Perl access for
Postgres-dedicated use, DBI can be a little heavyweight.
You mean other than the fact that it doesn't support the V3 protocol,
doesn't support escaping parameters, is a one-for-one wrapper for the
libpq from eight years ago (and has never been updated since), there
is a timing bug from 4 years ago still open (http://rt.cpan.org/
Public/Bug/Display.html?id=3177), and the docs include zingers like
"Starting with postgresql-6.5 it is required to use large objects
only inside a transaction"?
The postgresql from eight years ago is also quite rusty.
Cheers,
M