I got Pl/Perl working on Solaris! - Mailing list pgsql-general

From Callis, Adam
Subject I got Pl/Perl working on Solaris!
Date
Msg-id FD79C9F7FA9DD311862700508B6F3F4F02433A5D@usashexch02.corp.us.uu.net
Whole thread Raw
List pgsql-general
Hello,
Since I know I had one heck of a time getting pl/perl to work on my box I
thought I would pass on the procedure that I used to get it working.

Here's what I was working with
Sparc Solaris 2.6
Perl 5.6.0
GCC 2.95.2 (Downloaded from www.sunfreeware.com as a package)


Step 1:
Install the GNU Dependencies
    Flex
    Bison
    zip
    make
    readline
    gcc 2.95.2

    These can all be obtained from www.sunfreeware.com as packages

Step 2:
Configure Perl
After perl has been untarred and gzipped I ran the
sh ./Configure
You can accept the defaults or whatever you want on all but 3 options
    1. compiler -> needs to be set to gcc
    2. malloc -> It will ask you if you want to use perl's malloc, you
MUST
    say NO, as it interferes with Postgres
    3. libperl.so -> It will ask you if you want to build it, you MUST
    say YES, so that postgres can load the perl libraries
Then run your normal make; make test; make install
Once it does that you need to copy the
/usr/local/lib/perl5/5.6.0/sun4-solaris/CORE/libperl.so to /lib
you can symbolic link it if you want.


Step 3:
Configure and installation of Postgres
set your enviroment variable for LD_RUN_PATH = /usr/local/pgsql/lib
then in the $srctree/src/
run ./configure
gmake
gmake test
gmake install
From here you should setup your normal data directory and run the initdb (As
the user that will be running postmaster)
, but don't start postmaster yet

Step 4:
Configure and installation of PL/Perl
in the $srctree/src/pl/plperl
run
perl Makefile.PL POLLUTE=1
gmake
gmake install

Step 5:
Start Postmaster (As the user who will normally be running it)
Set your enviroment var PGDATA /usr/local/pgsql/data (Or wherever you stored
your data)
set your enviroment var PGLIB /usr/local/pgsql/lib

run postmaster -S
Then run createlang plperl template1

Now in psql you can create plperl functions all day long!

Hope this helps some of you guys!

Also, if anyone has any examples of how to make the plperl function do a
query inside itself, I would greatly like to see it.

thanks

Adam Callis
acallis@uu.net

pgsql-general by date:

Previous
From: Partyka Robert
Date:
Subject: one ask
Next
From: John Pilley
Date:
Subject: Cannot createdb a database I just "destroydb"'d