pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pl/perl library question
4+ messages / 3 participants
[nested] [flat]

* pl/perl library question
@ 2006-06-23 20:15  LLC <kevin@kevinkempterllc.com>
  0 siblings, 1 reply; 4+ messages in thread

From: LLC @ 2006-06-23 20:15 UTC (permalink / raw)
  To: pgsql-interfaces

Hi List;

I'm getting a library 'not fount' error when I run a pl/perl function.
Here's what I've done:

1) I'm on a Red Hat RHEL4 box with many many perl versions/installs and
the dev team is using them all. I do not want to step on anyone's dev
efforts so I downloaded and installed my own perl install in
/usr/local/pgsperl

2) next I set the following:
export PATH=/usr/local/pgsperl/bin:$PATH
export PERL5LIB=/usr/local/pgsperl/lib
export MANPATH=/usr/local/pgsperl/man:$MANPATH
export SYBASE=/usr/local/TDS   # for freetds

3) with the above env variables set I installed DBI via:
perl -MCPAN -e 'install Bundle::DBI'

4) next I installed DBD::Sybase via the source. Ran make install and it
installed in
/usr/local/pgsperl/lib/site_perl/5.8.7/x86_64-linux/auto/DBD/Sybase

5) I wrote a test perl script that connects to a Sql Server db, and
executes a select count(*) for a table. Running this script works.

6) created a function based on untrusted perl that executes a select of a
remote sql Server db table.

7) created an sql stmt to select * from this function


I've also created the same function and sql stmt on my laptop running SuSE
10 and postgres and the function works fine. The SuSE laptop has only the
default perl install.

I can create the function (sybase_get) on the RHEL with no problems,
however when I run the select (see below) which works on the SuSE laptop I
get the following error:


########## SQL STMT #########
select * from sybase_get() as (loc_parent_id varchar(100),
cricket_location_id_key varchar(100));

######### errors returned #################
$ psql pltest < tst7.sql
ERROR:  error from Perl function: install_driver(Sybase) failed: Can't
load
'/usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/auto/DBD/Sybase/Sybase.so'
for module DBD::Sybase: libct.so.3: cannot open shared object file: No
such file or directory at
/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/DynaLoader.pm line 230.
 at line 3
Compilation failed in require at line 3.
Perhaps a required shared library or dll isn't installed where expected
 at line 5

It seems that pl/perl is looking in
/usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/auto

Is there a way to tell postgres to look in
/usr/local/pgsperl/lib/site_perl/5.8.7/x86_64-linux/auto ?


Thanks in advance for your help.





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pl/perl library question
@ 2006-06-24 12:13  Andy Shellam <andy@andycc.net>
  parent: LLC <kevin@kevinkempterllc.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Andy Shellam @ 2006-06-24 12:13 UTC (permalink / raw)
  To: kevin@kevinkempterllc.com; +Cc: pgsql-interfaces

I've not done a lot with Perl, so can't comment on anything specific to 
do with Perl, however, as an obvious "quick fix", can you symlink the 
actual location of your library to the location Perl is looking in?

Andy

