LWP::Simple in Postgresql 7.3.4 - Mailing list pgsql-general

From Siew Hui, Wong
Subject LWP::Simple in Postgresql 7.3.4
Date
Msg-id 007d01c40be5$7a28ff60$320a0a0a@siewhui
Whole thread Raw
In response to Data Corruption in case of abrupt failure  (satish satish <satish_ach2003@yahoo.com>)
List pgsql-general
Hi,

Postgres 7.3.4
Perl 5.6.0 and Perl 5.8.1
RH 7

I have to implement some new postgres functions that need LWP::Simple , but
i've received errors in locating that module. By the way, the server
contains 2 perl versions for the previous administrator had problems
implementing scripts with LWP::Simple and has installed a second,
higher-version of Perl i.e. 5.8.1.

Upon running, the following trigger and functions in the db produced this
error:

ERROR: plperl: error from function : Can't locate LWP/Simple.pm in @INC
(@INC contains: /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0
/usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0
/usr/lib/perl5/site_perl .) at (eval 3) line 8. BEGIN failed--compilation
aborted at (eval 3) line 8. The specific sequence of files included or
processed is : /hello/world.cfm


CREATE TRIGGER autokuda
    AFTER INSERT ON temp_spp_kuda_live
    FOR EACH ROW
    EXECUTE PROCEDURE sendkuda ();

CREATE FUNCTION sendkuda () RETURNS "trigger"
    AS '
 begin
  perform KudaRedirect (NEW.tkl_gateway, NEW.tkl_keyword , NEW.tkl_mobile);
  return NEW;
 end;
'
    LANGUAGE plpgsql;


CREATE FUNCTION kudaredirect (character varying, character varying,
character varying) RETURNS integer
    AS '
 $gateway = $_[1];
 $keyword = $_[2];
 $mobileno = $_[3];
 my $url =
"http://www.helloworld.com/xxx.asp?gateway=$gateway&text=$keyword&from=$mobi
leno";
 use LWP::Simple;
  my $content = get $url;
  if (! defined $content) {
  system("/bin/echo KUDA: FAIL REDIRECT TO $gateway $keyword $mobileno >>
/path/to/fail.log");
 }

 system("/bin/echo KUDA: REDIRECT $gateway $keyword $mobileno >>
/path/to/success.log");
 return 0;
'
    LANGUAGE plperlu;


When i tried to install LWP::Simple, it just installed in 5.8.1 by default.
How can i point postgresql to use LWP::Simple in perl 5.8.1? Or at least
install LWP::Simple in perl 5.6...Other solutions are very much welcomed.

Also,I didn't uninstall perl 5.8 for i don't know what else depends on it.

Thank you for the time taken to ponder this :)


best regards
siew hui




pgsql-general by date:

Previous
From: Stephen Robert Norris
Date:
Subject: Re: fsync
Next
From: "John Sidney-Woollett"
Date:
Subject: Re: Lock inside trigger