I try to install plpython in my Postgres 9.1, but it crashes the server:
postgres@dataserver1 :~> /opt/postgres/9.1/bin/psql -d mydb psql.bin (9.1.4) Type "help" for help. mydb=
I have python 2.6.8 installed and the handler fixed on the system:
select tmplname, tmplhandler, tmpllibrary from pg_pltemplate where tmplname like 'plpython%' "plpythonu" | "plpython_call_handler" | "$libdir/plpython2" "plpython2u" | "plpython2_call_handler" | "$libdir/plpython2"
And the handler is installed in $ libdir:
postgres@dataserver1 :~> ll /opt/postgres/9.1/lib/postgresql/plpython* -rwxr-xr-x 1 root root 6686333 Aug 17 14:27 /opt/postgres/9.1/lib/postgresql/plpython2.so
Any tips on this will be appreciated.
EDIT
I tried creating the extension plpythonu, plpython2u and plpython3u, and they all crashed the server.
After reading the documents a bit, I found the \ dx command for the list of installed extensions:
mydb=
So, I assume that only the installed extension is plpgsql.
mydb=
and my extension directory:
postgres@dataserver1 :/opt/postgres/9.1/share/postgresql/extension> ll *python* -rw-r--r-- 1 root root 351 Aug 20 17:32 plpython2u--1.0.sql -rw-r--r-- 1 root root 196 Aug 20 17:32 plpython2u.control -rw-r--r-- 1 root root 402 Aug 20 17:32 plpython2u--unpackaged--1.0.sql -rw-r--r-- 1 root root 351 Jun 1 02:54 plpython3u--1.0.sql -rw-r--r-- 1 root root 196 Jun 1 02:54 plpython3u.control -rw-r--r-- 1 root root 402 Jun 1 02:54 plpython3u--unpackaged--1.0.sql -rw-r--r-- 1 root root 347 Aug 20 17:32 plpythonu--1.0.sql -rw-r--r-- 1 root root 194 Aug 20 17:32 plpythonu.control -rw-r--r-- 1 root root 393 Aug 20 17:32 plpythonu--unpackaged--1.0.sql
EDIT
I work on Linux SuSE but got your point.
In my postgres instalation, the pl-lang libraries are in ... / postgres / 9.1 / lib / postgres. Inside it there are plpython2.so and plpython3.so
Checking the dynamic linked libraries of these files:
alfonso@dataserver1 :/opt/postgres/9.1/lib/postgresql> sudo ldd plpython2.so linux-vdso.so.1 => (0x00007fff5e945000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f64064df000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f64062da000) libutil.so.1 => /lib64/libutil.so.1 (0x00007f64060d7000) libm.so.6 => /lib64/libm.so.6 (0x00007f6405e5e000) libc.so.6 => /lib64/libc.so.6 (0x00007f6405ae9000) /lib64/ld-linux-x86-64.so.2 (0x00007f6406b2e000)
There is no link to any python library, nor for plpython3.so
But I installed python 2.6 and python 3.2. Please note that I want to install the extension for python 2.
And yes, CREATE EXTENSION is still crashing:
mydb=