LLC wrote:
> Hi List;
>
> I'm getting a library 'not fount' error when I run a pl/perl function.
> Here's what I've done:
>
> 1) I'm on a Red Hat RHEL4 box with many many perl versions/installs and
> the dev team is using them all. I do not want to step on anyone's dev
> efforts so I downloaded and installed my own perl install in
> /usr/local/pgsperl
>
> 2) next I set the following:
> export PATH=/usr/local/pgsperl/bin:$PATH
> export PERL5LIB=/usr/local/pgsperl/lib
> export MANPATH=/usr/local/pgsperl/man:$MANPATH
> export SYBASE=/usr/local/TDS   # for freetds
>
> 3) with the above env variables set I installed DBI via:
> perl -MCPAN -e 'install Bundle::DBI'
>
> 4) next I installed DBD::Sybase via the source. Ran make install and it
> installed in
> /usr/local/pgsperl/lib/site_perl/5.8.7/x86_64-linux/auto/DBD/Sybase
>
> 5) I wrote a test perl script that connects to a Sql Server db, and
> executes a select count(*) for a table. Running this script works.
>
> 6) created a function based on untrusted perl that executes a select of a
> remote sql Server db table.
>
> 7) created an sql stmt to select * from this function
>
>
> I've also created the same function and sql stmt on my laptop running SuSE
> 10 and postgres and the function works fine. The SuSE laptop has only the
> default perl install.
>
> I can create the function (sybase_get) on the RHEL with no problems,
> however when I run the select (see below) which works on the SuSE laptop I
> get the following error:
>
>
> ########## SQL STMT #########
> select * from sybase_get() as (loc_parent_id varchar(100),
> cricket_location_id_key varchar(100));
>
> ######### errors returned #################
> $ psql pltest < tst7.sql
> ERROR:  error from Perl function: install_driver(Sybase) failed: Can't
> load
> '/usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/auto/DBD/Sybase/Sybase.so'
> for module DBD::Sybase: libct.so.3: cannot open shared object file: No
> such file or directory at
> /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/DynaLoader.pm line 230.
>  at line 3
> Compilation failed in require at line 3.
> Perhaps a required shared library or dll isn't installed where expected
>  at line 5
>
> It seems that pl/perl is looking in
> /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/auto
>
> Is there a way to tell postgres to look in
> /usr/local/pgsperl/lib/site_perl/5.8.7/x86_64-linux/auto ?
>
>
> Thanks in advance for your help.
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo@postgresql.org so that your
>        message can get through to the mailing list cleanly
>
> !DSPAM:14,449c8c94256846764010052!
>
>
>   




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pl/perl library question
@ 2006-06-24 14:48  Sean Davis <sdavis2@mail.nih.gov>
  parent: Andy Shellam <andy@andycc.net>
  0 siblings, 1 reply; 4+ messages in thread

From: Sean Davis @ 2006-06-24 14:48 UTC (permalink / raw)
  To: andy@andycc.net; kevin@kevinkempterllc.com; +Cc: pgsql-interfaces


----- Original Message ----- 
From: "Andy Shellam" <andy@andycc.net>
To: <kevin@kevinkempterllc.com>
Cc: <pgsql-interfaces@postgresql.org>
Sent: Saturday, June 24, 2006 8:13 AM
Subject: Re: [INTERFACES] pl/perl library question


> I've not done a lot with Perl, so can't comment on anything specific to do 
> with Perl, however, as an obvious "quick fix", can you symlink the actual 
> location of your library to the location Perl is looking in?

The better fix (and I'm no expert, either) is probably to make sure that the 
perl that pg is using is the same perl under which you install packages.  It 
wasn't clear from the OP that this was the case.

Sean 




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pl/perl library question
@ 2006-06-24 15:04  Andy Shellam <andy@andycc.net>
  parent: Sean Davis <sdavis2@mail.nih.gov>
  0 siblings, 0 replies; 4+ messages in thread

From: Andy Shellam @ 2006-06-24 15:04 UTC (permalink / raw)
  To: Sean Davis <sdavis2@mail.nih.gov>; +Cc: pgsql-interfaces

This is true, although in an ideal solution, the developers wouldn't be 
using multiple versions of perl in different places, so this wouldn't be 
an issue!


Sean Davis wrote:
>
> ----- Original Message ----- From: "Andy Shellam" <andy@andycc.net>
> To: <kevin@kevinkempterllc.com>
> Cc: <pgsql-interfaces@postgresql.org>
> Sent: Saturday, June 24, 2006 8:13 AM
> Subject: Re: [INTERFACES] pl/perl library question
>
>
>> I've not done a lot with Perl, so can't comment on anything specific 
>> to do with Perl, however, as an obvious "quick fix", can you symlink 
>> the actual location of your library to the location Perl is looking in?
>
> The better fix (and I'm no expert, either) is probably to make sure 
> that the perl that pg is using is the same perl under which you 
> install packages.  It wasn't clear from the OP that this was the case.
>
> Sean
>
> !DSPAM:14,449d50d8256841247620461!
>
>




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2006-06-24 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-06-23 20:15 pl/perl library question LLC <kevin@kevinkempterllc.com>
2006-06-24 12:13 ` Andy Shellam <andy@andycc.net>
2006-06-24 14:48   ` Sean Davis <sdavis2@mail.nih.gov>
2006-06-24 15:04     ` Andy Shellam <andy@andycc.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox