Re: Reply: [GENERAL] 回复: [GENERAL] Can't create plpython language - Mailing list pgsql-general
From | Raghavendra |
---|---|
Subject | Re: Reply: [GENERAL] 回复: [GENERAL] Can't create plpython language |
Date | |
Msg-id | CA+h6AhiQDjamL3BGpy0-6EC4FA9kLBw4vReDbu6x1guEmXUJFw@mail.gmail.com Whole thread Raw |
In response to | =?gb18030?B?UmU6IFJlcGx5OiBbR0VORVJBTF0gu9i4tKO6IFtH?= =?gb18030?B?RU5FUkFMXSBDYW4ndCBjcmVhdGUgcGxweXRob24g?= =?gb18030?B?bGFuZ3VhZ2U=?= ("guxiaobo1982" <guxiaobo1982@qq.com>) |
List | pgsql-general |
On Mon, Jul 15, 2013 at 7:10 PM, guxiaobo1982 <guxiaobo1982@qq.com> wrote:
It works with ActivePython 3.2.2.3,
Thanks for notifying.
but not ActivePython 2.7.2.5.
No idea... :), I tried AP 3.2 with PG 9.2 & PG 9.3B it went fine for me.
------------------ Original ------------------From: "Raghavendra"<raghavendra.rao@enterprisedb.com>;Date: Jul 11, 2013To: "guxiaobo1982"<guxiaobo1982@qq.com>;Cc: "Jov"<amutu@amutu.com>; "Michael Paquier"<michael.paquier@gmail.com>; "pgsql-general"<pgsql-general@postgresql.org>; "Asif Naeem"<asif.naeem@enterprisedb.com>;Subject: Re: Reply: [GENERAL] 回复: [GENERAL] Can't create plpython languageOn Wed, Jul 10, 2013 at 7:36 AM, guxiaobo1982 <guxiaobo1982@qq.com> wrote:I am using PostgreSQL 9.3 beta 2[postgres@lix Multicorn-master]$ psqlpsql (9.3beta2)Type "help" for help.postgres=#It does not work with ActivePython3.2(ActivePython-3.2.2.3-linux-x86_64.tar.gz), Which version of PostgreSQL are you running?Sorry for being late on this email. I overlooked the version you were pointing. I didn't test on PG 9.3Beta, I did on PG 9.2 after looking your error showing PG 9.2.4[postgres@lix PostgreSQL]$ psql
Password:
psql (9.2.4)
Type "help" for help.
postgres=# create language plpython2u;
ERROR: could not access file "$libdir/plpython2": No such file or directory
postgres=# create language plpython3u;
ERROR: could not access file "$libdir/plpython3": No such file or directoryLater, I began testing it with PG 9.3beta and encountered same error message as you have shared here.Did some analysis and finally succeeded to create language plpython3u with AP-3.2, however with not many tweaks in compilation.(Steps might be arguing. Pardon me).Despite the fact that I have ActivePython-3.2 on my system, source compilation was looking for shared library. Hence compiled explicitly with shared_libpython=yes.Pre-Steps: (Assuming you have ActivePython 3.2)cd /opt/ActivePython-3.2/bin/cp python3.2-config python-configcp python3. pythonTest:export PATH=/opt/ActivePython-3.2/bin:$PATH# which python
/opt/ActivePython-3.2/bin/python
# which python-config
/opt/ActivePython-3.2/bin/python-configSteps:1. Install PG 9.3 beta with below steps:export PATH=/opt/ActivePython-3.2/bin:$PATH./configure --prefix=/usr/local/pg93b3 --with-pythonmake shared_libpython=yesmake shared_libpython=yes install2. After installation you should see below files in your PG installation Path:[root@localhost pg93b3]# pwd/usr/local/pg93b3[root@localhost pg93b3]# find . | grep python./lib/postgresql/plpython3.so./share/postgresql/extension/plpython3u--unpackaged--1.0.sql./share/postgresql/extension/plpython3u--1.0.sql./share/postgresql/extension/plpython3u.control3. Now, create new cluster using INITDB4. Before starting the cluster set the PYTHONHOME, PYTHONPATH, LD_LIBRARY_PATHexport PYTHONHOME=/opt/ActivePython-3.2/export PYTHONPATH=/opt/ActivePython-3.2/bin:$PATHexport LD_LIBRARY_PATH=/opt/ActivePython-3.2/lib:$LD_LIBRARY_PATH5. Start the cluster and create the language:/usr/local/pg93b3/bin/pg_ctl -D /usr/local/pg93b3/data/ start-bash-4.1$ psql -p 4444
psql (9.3beta1)
Type "help" for help.
postgres=# create language plpython3u;
CREATE LANGUAGEOut of my analysis on the issue, Asif Naeem from our Dev group shared his valuable thoughts to conclude this. Thanks Asif.Question still in mind, Why plpython depends on Shared Libraries (.so) ?
pgsql-general by date: